The patch titled Subject: kasan-split-out-shadowc-from-commonc-fix has been added to the -mm tree. Its filename is kasan-split-out-shadowc-from-commonc-fix.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/kasan-split-out-shadowc-from-commonc-fix.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/kasan-split-out-shadowc-from-commonc-fix.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: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Subject: kasan-split-out-shadowc-from-commonc-fix retain changes from kfence-kasan-make-kfence-compatible-with-kasan.patch Cc: Andrey Konovalov <andreyknvl@xxxxxxxxxx> Cc: Marco Elver <elver@xxxxxxxxxx> Cc: Vincenzo Frascino <vincenzo.frascino@xxxxxxx> Cc: Alexander Potapenko <glider@xxxxxxxxxx> Cc: Andrey Ryabinin <aryabinin@xxxxxxxxxxxxx> Cc: Branislav Rankov <Branislav.Rankov@xxxxxxx> Cc: Catalin Marinas <catalin.marinas@xxxxxxx> Cc: Dmitry Vyukov <dvyukov@xxxxxxxxxx> Cc: Evgenii Stepanov <eugenis@xxxxxxxxxx> Cc: Kevin Brodsky <kevin.brodsky@xxxxxxx> Cc: Vasily Gorbik <gor@xxxxxxxxxxxxx> Cc: Will Deacon <will.deacon@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/kasan/shadow.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) --- a/mm/kasan/shadow.c~kasan-split-out-shadowc-from-commonc-fix +++ a/mm/kasan/shadow.c @@ -83,6 +83,10 @@ void kasan_poison_memory(const void *add */ address = reset_tag(address); + /* Skip KFENCE memory if called explicitly outside of sl*b. */ + if (is_kfence_address(address)) + return; + shadow_start = kasan_mem_to_shadow(address); shadow_end = kasan_mem_to_shadow(address + size); @@ -100,6 +104,14 @@ void kasan_unpoison_memory(const void *a */ address = reset_tag(address); + /* + * Skip KFENCE memory if called explicitly outside of sl*b. Also note + * that calls to ksize(), where size is not a multiple of machine-word + * size, would otherwise poison the invalid portion of the word. + */ + if (is_kfence_address(address)) + return; + kasan_poison_memory(address, size, tag); if (size & KASAN_GRANULE_MASK) { _ Patches currently in -mm which might be from akpm@xxxxxxxxxxxxxxxxxxxx are kthread_worker-document-cpu-hotplug-handling-fix.patch mm.patch mm-swap_state-skip-meaningless-swap-cache-readahead-when-ra_infowin-==-0-fix.patch mm-vmallocc-__vmalloc_area_node-avoid-32-bit-overflow.patch mm-vmstat-fix-proc-sys-vm-stat_refresh-generating-false-warnings-fix-2.patch lib-test_bitmapc-add-for_each_set_clump-test-cases-checkpatch-fixes.patch linux-next-rejects.patch kasan-split-out-shadowc-from-commonc-fix.patch kernel-forkc-export-kernel_thread-to-modules.patch