From: Roman Smirnov <r.smirnov@omp.ru>
To: "axboe@kernel.dk" <axboe@kernel.dk>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Cc: Karina Yankevich <k.yankevich@omp.ru>,
"lvc-patches@linuxtesting.org" <lvc-patches@linuxtesting.org>,
Sergey Shtylyov <s.shtylyov@omp.ru>
Subject: [bug report] block: integer overflow in __bvec_gap_to_prev()
Date: Tue, 11 Jun 2024 14:23:48 +0000 [thread overview]
Message-ID: <9d8ac82ab63a64583f753878dd03e3503c68ffbe.camel@omp.ru> (raw)
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.
next reply other threads:[~2024-06-11 14:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-11 14:23 Roman Smirnov [this message]
2024-06-11 15:15 ` Keith Busch
2024-06-13 15:27 ` Roman Smirnov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9d8ac82ab63a64583f753878dd03e3503c68ffbe.camel@omp.ru \
--to=r.smirnov@omp.ru \
--cc=axboe@kernel.dk \
--cc=k.yankevich@omp.ru \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lvc-patches@linuxtesting.org \
--cc=s.shtylyov@omp.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®