commit | 05c56e7b4319d7f6352f27da876a1acdc8fa5cc4 | [log] [tgz] |
---|---|---|
author | Andrey Konovalov <[email protected]> | Tue Jul 04 02:52:05 2023 +0200 |
committer | Andrew Morton <[email protected]> | Sat Jul 08 09:29:32 2023 -0700 |
tree | d96d4b6d90e479f73e7e9b41c5a8b85a3ea43f60 | |
parent | d3a808ec787e8cbfee053405f95105b3be3c7743 [diff] |
kasan: fix type cast in memory_is_poisoned_n Commit bb6e04a173f0 ("kasan: use internal prototypes matching gcc-13 builtins") introduced a bug into the memory_is_poisoned_n implementation: it effectively removed the cast to a signed integer type after applying KASAN_GRANULE_MASK. As a result, KASAN started failing to properly check memset, memcpy, and other similar functions. Fix the bug by adding the cast back (through an additional signed integer variable to make the code more readable). Link: https://lkml.kernel.org/r/8c9e0251c2b8b81016255709d4ec42942dcaf018.1688431866.git.andreyknvl@google.com Fixes: bb6e04a173f0 ("kasan: use internal prototypes matching gcc-13 builtins") Signed-off-by: Andrey Konovalov <[email protected]> Cc: Alexander Potapenko <[email protected]> Cc: Andrey Ryabinin <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Dmitry Vyukov <[email protected]> Cc: Marco Elver <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]>