From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Gianfranco Trad <gianf.trad@gmail.com>,
syzbot+8901c4560b7ab5c2f9df@syzkaller.appspotmail.com,
Jan Kara <jack@suse.com>, Jan Kara <jack@suse.cz>,
Sasha Levin <sashal@kernel.org>
Subject: [PATCH AUTOSEL 6.11 11/16] udf: fix uninit-value use in udf_get_fileshortad
Date: Sat, 12 Oct 2024 07:26:07 -0400 [thread overview]
Message-ID: <20241012112619.1762860-11-sashal@kernel.org> (raw)
In-Reply-To: <20241012112619.1762860-1-sashal@kernel.org>
From: Gianfranco Trad <gianf.trad@gmail.com>
[ Upstream commit 264db9d666ad9a35075cc9ed9ec09d021580fbb1 ]
Check for overflow when computing alen in udf_current_aext to mitigate
later uninit-value use in udf_get_fileshortad KMSAN bug[1].
After applying the patch reproducer did not trigger any issue[2].
[1] https://syzkaller.appspot.com/bug?extid=8901c4560b7ab5c2f9df
[2] https://syzkaller.appspot.com/x/log.txt?x=10242227980000
Reported-by: syzbot+8901c4560b7ab5c2f9df@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=8901c4560b7ab5c2f9df
Tested-by: syzbot+8901c4560b7ab5c2f9df@syzkaller.appspotmail.com
Suggested-by: Jan Kara <jack@suse.com>
Signed-off-by: Gianfranco Trad <gianf.trad@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20240925074613.8475-3-gianf.trad@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/udf/inode.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index 80dae442ecd72..53511c726d575 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -2257,12 +2257,15 @@ int udf_current_aext(struct inode *inode, struct extent_position *epos,
alen = udf_file_entry_alloc_offset(inode) +
iinfo->i_lenAlloc;
} else {
+ struct allocExtDesc *header =
+ (struct allocExtDesc *)epos->bh->b_data;
+
if (!epos->offset)
epos->offset = sizeof(struct allocExtDesc);
ptr = epos->bh->b_data + epos->offset;
- alen = sizeof(struct allocExtDesc) +
- le32_to_cpu(((struct allocExtDesc *)epos->bh->b_data)->
- lengthAllocDescs);
+ if (check_add_overflow(sizeof(struct allocExtDesc),
+ le32_to_cpu(header->lengthAllocDescs), &alen))
+ return -1;
}
switch (iinfo->i_alloc_type) {
--
2.43.0
next prev parent reply other threads:[~2024-10-12 11:26 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-12 11:25 [PATCH AUTOSEL 6.11 01/16] drm/vboxvideo: Replace fake VLA at end of vbva_mouse_pointer_shape with real VLA Sasha Levin
2024-10-12 11:25 ` [PATCH AUTOSEL 6.11 02/16] ASoC: amd: yc: Add quirk for HP Dragonfly pro one Sasha Levin
2024-10-12 11:25 ` [PATCH AUTOSEL 6.11 03/16] ASoC: codecs: lpass-rx-macro: add missing CDC_RX_BCL_VBAT_RF_PROC2 to default regs values Sasha Levin
2024-10-12 11:26 ` [PATCH AUTOSEL 6.11 04/16] ASoC: fsl_sai: Enable 'FIFO continue on error' FCONT bit Sasha Levin
2024-10-12 11:26 ` [PATCH AUTOSEL 6.11 05/16] arm64: Force position-independent veneers Sasha Levin
2024-10-12 11:26 ` [PATCH AUTOSEL 6.11 06/16] btrfs: also add stripe entries for NOCOW writes Sasha Levin
2024-10-12 11:26 ` [PATCH AUTOSEL 6.11 07/16] udf: refactor udf_current_aext() to handle error Sasha Levin
2024-10-12 11:26 ` [PATCH AUTOSEL 6.11 08/16] ALSA: hda: fix trigger_tstamp_latched Sasha Levin
2024-10-12 11:26 ` [PATCH AUTOSEL 6.11 09/16] udf: refactor udf_next_aext() to handle error Sasha Levin
2024-10-12 11:26 ` [PATCH AUTOSEL 6.11 10/16] udf: refactor inode_bmap() " Sasha Levin
2024-10-12 11:26 ` Sasha Levin [this message]
2024-10-12 11:26 ` [PATCH AUTOSEL 6.11 12/16] ASoC: qcom: sm8250: add qrb4210-rb2-sndcard compatible string Sasha Levin
2024-10-12 11:26 ` [PATCH AUTOSEL 6.11 13/16] fsnotify: Avoid data race between fsnotify_recalc_mask() and fsnotify_object_watched() Sasha Levin
2024-10-12 11:26 ` [PATCH AUTOSEL 6.11 14/16] drm/xe/mcr: Use Xe2_LPM steering tables for Xe2_HPM Sasha Levin
2024-10-12 11:26 ` [PATCH AUTOSEL 6.11 15/16] cifs: Validate content of NFS reparse point buffer Sasha Levin
2024-10-12 11:26 ` [PATCH AUTOSEL 6.11 16/16] platform/x86: dell-sysman: add support for alienware products Sasha Levin
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=20241012112619.1762860-11-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=gianf.trad@gmail.com \
--cc=jack@suse.com \
--cc=jack@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=syzbot+8901c4560b7ab5c2f9df@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 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®