mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-25 21:24:08 +08:00
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>
This commit is contained in:
parent
c965cdd675
commit
795b760fe7
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user