aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/ds_selftest.c
diff options
context:
space:
mode:
authorMarkus Metzger <markus.t.metzger@intel.com>2009-04-03 16:43:43 +0200
committerIngo Molnar <mingo@elte.hu>2009-04-07 13:36:24 +0200
commit84f201139245c30777ff858e71b8d7e134b8c3ed (patch)
treee5757927eb6097d4eba43b237f4131cdbe2ab480 /arch/x86/kernel/ds_selftest.c
parentx86, ds: fix compiler warning (diff)
downloadlinux-dev-84f201139245c30777ff858e71b8d7e134b8c3ed.tar.xz
linux-dev-84f201139245c30777ff858e71b8d7e134b8c3ed.zip
x86, ds: fix bounds check in ds selftest
Fix a bad bounds check in the debug store selftest. Signed-off-by: Markus Metzger <markus.t.metzger@intel.com> Cc: roland@redhat.com Cc: eranian@googlemail.com Cc: oleg@redhat.com Cc: juan.villacis@intel.com Cc: ak@linux.jf.intel.com LKML-Reference: <20090403144558.450027000@intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/ds_selftest.c')
-rw-r--r--arch/x86/kernel/ds_selftest.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/x86/kernel/ds_selftest.c b/arch/x86/kernel/ds_selftest.c
index e1ba5101b576..cccc19a38f6d 100644
--- a/arch/x86/kernel/ds_selftest.c
+++ b/arch/x86/kernel/ds_selftest.c
@@ -47,8 +47,13 @@ static int ds_selftest_bts_consistency(const struct bts_trace *trace)
printk(KERN_CONT "bad bts buffer setup...");
error = -1;
}
+ /*
+ * We allow top in [begin; end], since its not clear when the
+ * overflow adjustment happens: after the increment or before the
+ * write.
+ */
if ((trace->ds.top < trace->ds.begin) ||
- (trace->ds.end <= trace->ds.top)) {
+ (trace->ds.end < trace->ds.top)) {
printk(KERN_CONT "bts top out of bounds...");
error = -1;
}