linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] block: fix potential infinite loop in the negative branch in __submit_bio_noacct_mq()
@ 2021-03-23 11:48 Sergei Shtepa
  2021-03-23 11:48 ` [PATCH 1/1] " Sergei Shtepa
  0 siblings, 1 reply; 4+ messages in thread
From: Sergei Shtepa @ 2021-03-23 11:48 UTC (permalink / raw)
  To: Jens Axboe, linux-block, linux-kernel; +Cc: sergei.shtepa, pavel.tide

Hi all.

It seems to me that the __submit_bio_noacct_mq() function incorrectly
processes the return code of the blk_crypto_bio_prep() function.

If the blk_crypto_bio_prep() function returns false, it means that
the processing of the bio request was completed with an error and
further processing of the request is unnecessary.

But in the code, in case of an error when executing the
blk_crypto_bio_prep() function, an attempt is made to repeat the
execution of this function. This can lead to an infinite loop.
In addition, since the function __blk_crypto_bio_prep calls bio_endio(),
it is likely to access the freed data or access the null pointer.

At the same time, the implementation of the negative branch of the
blk_crypto_bio_prep() function implemented correctly in the
__submit_bio_noacct() and __submit_bio() functions.

Sergei Shtepa (1):
  block: fix potential infinite loop in the negative branch in
    __submit_bio_noacct_mq()

 block/blk-core.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-24 15:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-23 11:48 [PATCH 0/1] block: fix potential infinite loop in the negative branch in __submit_bio_noacct_mq() Sergei Shtepa
2021-03-23 11:48 ` [PATCH 1/1] " Sergei Shtepa
2021-03-24 11:18   ` Christoph Hellwig
2021-03-24 15:14     ` Sergei Shtepa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).