All of lore.kernel.org
 help / color / mirror / Atom feed
* [BUG] bfq-iosched: possible null-pointer dereference in __bfq_insert_request()
@ 2021-07-31  3:43 Li Tuo
  0 siblings, 0 replies; only message in thread
From: Li Tuo @ 2021-07-31  3:43 UTC (permalink / raw)
  To: paolo.valente, axboe; +Cc: linux-block, linux-kernel, baijiaju1990

Hello,

Our static analysis tool finds a possible null-pointer dereference in 
bfq-iosched.c in Linux 5.14.0-rc3:

The variable bfqq is checked in:
5920:    waiting = bfqq && bfq_bfqq_wait_request(bfqq);

This indicates that bfqq can be NULL.
But the address of its field fifo, which is an illegal pointer, is 
dereferenced in the function list_add_tail():
5925:    list_add_tail(&rq->queuelist, &bfqq->fifo);

The pointer bfqq is also dereferenced in the function bfq_rq_enqueued() 
which is called at line 5927.
Some dereference operations are:
5826:    bfqq->meta_pending++;
5828:    bfqq->last_request_pos = blk_rq_pos(rq) + blk_rq_sectors(rq);

I am not quite sure whether this possible null-pointer dereference is 
real and how to fix it if it is real.
Any feedback would be appreciated, thanks!

Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>

Best wishes,
Tuo Li

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-31  3:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-31  3:43 [BUG] bfq-iosched: possible null-pointer dereference in __bfq_insert_request() Li Tuo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.