From: Dan Carpenter Date: Sat, 15 Oct 2022 08:28:55 +0000 (+0300) Subject: fs/ntfs3: Delete duplicate condition in ntfs_read_mft() X-Git-Tag: v6.2-rc1~22^2~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=658015167a8432b88f5d032e9d85d8fd50e5bf2c;p=thirdparty%2Fkernel%2Fstable.git fs/ntfs3: Delete duplicate condition in ntfs_read_mft() There were two patches which addressed the same bug and added the same condition: commit 6db620863f85 ("fs/ntfs3: Validate data run offset") commit 887bfc546097 ("fs/ntfs3: Fix slab-out-of-bounds read in run_unpack") Delete one condition. Signed-off-by: Dan Carpenter Signed-off-by: Konstantin Komarov --- diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c index 3977e98e3fa35..763dd982a43a7 100644 --- a/fs/ntfs3/inode.c +++ b/fs/ntfs3/inode.c @@ -381,12 +381,6 @@ attr_unpack_run: t64 = le64_to_cpu(attr->nres.svcn); - /* offset to packed runs is out-of-bounds */ - if (roff > asize) { - err = -EINVAL; - goto out; - } - err = run_unpack_ex(run, sbi, ino, t64, le64_to_cpu(attr->nres.evcn), t64, Add2Ptr(attr, roff), asize - roff); if (err < 0)