diff options
author | Andrey Konovalov <andreyknvl@google.com> | 2022-03-25 02:13:03 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2022-03-25 03:06:50 +0100 |
commit | 795b760fe741c0b82508947e7b76803a2cdabd13 (patch) | |
tree | b1d3448e517d1f610ddad5ae7ea7bd4946d095d7 /mm/kasan | |
parent | kasan: rename kasan_access_info to kasan_report_info (diff) | |
download | linux-795b760fe741c0b82508947e7b76803a2cdabd13.tar.xz linux-795b760fe741c0b82508947e7b76803a2cdabd13.zip |
kasan: add comment about UACCESS regions to kasan_report
Add a comment explaining why kasan_report() is the only reporting function
that uses user_access_save/restore().
Link: https://lkml.kernel.org/r/1201ca3c2be42c7bd077c53d2e46f4a51dd1476a.1646237226.git.andreyknvl@google.com
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Marco Elver <elver@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/kasan')
-rw-r--r-- | mm/kasan/report.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/mm/kasan/report.c b/mm/kasan/report.c index 7915af810815..08631d873204 100644 --- a/mm/kasan/report.c +++ b/mm/kasan/report.c @@ -430,6 +430,11 @@ void kasan_report_invalid_free(void *ptr, unsigned long ip) end_report(&flags, ptr); } +/* + * kasan_report() is the only reporting function that uses + * user_access_save/restore(): kasan_report_invalid_free() cannot be called + * from a UACCESS region, and kasan_report_async() is not used on x86. + */ bool kasan_report(unsigned long addr, size_t size, bool is_write, unsigned long ip) { |