The patch titled Subject: kernel: add support for .init_array.* constructors has been added to the -mm tree. Its filename is kernel-add-support-for-init_array-constructors.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/kernel-add-support-for-init_array-constructors.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/kernel-add-support-for-init_array-constructors.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/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Andrey Ryabinin <a.ryabinin@xxxxxxxxxxx> Subject: kernel: add support for .init_array.* constructors KASan uses constructors for initializing redzones for global variables. Globals instrumentation in GCC 4.9.2 produces constructors with priority (.init_array.00099) Currently kernel ignores such constructors. Only constructors with default priority supported (.init_array) This patch adds support for constructors with priorities. For kernel image we put pointers to constructors between __ctors_start/__ctors_end and do_ctors() will call them on start up. For modules we merge .init_array.* sections into resulting .init_array. Module code properly handles constructors in .init_array section. Signed-off-by: Andrey Ryabinin <a.ryabinin@xxxxxxxxxxx> Cc: Dmitry Vyukov <dvyukov@xxxxxxxxxx> Cc: Konstantin Serebryany <kcc@xxxxxxxxxx> Cc: Dmitry Chernenkov <dmitryc@xxxxxxxxxx> Cc: 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> Cc: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/asm-generic/vmlinux.lds.h | 1 + scripts/module-common.lds | 3 +++ 2 files changed, 4 insertions(+) diff -puN include/asm-generic/vmlinux.lds.h~kernel-add-support-for-init_array-constructors include/asm-generic/vmlinux.lds.h --- a/include/asm-generic/vmlinux.lds.h~kernel-add-support-for-init_array-constructors +++ a/include/asm-generic/vmlinux.lds.h @@ -478,6 +478,7 @@ #define KERNEL_CTORS() . = ALIGN(8); \ VMLINUX_SYMBOL(__ctors_start) = .; \ *(.ctors) \ + *(SORT(.init_array.*)) \ *(.init_array) \ VMLINUX_SYMBOL(__ctors_end) = .; #else diff -puN scripts/module-common.lds~kernel-add-support-for-init_array-constructors scripts/module-common.lds --- a/scripts/module-common.lds~kernel-add-support-for-init_array-constructors +++ a/scripts/module-common.lds @@ -16,4 +16,7 @@ SECTIONS { __kcrctab_unused : { *(SORT(___kcrctab_unused+*)) } __kcrctab_unused_gpl : { *(SORT(___kcrctab_unused_gpl+*)) } __kcrctab_gpl_future : { *(SORT(___kcrctab_gpl_future+*)) } + + . = ALIGN(8); + .init_array : { *(SORT(.init_array.*)) *(.init_array) } } _ Patches currently in -mm which might be from a.ryabinin@xxxxxxxxxxx are compiler-introduce-__aliassymbol-shortcut.patch add-kernel-address-sanitizer-infrastructure.patch kasan-disable-memory-hotplug.patch x86_64-add-kasan-support.patch mm-page_alloc-add-kasan-hooks-on-alloc-and-free-paths.patch mm-slub-introduce-virt_to_obj-function.patch mm-slub-share-object_err-function.patch mm-slub-introduce-metadata_access_enable-metadata_access_disable.patch mm-slub-add-kernel-address-sanitizer-support-for-slub-allocator.patch fs-dcache-manually-unpoison-dname-after-allocation-to-shut-up-kasans-reports.patch kmemleak-disable-kasan-instrumentation-for-kmemleak.patch lib-add-kasan-test-module.patch x86_64-kasan-add-interceptors-for-memset-memmove-memcpy-functions.patch kasan-enable-stack-instrumentation.patch mm-vmalloc-add-flag-preventing-guard-hole-allocation.patch mm-vmalloc-pass-additional-vm_flags-to-__vmalloc_node_range.patch kernel-add-support-for-init_array-constructors.patch module-fix-types-of-device-tables-aliases.patch kasan-enable-instrumentation-of-global-variables.patch hugetlb-sysctl-pass-extra1-=-null-rather-then-extra1-=-zero.patch mm-hugetlb-fix-type-of-hugetlb_treat_as_movable-variable.patch proc-pagemap-walk-page-tables-under-pte-lock.patch linux-next.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