Bug 85031

Summary: Uninitialized use of ralign variable in __kmem_cache_create from mm/slab.c.
Product: Memory Management Reporter: Andrei Elovikov (a.elovikov)
Component: Slab AllocatorAssignee: Andrew Morton (akpm)
Status: RESOLVED PATCH_ALREADY_AVAILABLE    
Severity: normal CC: alan
Priority: P1    
Hardware: Intel   
OS: Linux   
Kernel Version: Found using 3.15, still presents in 3.17 Subsystem:
Regression: No Bisected commit-id:

Description Andrei Elovikov 2014-09-23 04:51:31 UTC
Found when compiled the kernel with Intel Compiler. 

If the value is initialized with zero the issue goes away:

diff --git a/mm/slab.c b/mm/slab.c
index 19d9218..08e0f70 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2160,7 +2160,7 @@ static int __init_refok setup_cpu_cache(struct kmem_cache *cachep, gfp_t gfp)
 int
 __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags)
 {
-   size_t left_over, freelist_size, ralign;
+   size_t left_over, freelist_size, ralign = 0;
    gfp_t gfp;
    int err;
    size_t size = cachep->size;
Comment 1 Alan 2014-10-23 22:05:19 UTC
Current kernel has ralign = BYTES_PER_WORD already