summaryrefslogtreecommitdiffstats
path: root/mm/kasan/report.c
diff options
context:
space:
mode:
authorAndrey Konovalov <andreyknvl@google.com>2022-03-25 02:13:03 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2022-03-25 03:06:50 +0100
commit795b760fe741c0b82508947e7b76803a2cdabd13 (patch)
treeb1d3448e517d1f610ddad5ae7ea7bd4946d095d7 /mm/kasan/report.c
parentkasan: rename kasan_access_info to kasan_report_info (diff)
downloadlinux-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/report.c')
-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)
{