2019-06-04 10:11:33 +02:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-11 20:53:52 -07:00
|
|
|
|
2017-02-24 15:00:08 -08:00
|
|
|
|
2019-07-11 20:53:52 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
2016-05-20 16:59:34 -07:00
|
|
|
|
2019-07-11 20:53:52 -07:00
|
|
|
|
|
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
2021-02-24 12:05:21 -08:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
2016-05-20 16:59:34 -07:00
|
|
|
|
2019-09-23 15:34:16 -07:00
|
|
|
|
2019-11-30 17:54:53 -08:00
|
|
|
|
2022-03-24 18:11:59 -07:00
|
|
|
|
2019-09-23 15:34:16 -07:00
|
|
|
|
|
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
2020-10-13 16:55:02 -07:00
|
|
|
|
|
|
|
|
|
2020-08-06 23:24:54 -07:00
|
|
|
|
|
|
|
|
|
2020-12-22 12:00:24 -08:00
|
|
|
|
2020-08-06 23:24:54 -07:00
|
|
|
|
kasan: stop tests being eliminated as dead code with FORTIFY_SOURCE
Patch series "Fix some incompatibilites between KASAN and FORTIFY_SOURCE", v4.
3 KASAN self-tests fail on a kernel with both KASAN and FORTIFY_SOURCE:
memchr, memcmp and strlen.
When FORTIFY_SOURCE is on, a number of functions are replaced with
fortified versions, which attempt to check the sizes of the operands.
However, these functions often directly invoke __builtin_foo() once they
have performed the fortify check. The compiler can detect that the
results of these functions are not used, and knows that they have no other
side effects, and so can eliminate them as dead code.
Why are only memchr, memcmp and strlen affected?
================================================
Of string and string-like functions, kasan_test tests:
* strchr -> not affected, no fortified version
* strrchr -> likewise
* strcmp -> likewise
* strncmp -> likewise
* strnlen -> not affected, the fortify source implementation calls the
underlying strnlen implementation which is instrumented, not
a builtin
* strlen -> affected, the fortify souce implementation calls a __builtin
version which the compiler can determine is dead.
* memchr -> likewise
* memcmp -> likewise
* memset -> not affected, the compiler knows that memset writes to its
first argument and therefore is not dead.
Why does this not affect the functions normally?
================================================
In string.h, these functions are not marked as __pure, so the compiler
cannot know that they do not have side effects. If relevant functions are
marked as __pure in string.h, we see the following warnings and the
functions are elided:
lib/test_kasan.c: In function `kasan_memchr':
lib/test_kasan.c:606:2: warning: statement with no effect [-Wunused-value]
memchr(ptr, '1', size + 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~
lib/test_kasan.c: In function `kasan_memcmp':
lib/test_kasan.c:622:2: warning: statement with no effect [-Wunused-value]
memcmp(ptr, arr, size+1);
^~~~~~~~~~~~~~~~~~~~~~~~
lib/test_kasan.c: In function `kasan_strings':
lib/test_kasan.c:645:2: warning: statement with no effect [-Wunused-value]
strchr(ptr, '1');
^~~~~~~~~~~~~~~~
...
This annotation would make sense to add and could be added at any point,
so the behaviour of test_kasan.c should change.
The fix
=======
Make all the functions that are pure write their results to a global,
which makes them live. The strlen and memchr tests now pass.
The memcmp test still fails to trigger, which is addressed in the next
patch.
[dja@axtens.net: drop patch 3]
Link: http://lkml.kernel.org/r/20200424145521.8203-2-dja@axtens.net
Fixes: 0c96350a2d2f ("lib/test_kasan.c: add tests for several string/memory API functions")
Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Tested-by: David Gow <davidgow@google.com>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Cc: Daniel Micay <danielmicay@gmail.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Alexander Potapenko <glider@google.com>
Link: http://lkml.kernel.org/r/20200423154503.5103-1-dja@axtens.net
Link: http://lkml.kernel.org/r/20200423154503.5103-2-dja@axtens.net
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-06-03 15:56:43 -07:00
|
|
|
|
2021-02-24 12:05:13 -08:00
|
|
|
|
|
|
|
|
|
kasan: stop tests being eliminated as dead code with FORTIFY_SOURCE
Patch series "Fix some incompatibilites between KASAN and FORTIFY_SOURCE", v4.
3 KASAN self-tests fail on a kernel with both KASAN and FORTIFY_SOURCE:
memchr, memcmp and strlen.
When FORTIFY_SOURCE is on, a number of functions are replaced with
fortified versions, which attempt to check the sizes of the operands.
However, these functions often directly invoke __builtin_foo() once they
have performed the fortify check. The compiler can detect that the
results of these functions are not used, and knows that they have no other
side effects, and so can eliminate them as dead code.
Why are only memchr, memcmp and strlen affected?
================================================
Of string and string-like functions, kasan_test tests:
* strchr -> not affected, no fortified version
* strrchr -> likewise
* strcmp -> likewise
* strncmp -> likewise
* strnlen -> not affected, the fortify source implementation calls the
underlying strnlen implementation which is instrumented, not
a builtin
* strlen -> affected, the fortify souce implementation calls a __builtin
version which the compiler can determine is dead.
* memchr -> likewise
* memcmp -> likewise
* memset -> not affected, the compiler knows that memset writes to its
first argument and therefore is not dead.
Why does this not affect the functions normally?
================================================
In string.h, these functions are not marked as __pure, so the compiler
cannot know that they do not have side effects. If relevant functions are
marked as __pure in string.h, we see the following warnings and the
functions are elided:
lib/test_kasan.c: In function `kasan_memchr':
lib/test_kasan.c:606:2: warning: statement with no effect [-Wunused-value]
memchr(ptr, '1', size + 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~
lib/test_kasan.c: In function `kasan_memcmp':
lib/test_kasan.c:622:2: warning: statement with no effect [-Wunused-value]
memcmp(ptr, arr, size+1);
^~~~~~~~~~~~~~~~~~~~~~~~
lib/test_kasan.c: In function `kasan_strings':
lib/test_kasan.c:645:2: warning: statement with no effect [-Wunused-value]
strchr(ptr, '1');
^~~~~~~~~~~~~~~~
...
This annotation would make sense to add and could be added at any point,
so the behaviour of test_kasan.c should change.
The fix
=======
Make all the functions that are pure write their results to a global,
which makes them live. The strlen and memchr tests now pass.
The memcmp test still fails to trigger, which is addressed in the next
patch.
[dja@axtens.net: drop patch 3]
Link: http://lkml.kernel.org/r/20200424145521.8203-2-dja@axtens.net
Fixes: 0c96350a2d2f ("lib/test_kasan.c: add tests for several string/memory API functions")
Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Tested-by: David Gow <davidgow@google.com>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Cc: Daniel Micay <danielmicay@gmail.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Alexander Potapenko <glider@google.com>
Link: http://lkml.kernel.org/r/20200423154503.5103-1-dja@axtens.net
Link: http://lkml.kernel.org/r/20200423154503.5103-2-dja@axtens.net
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-06-03 15:56:43 -07:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:02 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-24 18:12:02 -07:00
|
|
|
|
2020-10-13 16:55:02 -07:00
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:13 -08:00
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:26 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:13 -08:00
|
|
|
|
2020-10-13 16:55:02 -07:00
|
|
|
|
|
|
|
|
|
2021-02-24 12:06:02 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:02 -07:00
|
|
|
|
2022-03-24 18:12:02 -07:00
|
|
|
|
|
|
|
|
|
2021-04-29 23:00:49 -07:00
|
|
|
|
2022-03-24 18:12:02 -07:00
|
|
|
|
2020-10-13 16:55:02 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-24 18:12:02 -07:00
|
|
|
|
2020-10-13 16:55:02 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:13 -08:00
|
|
|
|
|
|
|
|
|
2022-03-24 18:12:02 -07:00
|
|
|
|
2021-02-24 12:05:13 -08:00
|
|
|
|
2021-02-24 12:05:26 -08:00
|
|
|
|
2022-03-24 18:12:02 -07:00
|
|
|
|
2021-03-15 13:20:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:34 -08:00
|
|
|
|
2022-03-24 18:12:02 -07:00
|
|
|
|
2021-02-24 12:05:34 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-04-29 23:00:49 -07:00
|
|
|
|
2022-03-24 18:12:02 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:02 -07:00
|
|
|
|
2021-04-29 23:00:49 -07:00
|
|
|
|
|
|
|
|
|
2021-10-06 16:47:51 +01:00
|
|
|
|
2021-04-29 23:00:49 -07:00
|
|
|
|
2022-03-24 18:12:02 -07:00
|
|
|
|
2021-04-29 23:00:49 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-24 18:12:02 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
kasan: test: improve failure message in KUNIT_EXPECT_KASAN_FAIL()
The KUNIT_EXPECT_KASAN_FAIL() macro currently uses KUNIT_EXPECT_EQ() to
compare fail_data.report_expected and fail_data.report_found. This always
gave a somewhat useless error message on failure, but the addition of
extra compile-time checking with READ_ONCE() has caused it to get much
longer, and be truncated before anything useful is displayed.
Instead, just check fail_data.report_found by hand (we've just set
report_expected to 'true'), and print a better failure message with
KUNIT_FAIL(). Because of this, report_expected is no longer used
anywhere, and can be removed.
Beforehand, a failure in:
KUNIT_EXPECT_KASAN_FAIL(test, ((volatile char *)area)[3100]);
would have looked like:
[22:00:34] [FAILED] vmalloc_oob
[22:00:34] # vmalloc_oob: EXPECTATION FAILED at lib/test_kasan.c:991
[22:00:34] Expected ({ do { extern void __compiletime_assert_705(void) __attribute__((__error__("Unsupported access size for {READ,WRITE}_ONCE()."))); if (!((sizeof(fail_data.report_expected) == sizeof(char) || sizeof(fail_data.repp
[22:00:34] not ok 45 - vmalloc_oob
With this change, it instead looks like:
[22:04:04] [FAILED] vmalloc_oob
[22:04:04] # vmalloc_oob: EXPECTATION FAILED at lib/test_kasan.c:993
[22:04:04] KASAN failure expected in "((volatile char *)area)[3100]", but none occurred
[22:04:04] not ok 45 - vmalloc_oob
Also update the example failure in the documentation to reflect this.
Link: https://lkml.kernel.org/r/20210606005531.165954-1-davidgow@google.com
Signed-off-by: David Gow <davidgow@google.com>
Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com>
Reviewed-by: Marco Elver <elver@google.com>
Acked-by: Brendan Higgins <brendanhiggins@google.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Daniel Axtens <dja@axtens.net>
Cc: David Gow <davidgow@google.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-06-28 19:40:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-24 18:12:02 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-04-29 23:00:49 -07:00
|
|
|
|
|
|
|
|
|
2022-03-24 18:12:02 -07:00
|
|
|
|
2020-10-13 16:55:02 -07:00
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:17 -08:00
|
|
|
|
2021-06-24 23:58:15 -07:00
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:17 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-06-24 23:58:15 -07:00
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:17 -08:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
2021-09-02 14:57:32 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2020-08-06 23:24:54 -07:00
|
|
|
|
2022-06-08 14:40:24 -07:00
|
|
|
|
2021-09-02 14:57:32 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
2022-06-08 14:40:24 -07:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
2022-06-08 14:40:24 -07:00
|
|
|
|
2021-09-02 14:57:35 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:55 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:17 -08:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2016-03-25 14:21:56 -07:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2020-08-06 23:24:54 -07:00
|
|
|
|
2022-06-08 14:40:24 -07:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2021-02-24 12:05:55 -08:00
|
|
|
|
2016-03-25 14:21:56 -07:00
|
|
|
|
|
|
|
|
|
2018-02-06 15:36:23 -08:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2018-02-06 15:36:23 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:17 -08:00
|
|
|
|
2018-02-06 15:36:23 -08:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
|
|
|
|
|
2018-02-06 15:36:23 -08:00
|
|
|
|
2021-02-24 12:05:55 -08:00
|
|
|
|
2021-09-02 14:57:35 -07:00
|
|
|
|
2018-02-06 15:36:23 -08:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2018-02-06 15:36:23 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:17 -08:00
|
|
|
|
2018-02-06 15:36:23 -08:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-02-06 15:36:23 -08:00
|
|
|
|
2016-03-25 14:21:56 -07:00
|
|
|
|
2021-02-24 12:05:55 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-09-02 14:57:35 -07:00
|
|
|
|
2021-02-24 12:05:55 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-09-02 14:57:35 -07:00
|
|
|
|
2021-02-24 12:05:55 -08:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2016-03-25 14:21:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:13 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-03-25 14:21:56 -07:00
|
|
|
|
|
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
2022-06-08 14:40:24 -07:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-25 17:20:15 -08:00
|
|
|
|
|
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
2021-02-25 17:20:15 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
|
|
|
|
|
2020-08-06 23:24:54 -07:00
|
|
|
|
2021-02-25 17:20:15 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-25 17:20:15 -08:00
|
|
|
|
|
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
2021-02-25 17:20:15 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2020-08-06 23:24:54 -07:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
|
|
|
|
|
2020-08-06 23:24:54 -07:00
|
|
|
|
2021-02-25 17:20:15 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-25 17:20:15 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-25 17:20:19 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-11 17:42:44 +01:00
|
|
|
|
2021-02-25 17:20:19 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-01 17:07:37 -08:00
|
|
|
|
2021-02-24 12:05:17 -08:00
|
|
|
|
2020-11-01 17:07:37 -08:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
|
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
|
|
|
|
|
2022-06-08 14:40:24 -07:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-01 17:07:37 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-09-02 14:57:38 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2015-11-05 18:51:15 -08:00
|
|
|
|
|
|
|
|
|
2021-09-02 14:57:38 -07:00
|
|
|
|
2015-11-05 18:51:15 -08:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2020-08-06 23:24:54 -07:00
|
|
|
|
2021-11-05 13:36:12 -07:00
|
|
|
|
2021-09-02 14:57:38 -07:00
|
|
|
|
2015-11-05 18:51:15 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2015-11-05 18:51:15 -08:00
|
|
|
|
|
|
|
|
|
2021-09-02 14:57:38 -07:00
|
|
|
|
2015-11-05 18:51:15 -08:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2020-08-06 23:24:54 -07:00
|
|
|
|
2021-11-05 13:36:12 -07:00
|
|
|
|
2021-09-02 14:57:38 -07:00
|
|
|
|
2015-11-05 18:51:15 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2015-11-05 18:51:15 -08:00
|
|
|
|
|
|
|
|
|
2021-09-02 14:57:38 -07:00
|
|
|
|
2015-11-05 18:51:15 -08:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2020-08-06 23:24:54 -07:00
|
|
|
|
2021-11-05 13:36:12 -07:00
|
|
|
|
2021-09-02 14:57:38 -07:00
|
|
|
|
2015-11-05 18:51:15 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2015-11-05 18:51:15 -08:00
|
|
|
|
|
|
|
|
|
2021-09-02 14:57:38 -07:00
|
|
|
|
2015-11-05 18:51:15 -08:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2020-08-06 23:24:54 -07:00
|
|
|
|
2021-11-05 13:36:12 -07:00
|
|
|
|
2021-09-02 14:57:38 -07:00
|
|
|
|
2015-11-05 18:51:15 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
2021-09-02 14:57:38 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2020-08-06 23:24:54 -07:00
|
|
|
|
2022-01-29 13:41:11 -08:00
|
|
|
|
2021-11-05 13:36:12 -07:00
|
|
|
|
2021-09-02 14:57:38 -07:00
|
|
|
|
|
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-11-05 13:35:56 -07:00
|
|
|
|
2020-04-01 21:09:40 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-11-05 13:36:12 -07:00
|
|
|
|
2020-04-01 21:09:40 -07:00
|
|
|
|
2021-09-02 14:57:41 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-01 21:09:40 -07:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2020-04-01 21:09:40 -07:00
|
|
|
|
|
|
|
|
|
2022-01-29 13:41:11 -08:00
|
|
|
|
2021-11-05 13:36:12 -07:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
|
|
|
|
|
2020-04-01 21:09:40 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-11-05 13:35:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-01 21:09:40 -07:00
|
|
|
|
2022-01-29 13:41:11 -08:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
|
|
|
|
|
2020-04-01 21:09:40 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
2021-09-02 14:57:35 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-09-02 14:57:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:38 -08:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
2021-02-24 12:05:38 -08:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:38 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-09-02 14:57:35 -07:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2019-09-23 15:34:16 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2019-09-23 15:34:16 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2019-09-23 15:34:16 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2019-09-23 15:34:16 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:59 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2021-02-24 12:05:59 -08:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2021-02-24 12:05:59 -08:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:59 -08:00
|
|
|
|
2017-02-24 15:00:08 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2017-02-24 15:00:08 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-11-17 15:28:00 -08:00
|
|
|
|
2017-02-24 15:00:08 -08:00
|
|
|
|
2017-11-17 15:28:00 -08:00
|
|
|
|
2017-02-24 15:00:08 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:59 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
2022-01-14 14:04:51 -08:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
2021-05-14 17:27:27 -07:00
|
|
|
|
|
|
|
|
|
2021-07-07 18:07:28 -07:00
|
|
|
|
2021-05-14 17:27:27 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
2020-11-01 17:07:37 -08:00
|
|
|
|
2021-02-24 12:05:17 -08:00
|
|
|
|
2020-11-01 17:07:37 -08:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|
2022-01-14 14:04:51 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:50 -08:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2016-05-20 16:59:17 -07:00
|
|
|
|
|
|
|
|
|
2018-02-06 15:36:48 -08:00
|
|
|
|
2016-05-20 16:59:17 -07:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2016-05-20 16:59:17 -07:00
|
|
|
|
2021-02-24 12:05:13 -08:00
|
|
|
|
2022-06-08 14:40:24 -07:00
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:13 -08:00
|
|
|
|
2016-05-20 16:59:17 -07:00
|
|
|
|
2021-02-24 12:05:13 -08:00
|
|
|
|
|
|
|
|
|
2021-09-02 14:57:35 -07:00
|
|
|
|
2021-02-24 12:05:13 -08:00
|
|
|
|
2016-05-20 16:59:17 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-08 14:40:24 -07:00
|
|
|
|
2021-02-24 12:05:50 -08:00
|
|
|
|
2021-09-02 14:57:47 -07:00
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:50 -08:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2016-05-20 16:59:34 -07:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2022-03-24 18:12:08 -07:00
|
|
|
|
2021-05-14 17:27:27 -07:00
|
|
|
|
|
|
|
|
|
2016-05-20 16:59:34 -07:00
|
|
|
|
2021-02-24 12:05:17 -08:00
|
|
|
|
2016-05-20 16:59:34 -07:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2016-05-20 16:59:34 -07:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2018-02-06 15:36:16 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-24 18:12:08 -07:00
|
|
|
|
2021-05-14 17:27:27 -07:00
|
|
|
|
|
|
|
|
|
2018-02-06 15:36:16 -08:00
|
|
|
|
2020-11-01 17:07:37 -08:00
|
|
|
|
2021-02-24 12:05:17 -08:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
|
|
|
|
|
2018-02-06 15:36:16 -08:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2018-02-06 15:36:16 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-24 18:12:08 -07:00
|
|
|
|
2021-05-14 17:27:27 -07:00
|
|
|
|
|
|
|
|
|
2018-02-06 15:36:16 -08:00
|
|
|
|
2020-11-01 17:07:37 -08:00
|
|
|
|
2021-02-24 12:05:17 -08:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
|
|
|
|
|
2018-02-06 15:36:16 -08:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2018-02-06 15:36:37 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
|
|
|
|
|
2018-02-06 15:36:37 -08:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2018-02-06 15:36:37 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2018-02-06 15:36:37 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2018-02-06 15:36:37 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
|
|
|
|
|
2018-02-06 15:36:37 -08:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2018-02-06 15:36:37 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:13 -08:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2018-04-10 16:30:35 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-02-06 15:36:37 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-25 19:10:59 -08:00
|
|
|
|
|
|
|
|
|
2022-01-14 14:04:57 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-25 19:10:59 -08:00
|
|
|
|
|
|
|
|
|
2022-01-14 14:04:57 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2018-10-26 15:02:34 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:13 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:17 -08:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2020-11-01 17:07:37 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-01-29 13:41:11 -08:00
|
|
|
|
kasan: test: silence intentional read overflow warnings
As done in commit d73dad4eb5ad ("kasan: test: bypass __alloc_size
checks") for __write_overflow warnings, also silence some more cases
that trip the __read_overflow warnings seen in 5.16-rc1[1]:
In file included from include/linux/string.h:253,
from include/linux/bitmap.h:10,
from include/linux/cpumask.h:12,
from include/linux/mm_types_task.h:14,
from include/linux/mm_types.h:5,
from include/linux/page-flags.h:13,
from arch/arm64/include/asm/mte.h:14,
from arch/arm64/include/asm/pgtable.h:12,
from include/linux/pgtable.h:6,
from include/linux/kasan.h:29,
from lib/test_kasan.c:10:
In function 'memcmp',
inlined from 'kasan_memcmp' at lib/test_kasan.c:897:2:
include/linux/fortify-string.h:263:25: error: call to '__read_overflow' declared with attribute error: detected read beyond size of object (1st parameter)
263 | __read_overflow();
| ^~~~~~~~~~~~~~~~~
In function 'memchr',
inlined from 'kasan_memchr' at lib/test_kasan.c:872:2:
include/linux/fortify-string.h:277:17: error: call to '__read_overflow' declared with attribute error: detected read beyond size of object (1st parameter)
277 | __read_overflow();
| ^~~~~~~~~~~~~~~~~
[1] http://kisskb.ellerman.id.au/kisskb/buildresult/14660585/log/
Link: https://lkml.kernel.org/r/20211116004111.3171781-1-keescook@chromium.org
Fixes: d73dad4eb5ad ("kasan: test: bypass __alloc_size checks")
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com>
Acked-by: Marco Elver <elver@google.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-11-19 16:43:46 -08:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
|
|
|
|
|
2018-10-26 15:02:34 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2018-10-26 15:02:34 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:13 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:17 -08:00
|
|
|
|
2018-10-26 15:02:34 -07:00
|
|
|
|
2020-11-01 17:07:37 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
|
|
|
|
|
2018-10-26 15:02:34 -07:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2022-01-29 13:41:11 -08:00
|
|
|
|
kasan: test: silence intentional read overflow warnings
As done in commit d73dad4eb5ad ("kasan: test: bypass __alloc_size
checks") for __write_overflow warnings, also silence some more cases
that trip the __read_overflow warnings seen in 5.16-rc1[1]:
In file included from include/linux/string.h:253,
from include/linux/bitmap.h:10,
from include/linux/cpumask.h:12,
from include/linux/mm_types_task.h:14,
from include/linux/mm_types.h:5,
from include/linux/page-flags.h:13,
from arch/arm64/include/asm/mte.h:14,
from arch/arm64/include/asm/pgtable.h:12,
from include/linux/pgtable.h:6,
from include/linux/kasan.h:29,
from lib/test_kasan.c:10:
In function 'memcmp',
inlined from 'kasan_memcmp' at lib/test_kasan.c:897:2:
include/linux/fortify-string.h:263:25: error: call to '__read_overflow' declared with attribute error: detected read beyond size of object (1st parameter)
263 | __read_overflow();
| ^~~~~~~~~~~~~~~~~
In function 'memchr',
inlined from 'kasan_memchr' at lib/test_kasan.c:872:2:
include/linux/fortify-string.h:277:17: error: call to '__read_overflow' declared with attribute error: detected read beyond size of object (1st parameter)
277 | __read_overflow();
| ^~~~~~~~~~~~~~~~~
[1] http://kisskb.ellerman.id.au/kisskb/buildresult/14660585/log/
Link: https://lkml.kernel.org/r/20211116004111.3171781-1-keescook@chromium.org
Fixes: d73dad4eb5ad ("kasan: test: bypass __alloc_size checks")
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com>
Acked-by: Marco Elver <elver@google.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-11-19 16:43:46 -08:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
|
|
|
|
|
2018-10-26 15:02:34 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2018-10-26 15:02:34 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:13 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:17 -08:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-10-26 15:02:34 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2018-10-26 15:02:34 -07:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2018-10-26 15:02:34 -07:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2018-10-26 15:02:34 -07:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2018-10-26 15:02:34 -07:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2018-10-26 15:02:34 -07:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2018-10-26 15:02:34 -07:00
|
|
|
|
|
|
|
|
|
2020-11-01 17:07:37 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-11 20:53:52 -07:00
|
|
|
|
2020-11-01 17:07:37 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:17 -08:00
|
|
|
|
2020-11-01 17:07:37 -08:00
|
|
|
|
2019-07-11 20:53:52 -07:00
|
|
|
|
2021-02-24 12:05:13 -08:00
|
|
|
|
2019-07-11 20:53:52 -07:00
|
|
|
|
|
|
|
|
|
2020-11-01 17:07:37 -08:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2019-07-11 20:53:52 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-01 17:07:37 -08:00
|
|
|
|
2019-07-11 20:53:52 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-01 17:07:37 -08:00
|
|
|
|
2019-07-11 20:53:52 -07:00
|
|
|
|
2020-11-01 17:07:37 -08:00
|
|
|
|
|
|
|
|
|
2019-07-11 20:53:52 -07:00
|
|
|
|
2020-11-01 17:07:37 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-11 20:53:52 -07:00
|
|
|
|
2021-02-24 12:05:17 -08:00
|
|
|
|
|
|
|
|
|
2019-07-11 20:53:52 -07:00
|
|
|
|
2021-02-24 12:05:42 -08:00
|
|
|
|
|
|
|
|
|
2020-11-01 17:07:37 -08:00
|
|
|
|
2019-07-11 20:53:52 -07:00
|
|
|
|
2021-02-24 12:05:42 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-11 20:53:52 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2019-07-11 20:54:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2019-07-11 20:54:11 -07:00
|
|
|
|
2020-08-06 23:18:13 -07:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2019-07-11 20:54:11 -07:00
|
|
|
|
|
|
|
|
|
2022-03-24 18:11:59 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:55 -08:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2021-02-25 17:20:15 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-25 17:20:19 -08:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2020-11-01 17:07:37 -08:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-11-05 13:35:56 -07:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:59 -08:00
|
|
|
|
|
|
|
|
|
2022-01-14 14:04:51 -08:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:50 -08:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
|
|
|
|
|
2022-01-14 14:04:57 -08:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-01 17:07:37 -08:00
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2022-03-24 18:11:59 -07:00
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
2022-03-24 18:11:59 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-24 12:05:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-13 16:55:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-13 14:39:53 -08:00
|
|
|
|
|
|
|
|
|