Description
In the Linux kernel, the following vulnerability has been resolved: media: solo6x10: Check for out of bounds chip_id Clang with CONFIG_UBSAN_SHIFT=y noticed a condition where a signed type (literal "1" is an "int") could end up being shifted beyond 32 bits, so instrumentation was added (and due to the double is_tw286x() call seen via inlining), Clang decides the second one must now be undefined behavior and elides the rest of the function[1]. This is a known problem with Clang (that is still being worked on), but we can avoid the entire problem by actually checking the existing max chip ID, and now there is no runtime instrumentation added at all since everything is known to be within bounds. Additionally use an unsigned value for the shift to remove the instrumentation even without the explicit bounds checking. [hverkuil: fix checkpatch warning for is_tw286x]
Product status
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (git) before c327192ca26670cf6e588c1eeda66cd2fa97630e
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (git) before 0b3dadada2417782a63ce32dae05bafe1c949e3f
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (git) before 603e3859393ee2ce91393b7d05e6e56e4b66e5cd
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (git) before 33af366211ee78e3b074ff44a16121e537e86826
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (git) before 5849ae68d7b8b6ad55cc1bf0d227dd2ae6362528
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (git) before d29f33b2cf98e4901cd5457d1ee34062e808df73
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (git) before 4d6db0c6bbbfd8d7bbdbf7ab6a9c003752abf116
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (git) before 0fdf6323c35a134f206dcad5babb4ff488552076
5.10.252 (semver)
5.15.202 (semver)
6.1.165 (semver)
6.6.128 (semver)
6.12.75 (semver)
6.18.16 (semver)
6.19.6 (semver)
7.0 (original_commit_for_fix)
References
git.kernel.org/...c/c327192ca26670cf6e588c1eeda66cd2fa97630e
git.kernel.org/...c/0b3dadada2417782a63ce32dae05bafe1c949e3f
git.kernel.org/...c/603e3859393ee2ce91393b7d05e6e56e4b66e5cd
git.kernel.org/...c/33af366211ee78e3b074ff44a16121e537e86826
git.kernel.org/...c/5849ae68d7b8b6ad55cc1bf0d227dd2ae6362528
git.kernel.org/...c/d29f33b2cf98e4901cd5457d1ee34062e808df73
git.kernel.org/...c/4d6db0c6bbbfd8d7bbdbf7ab6a9c003752abf116
git.kernel.org/...c/0fdf6323c35a134f206dcad5babb4ff488552076