Re: [PATCH][next] perf/x86/amd: fix potential integer overflow on shift of a int

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

 



On 12/2/22 11:36 AM, Ian Rogers wrote:
On Fri, Dec 2, 2022 at 5:52 AM Colin Ian King <colin.i.king@xxxxxxxxx> wrote:

The left shift of int 32 bit integer constant 1 is evaluated using 32 bit
arithmetic and then passed as a 64 bit function argument. In the case where
i is 32 or more this can lead to an overflow.  Avoid this by shifting
using the BIT_ULL macro instead.

Fixes: 471af006a747 ("perf/x86/amd: Constrain Large Increment per Cycle events")
Signed-off-by: Colin Ian King <colin.i.king@xxxxxxxxx>

Acked-by: Ian Rogers <irogers@xxxxxxxxxx>

Acked-by: Kim Phillips <kim.phillips@xxxxxxx>

Thanks,

Kim



[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