mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 11:03:07 -04:00
UDF symlink pathComponent header OOB read
udf_symlink_filler() can enter udf_pc_to_char() with a partial pathComponent header.
Validate that enough input remains for a complete pathComponent header
before accessing it. Reject malformed symlink data that would otherwise
make udf_pc_to_char() perform an out-of-bounds read.
Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Signed-off-by: David Lee <david.lee@trailofbits.com>
Assisted-by: Codex:gpt-5.5
Link: https://patch.msgid.link/20260717104722.41446-1-david.lee@trailofbits.com
Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:
@@ -36,6 +36,8 @@ static int udf_pc_to_char(struct super_block *sb, unsigned char *from,
|
||||
/* Reserve one byte for terminating \0 */
|
||||
tolen--;
|
||||
while (elen < fromlen) {
|
||||
if (fromlen - elen < sizeof(struct pathComponent))
|
||||
return -EIO;
|
||||
pc = (struct pathComponent *)(from + elen);
|
||||
elen += sizeof(struct pathComponent);
|
||||
switch (pc->componentType) {
|
||||
|
||||
Reference in New Issue
Block a user