Re: [PATCH v2 2/2] pwm: Fix double shift bug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 25, 2023 at 02:58:18PM +0300, Dan Carpenter wrote:
> These enums are passed to set/test_bit().  The set/test_bit() functions
> take a bit number instead of a shifted value.  Passing a shifted value
> is a double shift bug like doing BIT(BIT(1)).  The double shift bug
> doesn't cause a problem here because we are only checking 0 and 1 but
> if the value was 5 or above then it can lead to a buffer overflow.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> ---
> v2:  White space change.  Split the patch into two parts
> 
> I didn't put a Fixes tag because it doesn't affect run time

Reviewed-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>

Best regards and thanks!
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux