]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
fs/ntfs3: Delete duplicate condition in ntfs_read_mft()
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 15 Oct 2022 08:28:55 +0000 (11:28 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Jan 2023 10:26:27 +0000 (11:26 +0100)
[ Upstream commit 658015167a8432b88f5d032e9d85d8fd50e5bf2c ]

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 <dan.carpenter@oracle.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ntfs3/inode.c

index ba2005c12ee336c687187c4fc5271cb8e8c8228c..471ea4d813ad87547fd0ce2b448d1d29c60390d6 100644 (file)
@@ -374,12 +374,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)