Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	patches@lists.linux.dev, Hui Peng <benquike@gmail.com>,
	Jan Kara <jack@suse.cz>, Sasha Levin <sashal@kernel.org>
Subject: [PATCH 6.1 0017/1059] udf: validate vat20->lengthHeader and VAT inode size in udf_load_vat()
Date: Fri,  4 Dec 2026 18:52:28 +0900	[thread overview]
Message-ID: <20261204100644.475486325@linuxfoundation.org> (raw)
In-Reply-To: <20261204100643.980430235@linuxfoundation.org>

6.1-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Hui Peng <benquike@gmail.com>

[ Upstream commit 49f771d14578733a350c45e34e1bc6ad14f56952 ]

In udf_load_vat() (fs/udf/super.c), validate that vat20->lengthHeader is
at least sizeof(struct virtualAllocationTable20) and does not exceed the
mapped buffer or VAT inode size so computing the VAT table pointer and
entry count cannot underflow or read out of bounds.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Link: https://patch.msgid.link/20260919222600.3793513-1-benquike@gmail.com
Signed-off-by: Hui Peng <benquike@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/udf/super.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/fs/udf/super.c b/fs/udf/super.c
index 7dfa6f97e146d..16a213542582a 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -1225,6 +1225,12 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index)
 			(sbi->s_vat_inode->i_size - 36) >> 2;
 	} else if (map->s_partition_type == UDF_VIRTUAL_MAP20) {
 		vati = UDF_I(sbi->s_vat_inode);
+		if (sbi->s_vat_inode->i_size <
+		    sizeof(struct virtualAllocationTable20)) {
+			udf_err(sb, "Too short VAT inode size %lld\n",
+				sbi->s_vat_inode->i_size);
+			return -EFSCORRUPTED;
+		}
 		if (vati->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB) {
 			pos = udf_block_map(sbi->s_vat_inode, 0);
 			bh = sb_bread(sb, pos);
@@ -1238,8 +1244,12 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index)
 
 		map->s_type_specific.s_virtual.s_start_offset =
 			le16_to_cpu(vat20->lengthHeader);
-		if (map->s_type_specific.s_virtual.s_start_offset
-		    > sbi->s_vat_inode->i_size) {
+		if (map->s_type_specific.s_virtual.s_start_offset <
+				sizeof(struct virtualAllocationTable20) ||
+		    map->s_type_specific.s_virtual.s_start_offset >
+				sb->s_blocksize ||
+		    map->s_type_specific.s_virtual.s_start_offset >
+				sbi->s_vat_inode->i_size) {
 			udf_err(sb, "Corrupted VAT header length %u (VAT inode size %lld)\n",
 				map->s_type_specific.s_virtual.s_start_offset,
 				sbi->s_vat_inode->i_size);
-- 
2.53.0




  parent reply	other threads:[~2026-12-04 10:19 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04  9:52 [PATCH 6.1 0000/1059] 6.1.194-rc1 review Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0001/1059] RDMA/erdma: Use IRQ-safe XArray helpers for QP and CQ tables Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0002/1059] netfilter: nft_ct: expectation timeouts are passed in milliseconds Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0003/1059] netfilter: nft_ct: move custom expectation support to helper Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0004/1059] mm/khugepaged: preserve dirty bits when collapsing PTE-mapped THPs Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0005/1059] drm/amdgpu: Check cs flags Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0006/1059] bpf: Drop inet_conn_established from lsm sleepable hooks Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0007/1059] mm: page_alloc: remove ALLOC_NON_BLOCK from ALLOC_RESERVES Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0008/1059] irqchip/sifive-plic: Avoid signed shift in interrupt enable mask Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0009/1059] fs: aio: reject partial mremap to avoid Null-pointer-dereference error Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0010/1059] Revert "SUNRPC: svcauth_gss: enforce krb5 token minimum length" Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0011/1059] Revert "SUNRPC: Convert unwrap_priv_data() to use xdr_stream" Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0012/1059] SUNRPC: svcauth_gss: enforce krb5 token minimum length Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0013/1059] mm/ksm: simplify break_ksm() to not rely on VM_FAULT_WRITE Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0014/1059] mm/ksm: fix KSM COW breaking with userfaultfd-wp via FAULT_FLAG_UNSHARE Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0015/1059] mm/ksm: fix userfaultfd protection during merge and unmerge Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0016/1059] udf: validate VAT inode size for old VAT format Greg Kroah-Hartman
