summaryrefslogtreecommitdiff
path: root/mm/kasan
diff options
context:
space:
mode:
authorAndrey Konovalov <andreyknvl@google.com>2022-03-25 04:13:03 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2022-03-25 05:06:50 +0300
commit795b760fe741c0b82508947e7b76803a2cdabd13 (patch)
treeb1d3448e517d1f610ddad5ae7ea7bd4946d095d7 /mm/kasan
parentc965cdd67540ae8a6ac3da05cce4b7da3e0be94c (diff)
downloadlinux-795b760fe741c0b82508947e7b76803a2cdabd13.tar.xz
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.c5
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)
{