All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: Joanne Koong <joannelkoong@gmail.com>
Cc: patches@lists.linux.dev, stable@vger.kernel.org,
	syzbot@syzkaller.appspotmail.com,
	Brian Foster <bfoster@redhat.com>, Christoph Hellwig <hch@lst.de>,
	Christian Brauner <brauner@kernel.org>,
	linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH AUTOSEL 6.18-6.6] iomap: adjust read range correctly for non-block-aligned positions
Date: Thu, 18 Dec 2025 12:52:23 -0500	[thread overview]
Message-ID: <aUQ_V2O7yDhT1ynN@laps> (raw)
In-Reply-To: <CAJnrk1aSf+bTiRE40BSM72y8p_0CZjeJ4AHF78QbxxPicmPMXw@mail.gmail.com>

On Wed, Dec 03, 2025 at 03:07:12PM -0800, Joanne Koong wrote:
>On Wed, Dec 3, 2025 at 12:28 PM Sasha Levin <sashal@kernel.org> wrote:
>>
>> From: Joanne Koong <joannelkoong@gmail.com>
>>
>> [ Upstream commit 7aa6bc3e8766990824f66ca76c19596ce10daf3e ]
>>
>> iomap_adjust_read_range() assumes that the position and length passed in
>> are block-aligned. This is not always the case however, as shown in the
>> syzbot generated case for erofs. This causes too many bytes to be
>> skipped for uptodate blocks, which results in returning the incorrect
>> position and length to read in. If all the blocks are uptodate, this
>> underflows length and returns a position beyond the folio.
>>
>> Fix the calculation to also take into account the block offset when
>> calculating how many bytes can be skipped for uptodate blocks.
>>
>> Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
>> Tested-by: syzbot@syzkaller.appspotmail.com
>> Reviewed-by: Brian Foster <bfoster@redhat.com>
>> Reviewed-by: Christoph Hellwig <hch@lst.de>
>> Signed-off-by: Christian Brauner <brauner@kernel.org>
>> Signed-off-by: Sasha Levin <sashal@kernel.org>
>> ---
>>
>> LLM Generated explanations, may be completely bogus:
>>
>> Now I have all the information needed for a comprehensive analysis. Let
>> me compile my findings.
>>
>> ---
>
>I don't think any filesystems had repercussions from this. afaik only
>inlined mappings are non-block-aligned and the underflow of length and
>the overflow of position when added together offset each other when
>determining how much to advance the iter for the next iteration. But I
>have no objection to this being backported to stable. I think if this
>gets backported, then we should also backport this one as well
>(https://lore.kernel.org/linux-fsdevel/20251111193658.3495942-3-joannelkoong@gmail.com/).

Sure, I'll grab that one too. Thanks!

-- 
Thanks,
Sasha

      reply	other threads:[~2025-12-18 17:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-03 20:28 [PATCH AUTOSEL 6.18-6.6] iomap: adjust read range correctly for non-block-aligned positions Sasha Levin
2025-12-03 23:07 ` Joanne Koong
2025-12-18 17:52   ` Sasha Levin [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=aUQ_V2O7yDhT1ynN@laps \
    --to=sashal@kernel.org \
    --cc=bfoster@redhat.com \
    --cc=brauner@kernel.org \
    --cc=hch@lst.de \
    --cc=joannelkoong@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    --cc=syzbot@syzkaller.appspotmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.