diff options
author | Huang Ying <ying.huang@intel.com> | 2009-02-12 13:39:34 +0100 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2009-02-17 15:33:05 -0800 |
commit | ef41df4344ff952c79746d44a6126bd2cf7ed2bc (patch) | |
tree | a0756296c6f25e59a680bdc505233d611fd1f56e /arch/x86/kernel/sys_x86_64.c | |
parent | d6b75584a3eaab8cb2ab3e8cf90c5e57c1928a85 (diff) |
x86, mce: fix a race condition in mce_read()
Impact: bugfix
Considering the situation as follow:
before: mcelog.next == 1, mcelog.entry[0].finished = 1
+--------------------------------------------------------------------------
R W1 W2 W3
read mcelog.next (1)
mcelog.next++ (2)
(working on entry 1,
finished == 0)
mcelog.next = 0
mcelog.next++ (1)
(working on entry 0)
mcelog.next++ (2)
(working on entry 1)
<----------------- race ---------------->
(done on entry 1,
finished = 1)
(done on entry 1,
finished = 1)
To fix the race condition, a cmpxchg loop is added to mce_read() to
ensure no new MCE record can be added between mcelog.next reading and
mcelog.next = 0.
Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/kernel/sys_x86_64.c')
0 files changed, 0 insertions, 0 deletions