The patch titled Subject: kasan, arm64: use ARCH_SLAB_MINALIGN instead of manual aligning has been added to the -mm tree. Its filename is kasan-arm64-use-arch_slab_minalign-instead-of-manual-aligning.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/kasan-arm64-use-arch_slab_minalign-instead-of-manual-aligning.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/kasan-arm64-use-arch_slab_minalign-instead-of-manual-aligning.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: Andrey Konovalov <andreyknvl@xxxxxxxxxx> Subject: kasan, arm64: use ARCH_SLAB_MINALIGN instead of manual aligning Instead of changing cache->align to be aligned to KASAN_SHADOW_SCALE_SIZE in kasan_cache_create() we can reuse the ARCH_SLAB_MINALIGN macro. Link: http://lkml.kernel.org/r/b16c90197bb2c06c780e6e981c40345e03fda465.1546450432.git.andreyknvl@xxxxxxxxxx Signed-off-by: Andrey Konovalov <andreyknvl@xxxxxxxxxx> Suggested-by: Vincenzo Frascino <vincenzo.frascino@xxxxxxx> Cc: Andrey Ryabinin <aryabinin@xxxxxxxxxxxxx> Cc: Christoph Lameter <cl@xxxxxxxxx> Cc: Dmitry Vyukov <dvyukov@xxxxxxxxxx> Cc: Mark Rutland <mark.rutland@xxxxxxx> Cc: Will Deacon <will.deacon@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- arch/arm64/include/asm/kasan.h | 4 ++++ include/linux/slab.h | 1 + mm/kasan/common.c | 2 -- 3 files changed, 5 insertions(+), 2 deletions(-) --- a/arch/arm64/include/asm/kasan.h~kasan-arm64-use-arch_slab_minalign-instead-of-manual-aligning +++ a/arch/arm64/include/asm/kasan.h @@ -36,6 +36,10 @@ #define KASAN_SHADOW_OFFSET (KASAN_SHADOW_END - (1ULL << \ (64 - KASAN_SHADOW_SCALE_SHIFT))) +#ifdef CONFIG_KASAN_SW_TAGS +#define ARCH_SLAB_MINALIGN (1ULL << KASAN_SHADOW_SCALE_SHIFT) +#endif + void kasan_init(void); void kasan_copy_shadow(pgd_t *pgdir); asmlinkage void kasan_early_init(void); --- a/include/linux/slab.h~kasan-arm64-use-arch_slab_minalign-instead-of-manual-aligning +++ a/include/linux/slab.h @@ -16,6 +16,7 @@ #include <linux/overflow.h> #include <linux/types.h> #include <linux/workqueue.h> +#include <linux/kasan.h> /* --- a/mm/kasan/common.c~kasan-arm64-use-arch_slab_minalign-instead-of-manual-aligning +++ a/mm/kasan/common.c @@ -298,8 +298,6 @@ void kasan_cache_create(struct kmem_cach return; } - cache->align = round_up(cache->align, KASAN_SHADOW_SCALE_SIZE); - *flags |= SLAB_KASAN; } _ Patches currently in -mm which might be from andreyknvl@xxxxxxxxxx are kasan-arm64-use-arch_slab_minalign-instead-of-manual-aligning.patch kasan-make-tag-based-mode-work-with-config_hardened_usercopy.patch kasan-fix-krealloc-handling-for-tag-based-mode.patch