From: Keith Busch <kbusch@kernel.org>
To: Roman Smirnov <r.smirnov@omp.ru>
Cc: "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>,
Karina Yankevich <k.yankevich@omp.ru>,
"lvc-patches@linuxtesting.org" <lvc-patches@linuxtesting.org>,
Sergey Shtylyov <s.shtylyov@omp.ru>
Subject: Re: [bug report] block: integer overflow in __bvec_gap_to_prev()
Date: Tue, 11 Jun 2024 09:15:32 -0600 [thread overview]
Message-ID: <ZmhqFLdCW6aXriqP@kbusch-mbp.dhcp.thefacebook.com> (raw)
In-Reply-To: <9d8ac82ab63a64583f753878dd03e3503c68ffbe.camel@omp.ru>
On Tue, Jun 11, 2024 at 02:23:48PM +0000, Roman Smirnov wrote:
> 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.
Does it matter? The lower bits checked against the mask should be the
same regardless of overflow.
next prev parent reply other threads:[~2024-06-11 15:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-11 14:23 Roman Smirnov
2024-06-11 15:15 ` Keith Busch [this message]
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=ZmhqFLdCW6aXriqP@kbusch-mbp.dhcp.thefacebook.com \
--to=kbusch@kernel.org \
--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=r.smirnov@omp.ru \
--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®