The patch titled Subject: fs: dcache: manually unpoison dname after allocation to shut up kasan's reports has been removed from the -mm tree. Its filename was fs-dcache-manually-unpoison-dname-after-allocation-to-shut-up-kasans-reports.patch This patch was dropped because it was merged into mainline or a subsystem tree ------------------------------------------------------ From: Andrey Ryabinin <a.ryabinin@xxxxxxxxxxx> Subject: fs: dcache: manually unpoison dname after allocation to shut up kasan's reports We need to manually unpoison rounded up allocation size for dname to avoid kasan's reports in dentry_string_cmp(). When CONFIG_DCACHE_WORD_ACCESS=y dentry_string_cmp may access few bytes beyound requested in kmalloc() size. dentry_string_cmp() relates on that fact that dentry allocated using kmalloc and kmalloc internally round up allocation size. So this is not a bug, but this makes kasan to complain about such accesses. To avoid such reports we mark rounded up allocation size in shadow as accessible. Signed-off-by: Andrey Ryabinin <a.ryabinin@xxxxxxxxxxx> Reported-by: Dmitry Vyukov <dvyukov@xxxxxxxxxx> Cc: Konstantin Serebryany <kcc@xxxxxxxxxx> Cc: Dmitry Chernenkov <dmitryc@xxxxxxxxxx> Signed-off-by: Andrey Konovalov <adech.fo@xxxxxxxxx> Cc: Yuri Gribov <tetra2005@xxxxxxxxx> Cc: Konstantin Khlebnikov <koct9i@xxxxxxxxx> Cc: Sasha Levin <sasha.levin@xxxxxxxxxx> Cc: Christoph Lameter <cl@xxxxxxxxx> Cc: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx> Cc: Dave Hansen <dave.hansen@xxxxxxxxx> Cc: Andi Kleen <andi@xxxxxxxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Cc: "H. Peter Anvin" <hpa@xxxxxxxxx> Cc: Christoph Lameter <cl@xxxxxxxxx> Cc: Pekka Enberg <penberg@xxxxxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/dcache.c | 5 +++++ 1 file changed, 5 insertions(+) diff -puN fs/dcache.c~fs-dcache-manually-unpoison-dname-after-allocation-to-shut-up-kasans-reports fs/dcache.c --- a/fs/dcache.c~fs-dcache-manually-unpoison-dname-after-allocation-to-shut-up-kasans-reports +++ a/fs/dcache.c @@ -38,6 +38,8 @@ #include <linux/prefetch.h> #include <linux/ratelimit.h> #include <linux/list_lru.h> +#include <linux/kasan.h> + #include "internal.h" #include "mount.h" @@ -1429,6 +1431,9 @@ struct dentry *__d_alloc(struct super_bl } atomic_set(&p->u.count, 1); dname = p->name; + if (IS_ENABLED(CONFIG_DCACHE_WORD_ACCESS)) + kasan_unpoison_shadow(dname, + round_up(name->len + 1, sizeof(unsigned long))); } else { dname = dentry->d_iname; } _ Patches currently in -mm which might be from a.ryabinin@xxxxxxxxxxx are origin.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html