The patch titled Subject: kasan-detect-negative-size-in-memory-operation-function-fix-2 has been added to the -mm tree. Its filename is kasan-detect-negative-size-in-memory-operation-function-fix-2.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/kasan-detect-negative-size-in-memory-operation-function-fix-2.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/kasan-detect-negative-size-in-memory-operation-function-fix-2.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Peter Zijlstra <peterz@xxxxxxxxxxxxx> Subject: kasan-detect-negative-size-in-memory-operation-function-fix-2 fix objtool warning mm/kasan/common.o: warning: objtool: kasan_report()+0x13: call to report_enabled() with UACCESS enabled Link: http://lkml.kernel.org/r/20200305095436.GV2596@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Reported-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx> Reviewed-by: Walter Wu <walter-zh.wu@xxxxxxxxxxxx> Tested-by: Walter Wu <walter-zh.wu@xxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/kasan/common.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) --- a/mm/kasan/common.c~kasan-detect-negative-size-in-memory-operation-function-fix-2 +++ a/mm/kasan/common.c @@ -641,16 +641,17 @@ extern bool report_enabled(void); bool kasan_report(unsigned long addr, size_t size, bool is_write, unsigned long ip) { - unsigned long flags; + unsigned long flags = user_access_save(); + bool ret = false; - if (likely(!report_enabled())) - return false; + if (likely(report_enabled())) { + __kasan_report(addr, size, is_write, ip); + ret = true; + } - flags = user_access_save(); - __kasan_report(addr, size, is_write, ip); user_access_restore(flags); - return true; + return ret; } #ifdef CONFIG_MEMORY_HOTPLUG _ Patches currently in -mm which might be from peterz@xxxxxxxxxxxxx are kasan-detect-negative-size-in-memory-operation-function-fix-2.patch