Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3a490d8
)
LU-5635 llog: prevent out-of-bound index
61/12161/3
author
Frank Zago
<fzago@cray.com>
Wed, 1 Oct 2014 20:30:50 +0000
(15:30 -0500)
committer
Oleg Drokin
<oleg.drokin@intel.com>
Thu, 4 Dec 2014 02:37:13 +0000
(
02:37
+0000)
llog_process_thread() can be called from llog_cat_process_cb with an
index already out of bound, leading to the following crash:
LustreError: 3773:0:(llog.c:310:llog_process_thread())
ASSERTION(index <= last_index + 1 ) failed:
LustreError: 3773:0:(llog.c:310:llog_process_thread()) LBUG
#0 [
ffff8801144bf900
] machine_kexec at
ffffffff81038f3b
#1 [
ffff8801144bf960
] crash_kexec at
ffffffff810c5d82
#2 [
ffff8801144bfa30
] panic at
ffffffff8152798a
#3 [
ffff8801144bfab0
] lbug_with_loc at
ffffffffa02f8eeb
[libcfs]
#4 [
ffff8801144bfad0
] llog_process_thread at
ffffffffa0413fff
[obdclass]
#5 [
ffff8801144bfb80
] llog_process_or_fork at
ffffffffa041585f
[obdclass]
#6 [
ffff8801144bfbd0
] llog_cat_process_cb at
ffffffffa0418612
[obdclass]
#7 [
ffff8801144bfc30
] llog_process_thread at
ffffffffa0413c22
[obdclass]
#8 [
ffff8801144bfce0
] llog_process_or_fork at
ffffffffa041585f
[obdclass]
#9 [
ffff8801144bfd30
] llog_cat_process_or_fork at
ffffffffa0416b9d
[obdclass]
RIP:
00007f6de5e4f730
RSP:
00007fff9aa26d98
RFLAGS:
00000206
RAX:
0000000000000000
RBX:
ffffffff8100b072
RCX:
00007f6de5e4f730
RDX:
0000000000008000
RSI:
00000000019c7000
RDI:
0000000000000003
RBP:
00000000019c7000
R8:
00007f6de6103ee8
R9:
0000000000000001
R10:
00007fff9aa26b20
R11:
0000000000000246
R12:
ffffffffffff8000
R13:
0000000000000003
R14:
0000000000008000
R15:
0000000000000003
ORIG_RAX:
0000000000000000
CS: 0033 SS: 002b
If index is too big, simply return success.
Change-Id: I81bbedbbe2bcef478c370ef40fc069447d39efbd
Signed-off-by: frank zago <fzago@cray.com>
Reviewed-on: http://review.whamcloud.com/12161
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/obdclass/llog.c
patch
|
blob
|
history
diff --git
a/lustre/obdclass/llog.c
b/lustre/obdclass/llog.c
index
a4fbc25
..
2f3b9e4
100644
(file)
--- a/
lustre/obdclass/llog.c
+++ b/
lustre/obdclass/llog.c
@@
-301,6
+301,11
@@
static int llog_process_thread(void *arg)
else
last_index = LLOG_BITMAP_BYTES * 8 - 1;
+ if (index > last_index) {
+ /* Record is not in this buffer. */
+ GOTO(out, rc);
+ }
+
while (rc == 0) {
struct llog_rec_hdr *rec;