mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [bug report] block: integer overflow in __bvec_gap_to_prev()
@ 2024-06-11 14:23 Roman Smirnov
  2024-06-11 15:15 ` Keith Busch
  0 siblings, 1 reply; 3+ messages in thread
From: Roman Smirnov @ 2024-06-11 14:23 UTC (permalink / raw)
  To: axboe, linux-kernel, linux-block
  Cc: Karina Yankevich, lvc-patches, Sergey Shtylyov

Hello.

There is a case of integer overflow in __bvec_gap_to_prev():

	((bprv->bv_offset + bprv->bv_len) & lim->virt_boundary_mask);

bio_vec can cross multiple pages:

https://lore.kernel.org/lkml/20190215111324.30129-1-ming.lei@redhat.com/t/

So, in case bio has one bio_vec bv_len can have a maximum value of UINT_MAX.
The check happens in bio_full(). In the case when bv_len is equal to
UINT_MAX and bv_offset is greater than zero, an overflow may occur.

Found by Linux Verification Center (linuxtesting.org) with Svace.

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

end of thread, other threads:[~2024-06-13 15:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-11 14:23 [bug report] block: integer overflow in __bvec_gap_to_prev() Roman Smirnov
2024-06-11 15:15 ` Keith Busch
2024-06-13 15:27   ` Roman Smirnov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®