[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1235445101-7882-2-git-send-email-tj@kernel.org>
Date: Tue, 24 Feb 2009 12:11:32 +0900
From: Tejun Heo <tj@...nel.org>
To: mingo@...e.hu, rusty@...tcorp.com.au, tglx@...utronix.de,
x86@...nel.org, linux-kernel@...r.kernel.org, hpa@...or.com,
jeremy@...p.org, cpw@....com, nickpiggin@...oo.com.au,
ink@...assic.park.msu.ru
Cc: Tejun Heo <tj@...nel.org>
Subject: [PATCH 01/10] percpu: fix pcpu_chunk_struct_size
Impact: fix short allocation leading to memory corruption
While dropping rvalue wrapping macros around global parameters,
pcpu_chunk_struct_size was set incorrectly resulting in shorter page
pointer array. Fix it.
Signed-off-by: Tejun Heo <tj@...nel.org>
---
mm/percpu.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mm/percpu.c b/mm/percpu.c
index 997724c..ed92caa 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -850,7 +850,7 @@ size_t __init pcpu_setup_static(pcpu_populate_pte_fn_t populate_pte_fn,
pcpu_chunk_size = num_possible_cpus() * pcpu_unit_size;
pcpu_nr_slots = pcpu_size_to_slot(pcpu_unit_size) + 1;
pcpu_chunk_struct_size = sizeof(struct pcpu_chunk)
- + (1 << pcpu_unit_pages_shift) * sizeof(struct page *);
+ + num_possible_cpus() * pcpu_unit_pages * sizeof(struct page *);
/* allocate chunk slots */
pcpu_slot = alloc_bootmem(pcpu_nr_slots * sizeof(pcpu_slot[0]));
--
1.6.0.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists