Bug 85031 - Uninitialized use of ralign variable in __kmem_cache_create from mm/slab.c.
Summary: Uninitialized use of ralign variable in __kmem_cache_create from mm/slab.c.
Status: RESOLVED PATCH_ALREADY_AVAILABLE
Alias: None
Product: Memory Management
Classification: Unclassified
Component: Slab Allocator (show other bugs)
Hardware: Intel Linux
: P1 normal
Assignee: Andrew Morton
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-23 04:51 UTC by Andrei Elovikov
Modified: 2014-10-23 22:05 UTC (History)
1 user (show)

See Also:
Kernel Version: Found using 3.15, still presents in 3.17
Subsystem:
Regression: No
Bisected commit-id:


Attachments

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

Note You need to log in before you can comment on or make changes to this bug.