2026-12-04  9:52 ` Greg Kroah-Hartman [this message]
2026-12-04  9:52 ` [PATCH 6.1 0018/1059] io_uring: enable toggle of iowait usage when waiting on CQEs Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0019/1059] io_uring: fail soft links on negative IOU_COMPLETE results Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0020/1059] io_uring/rw: fail soft links on IOPOLL short or error IO Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0021/1059] io_uring/rsrc: keep the old file when a file update fails Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0022/1059] Input: destroy force-feedback device on input unregistration Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0023/1059] staging: media: atomisp: use array3_size() for overflow-safe allocation Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0024/1059] fs/9p: switch vfsmount to use v9fs_get_new_inode Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0025/1059] fs/9p: rework qid2ino logic Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0026/1059] 9p: skip intermediate directory entry name copy in p9dirent_read() Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0027/1059] xfrm: zero-initialise km_event in the replay-notify path Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0028/1059] batman-adv: avoid WARN_ON for orig_ifinfo allocation failure Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0029/1059] wifi: ath9k_htc: start ANI when an AP interface begins to beacon Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0030/1059] scsi: aic7xxx: Fix REQUEST SENSE allocation length on big-endian hosts Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0031/1059] scsi: aha1542: Remove unneeded scsi_dma_unmap() call Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0032/1059] wifi: ath10k: Stop unanswered temperature reads Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0033/1059] seg6: fix transport header for inner IPv4 with IP options Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0034/1059] gpio: omap: Propagate runtime PM failures in probe and request Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0035/1059] btrfs: verity: propagate orphan insertion errors when enabling verity Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0036/1059] btrfs: scrub: fix lost wakeup and hang when cancelling a scrub that is finishing Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0037/1059] btrfs: zoned: fix double free of bitmaps on clone failure Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0038/1059] ptp: drain virtual clock sysfs operations before unregistering children Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0039/1059] ptp: unwind partially completed virtual clock creation Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0040/1059] ptp: prevent possible ABBA deadlock in ptp_clock_freerun() Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0041/1059] ptp: vclock: propagate physical clock sampling errors Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0042/1059] ptp: vclock: serialize extended samples with counter updates Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0043/1059] scsi: target: Validate REGISTER AND MOVE TransportID length Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0044/1059] tipc: reject attaching bearer of different media to the same occupied device Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0045/1059] spi: pic32-sqi: fail transfer when the BD ring is exhausted Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0046/1059] bpf: Dont let bpf_skb_adjust_room() raise gso_size to GSO_BY_FRAGS Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0047/1059] bpf: Reject non-IPv6 packets in BPF_LWT_ENCAP_SEG6 Greg Kroah-Hartman
2026-12-04  9:52 ` [PATCH 6.1 0048/1059] bpf: Limit the SRH length in bpf_lwt_seg6_adjust_srh() Greg Kroah-Hartman
2026-12-04  9:53 ` [PATCH 6.1 0049/1059] bpf: Dont look for the SRH again in the End.BPF helpers Greg Kroah-Hartman
2026-12-04  9:53 ` [PATCH 6.1 0050/1059] bpf: Move the MAC header in bpf_lwt_seg6_adjust_srh() Greg Kroah-Hartman
2026-12-04  9:53 ` [PATCH 6.1 0051/1059] bpf: Dont leave a stale MAC header in bpf_lwt_push_ip_encap() Greg Kroah-Hartman
2026-12-04  9:53 ` [PATCH 6.1 0052/1059] ipv4: Unmask upper DSCP bits in input route lookup Greg Kroah-Hartman
2026-12-04  9:53 ` [PATCH 6.1 0053/1059] ipv4: Convert ip_route_input_noref() to dscp_t Greg Kroah-Hartman
2026-12-04  9:53 ` [PATCH 6.1 0054/1059] bpf: Reset skb->cb after an lwt prog pushes an IP header Greg Kroah-Hartman
2026-12-04  9:53 ` [PATCH 6.1 0055/1059] bpf: Require BPF_LWT_REROUTE when an lwt_in prog changes the protocol Greg Kroah-Hartman
2026-12-04  9:53 ` [PATCH 6.1 0056/1059] bpf: Move the transport header with the moved headers Greg Kroah-Hartman
2026-12-04  9:53 ` [PATCH 6.1 0057/1059] bpf: Check the offset in bpf_skb_generic_{push,pop}() Greg Kroah-Hartman
2026-12-04  9:53 ` [PATCH 6.1 0058/1059] spi: Fix ACPI SPI resources using relative path Greg Kroah-Hartman
2026-12-04  9:53 ` [PATCH 6.1 0059/1059] spi: acpi: only look up the IRQ of confirmed SPI devices Greg Kroah-Hartman

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=20261204100644.475486325@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=benquike@gmail.com \
    --cc=jack@suse.cz \
    --cc=patches@lists.linux.dev \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    /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