All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,
	syzbot+1631f09646bc214d2e76@syzkaller.appspotmail.com,
	penguin-kernel@I-love.SAKURA.ne.jp, akpm@linux-foundation.org
Subject: [alternative-merged] fs-ntfs3-fix-negative-shift-size-in-true_sectors_per_clst.patch removed from -mm tree
Date: Fri, 30 Sep 2022 15:23:55 -0700	[thread overview]
Message-ID: <20220930222356.52170C433C1@smtp.kernel.org> (raw)


The quilt patch titled
     Subject: fs/ntfs3: fix negative shift size in true_sectors_per_clst()
has been removed from the -mm tree.  Its filename was
     fs-ntfs3-fix-negative-shift-size-in-true_sectors_per_clst.patch

This patch was dropped because an alternative patch was or shall be merged

------------------------------------------------------
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Subject: fs/ntfs3: fix negative shift size in true_sectors_per_clst()
Date: Wed, 21 Sep 2022 00:59:27 +0900

syzbot is reporting shift-out-of-bounds in true_sectors_per_clst() [1],
for commit a3b774342fa752a5 ("fs/ntfs3: validate BOOT
sectors_per_clusters") did not address that (0 -
boot->sectors_per_clusters) < 0 because "u8" was chosen for type of
boot->sectors_per_clusters because 0x80 needs to be positive in order to
support 64K clusters.  Use "s8" cast in order to make sure that (0 - (s8)
boot->sectors_per_clusters) > 0.

Link: https://syzkaller.appspot.com/bug?extid=1631f09646bc214d2e76 [1]
Link: https://lkml.kernel.org/r/4b37f037-3b10-b4e4-0644-73441c8fa0af@I-love.SAKURA.ne.jp
Fixes: a3b774342fa752a5 ("fs/ntfs3: validate BOOT sectors_per_clusters")
Reported-by: syzbot <syzbot+1631f09646bc214d2e76@syzkaller.appspotmail.com>
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Tested-by: syzbot <syzbot+1631f09646bc214d2e76@syzkaller.appspotmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/ntfs3/super.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/ntfs3/super.c~fs-ntfs3-fix-negative-shift-size-in-true_sectors_per_clst
+++ a/fs/ntfs3/super.c
@@ -672,7 +672,7 @@ static u32 true_sectors_per_clst(const s
 	if (boot->sectors_per_clusters <= 0x80)
 		return boot->sectors_per_clusters;
 	if (boot->sectors_per_clusters >= 0xf4) /* limit shift to 2MB max */
-		return 1U << (0 - boot->sectors_per_clusters);
+		return 1U << (0 - (s8) boot->sectors_per_clusters);
 	return -EINVAL;
 }
 
_

Patches currently in -mm which might be from penguin-kernel@I-love.SAKURA.ne.jp are



                 reply	other threads:[~2022-09-30 22:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220930222356.52170C433C1@smtp.kernel.org \
    --to=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    --cc=syzbot+1631f09646bc214d2e76@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.