Skip to content

Commit

Permalink
x86, ds: fix bounds check in ds selftest
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Markus Metzger authored and Ingo Molnar committed Apr 7, 2009
1 parent 353afee commit 84f2011
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion arch/x86/kernel/ds_selftest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 84f2011

Please sign in to comment.