1
0
Fork 0

block: null_blk: fix use after free

entry(cmd->ll_list) may belong to new request once end_cmd()
returns, so fix the bug with the patch.

Without the change, it is easy to observe oops when
doing null_blk(timer) test.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
hifive-unleashed-5.1
Ming Lei 2014-05-01 15:12:36 +08:00 committed by Jens Axboe
parent ec4a340789
commit fc27691f35
1 changed files with 1 additions and 1 deletions

View File

@ -203,8 +203,8 @@ static enum hrtimer_restart null_cmd_timer_expired(struct hrtimer *timer)
entry = llist_reverse_order(entry);
do {
cmd = container_of(entry, struct nullb_cmd, ll_list);
end_cmd(cmd);
entry = entry->next;
end_cmd(cmd);
} while (entry);
}