Linux block layer
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Sergey Shtylyov <s.shtylyov@auroraos.dev>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	Karina Yankevich <k.yankevich@auroraos.dev>
Subject: Re: [PATCH] block: bio: check offset/length sanity in {__,}bio_add_page()
Date: Thu, 25 Jun 2026 23:12:20 -0700	[thread overview]
Message-ID: <aj4YRCjECYjLg6yk@infradead.org> (raw)
In-Reply-To: <20260624203327.25553-1-s.shtylyov@auroraos.dev>

On Wed, Jun 24, 2026 at 11:33:26PM +0300, Sergey Shtylyov wrote:
> Sum of the *struct* bio_vec's fields bv_offset and bv_len is calculated in
> some functions in block/{blk-merge.c,blk.h> (and that sum is often compared
> to PAGE_SIZE) -- that sum may overflow (and so the comparison yield a wrong
> result) if some bad arguments were previusly passed to {__,}bio_add_page().
> Add a check that the sum of the offset and length parameters won't overflow
> to {__,}bio_add_page()...

I'm not really sure there's much of a point in this, because the
error handling isn't really going to help to recover either.  I think
we have to trust our programmers to at least get the very basics
right.


      reply	other threads:[~2026-06-26  6:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-24 20:33 [PATCH] block: bio: check offset/length sanity in {__,}bio_add_page() Sergey Shtylyov
2026-06-26  6:12 ` Christoph Hellwig [this message]

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=aj4YRCjECYjLg6yk@infradead.org \
    --to=hch@infradead.org \
    --cc=axboe@kernel.dk \
    --cc=k.yankevich@auroraos.dev \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=s.shtylyov@auroraos.dev \
    /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