* + fs-ntfs3-fix-negative-shift-size-in-true_sectors_per_clst.patch added to mm-nonmm-unstable branch
@ 2022-09-21 20:01 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2022-09-21 20:01 UTC (permalink / raw)
To: mm-commits, syzbot+1631f09646bc214d2e76, penguin-kernel, akpm
The patch titled
Subject: fs/ntfs3: fix negative shift size in true_sectors_per_clst()
has been added to the -mm mm-nonmm-unstable branch. Its filename is
fs-ntfs3-fix-negative-shift-size-in-true_sectors_per_clst.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/fs-ntfs3-fix-negative-shift-size-in-true_sectors_per_clst.patch
This patch will later appear in the mm-nonmm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
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>
---
--- 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
fs-ntfs3-fix-negative-shift-size-in-true_sectors_per_clst.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-09-21 20:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-21 20:01 + fs-ntfs3-fix-negative-shift-size-in-true_sectors_per_clst.patch added to mm-nonmm-unstable branch Andrew Morton
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.