The commit is pushed to "branch-rh7-3.10.0-229.7.2-ovz" and will appear at 
https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-229.7.2.vz7.6.6
------>
commit db7ae5a5dcbe87b199efdb784074ff3597d06d42
Author: Andrey Ryabinin <aryabi...@odin.com>
Date:   Thu Sep 3 19:27:45 2015 +0400

    ms/module: fix types of device tables aliases
    
    https://jira.sw.ru/browse/PSBM-26429
    
    From: Andrey Ryabinin <a.ryabi...@samsung.com>
    
    commit 6301939d97d079f0d3dbe71e750f4daf5d39fc33 upstream.
    
    MODULE_DEVICE_TABLE() macro used to create aliases to device tables.
    Normally alias should have the same type as aliased symbol.
    
    Device tables are arrays, so they have 'struct type##_device_id[x]'
    types. Alias created by MODULE_DEVICE_TABLE() will have non-array type -
        'struct type##_device_id'.
    
    This inconsistency confuses compiler, it could make a wrong assumption
    about variable's size which leads KASan to produce a false positive report
    about out of bounds access.
    
    For every global variable compiler calls __asan_register_globals() passing
    information about global variable (address, size, size with redzone, name
    ...) __asan_register_globals() poison symbols redzone to detect possible
    out of bounds accesses.
    
    When symbol has an alias __asan_register_globals() will be called as for
    symbol so for alias.  Compiler determines size of variable by size of
    variable's type.  Alias and symbol have the same address, so if alias have
    the wrong size part of memory that actually belongs to the symbol could be
    poisoned as redzone of alias symbol.
    
    By fixing type of alias symbol we will fix size of it, so
    __asan_register_globals() will not poison valid memory.
    
    Signed-off-by: Andrey Ryabinin <a.ryabi...@samsung.com>
    Cc: Dmitry Vyukov <dvyu...@google.com>
    Cc: Konstantin Serebryany <k...@google.com>
    Cc: Dmitry Chernenkov <dmit...@google.com>
    Signed-off-by: Andrey Konovalov <adech...@gmail.com>
    Cc: Yuri Gribov <tetra2...@gmail.com>
    Cc: Konstantin Khlebnikov <koc...@gmail.com>
    Cc: Sasha Levin <sasha.le...@oracle.com>
    Cc: Christoph Lameter <c...@linux.com>
    Cc: Joonsoo Kim <iamjoonsoo....@lge.com>
    Cc: Dave Hansen <dave.han...@intel.com>
    Cc: Andi Kleen <a...@firstfloor.org>
    Cc: Ingo Molnar <mi...@elte.hu>
    Cc: Thomas Gleixner <t...@linutronix.de>
    Cc: "H. Peter Anvin" <h...@zytor.com>
    Cc: Christoph Lameter <c...@linux.com>
    Cc: Pekka Enberg <penb...@kernel.org>
    Cc: David Rientjes <rient...@google.com>
    Signed-off-by: Andrew Morton <a...@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torva...@linux-foundation.org>
    Signed-off-by: Andrey Ryabinin <aryabi...@odin.com>
    
    Signed-off-by: Andrey Ryabinin <aryabi...@odin.com>
---
 include/linux/module.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/module.h b/include/linux/module.h
index c3b88d6..40bb478 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -84,7 +84,7 @@ void trim_init_extable(struct module *m);
 
 #ifdef MODULE
 #define MODULE_GENERIC_TABLE(gtype,name)                       \
-extern const struct gtype##_id __mod_##gtype##_table           \
+extern const typeof(name) __mod_##gtype##_table                        \
   __attribute__ ((unused, alias(__stringify(name))))
 
 #else  /* !MODULE */
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to