Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Oct 2022 00:39:08 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 27ec1f0833a1 - stable/13 - msdosfs: disallow truncation to set file size past RLIMIT_FSIZE
Message-ID:  <202210080039.2980d8Rn034332@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=27ec1f0833a153c4052c74e0863c556057735b26

commit 27ec1f0833a153c4052c74e0863c556057735b26
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2022-09-18 11:51:03 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2022-10-08 00:29:35 +0000

    msdosfs: disallow truncation to set file size past RLIMIT_FSIZE
    
    PR:     164793
    
    (cherry picked from commit 701b73858e3afa15d8ca2ea4aa480173ccc5960e)
---
 sys/fs/msdosfs/msdosfs_vnops.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c
index 86af14784f5b..b9f1b678e534 100644
--- a/sys/fs/msdosfs/msdosfs_vnops.c
+++ b/sys/fs/msdosfs/msdosfs_vnops.c
@@ -460,6 +460,9 @@ msdosfs_setattr(struct vop_setattr_args *ap)
 			 */
 			break;
 		}
+		error = vn_rlimit_trunc(vap->va_size, td);
+		if (error != 0)
+			return (error);
 		error = detrunc(dep, vap->va_size, 0, cred);
 		if (error)
 			return error;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202210080039.2980d8Rn034332>