CVE-2022-49748: perf/x86/amd: fix potential integer overflow on shift of a int
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
perf/x86/amd: fix potential integer overflow on shift of a int
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.
The Linux kernel CVE team has assigned CVE-2022-49748 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.4.22 with commit d8a6a443ff0aea5893f0a7f2726973b496b76420 and fixed in 5.4.231 with commit fbf7b0e4cef3b5470b610f14fb9faa5ee7f63954 Issue introduced in 5.6 with commit 471af006a747f1c535c8a8c6c0973c320fe01b22 and fixed in 5.10.166 with commit f84c9b72fb200633774704d8020f769c88a4b249 Issue introduced in 5.6 with commit 471af006a747f1c535c8a8c6c0973c320fe01b22 and fixed in 5.15.91 with commit 14cc13e433e1067557435b1adbf05608d7d47a93 Issue introduced in 5.6 with commit 471af006a747f1c535c8a8c6c0973c320fe01b22 and fixed in 6.1.9 with commit a4d01fb87ece45d4164fd725890211ccf9a307a9 Issue introduced in 5.6 with commit 471af006a747f1c535c8a8c6c0973c320fe01b22 and fixed in 6.2 with commit 08245672cdc6505550d1a5020603b0a8d4a6dcc7 Issue introduced in 5.5.6 with commit 3512462036dbe44d88e93e75ee8a993781183ddb
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2022-49748
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
arch/x86/events/amd/core.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/fbf7b0e4cef3b5470b610f14fb9faa5ee7f63954 https://git.kernel.org/stable/c/f84c9b72fb200633774704d8020f769c88a4b249 https://git.kernel.org/stable/c/14cc13e433e1067557435b1adbf05608d7d47a93 https://git.kernel.org/stable/c/a4d01fb87ece45d4164fd725890211ccf9a307a9 https://git.kernel.org/stable/c/08245672cdc6505550d1a5020603b0a8d4a6dcc7