From nobody Sat Oct 08 00:39:08 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MkmWw2lTkz4fGDC; Sat, 8 Oct 2022 00:39:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MkmWw1zZ5z3p5r; Sat, 8 Oct 2022 00:39:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665189548; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kXzqQ1YaGpKOMQAOdJE9LarrL6j1jz0hijtx7nMwwvU=; b=O6NPihm8qrik9nS+smlqjYixuYXKpS2uICedXY1LGme4wtG9b9hpz9AaUoxhIH4QZdEIu5 U7XygJBKGv9/ujPoQrNSO4MP7PRpQ6hQZZCkVYMq79vBwwFvSQRcA9b40GrvGUGU1ilRz+ JXv5ULtzULzxYwFp/Or7GlOJ9xN8mz0MwzsIogOZi5W9NrINzu8lYxMfUeLUyInhDQAYCD ksnqiC5VpY+xrctgorLtGr5isqzuklvEfgwP7FITY+ef+7lASPVjL36tTGtBPRYXi8BIX7 GzxMj2TwEUovYR14McV76FNZBCtKbnzDhy0UZRCSWpfRmTmFPfvGk8ial8wejw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MkmWw14MszmQf; Sat, 8 Oct 2022 00:39:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2980d8rr034333; Sat, 8 Oct 2022 00:39:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2980d8Rn034332; Sat, 8 Oct 2022 00:39:08 GMT (envelope-from git) Date: Sat, 8 Oct 2022 00:39:08 GMT Message-Id: <202210080039.2980d8Rn034332@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 27ec1f0833a1 - stable/13 - msdosfs: disallow truncation to set file size past RLIMIT_FSIZE List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 27ec1f0833a153c4052c74e0863c556057735b26 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665189548; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kXzqQ1YaGpKOMQAOdJE9LarrL6j1jz0hijtx7nMwwvU=; b=F0u0LEckW8wB7YogWk/nvOzDgS/T3mBe1W96JUJ3n0eBIEzEiyTiPeq5XBBGQird9iZr6L htIw2UOQi4Cv8UTqaUj97FL1s7Lj0Dn6LksAsTHSd162ykrJOvxBfj7OZsAeKPvWYP3+Bs Y0DeXnzllP+L94NM/EEscLV+J6TaRyoyE3aKfA2PPXQQJ6j0L1+y1FV49H68A5+Fjal5PA nR9FKF1urObaE7aXe+fIdij1tsY5MhsjDMFXPgZkrgU2lzr+iEzFFUfRI7qbE0kfrmBXTm VmI7gVm6Phf6IxN8DO0pq03ILE53pBxNkipj11NAG8pHHlRQshoKpIOJzYBCVg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1665189548; a=rsa-sha256; cv=none; b=ZTcb5EAQwaSa3stbmVGz74ff8g5ziYXvAJBkpTSycOIdf4KWR5mx/XqABa8KoV0OjI/4Zu L0ijPq+eZ5prVL5R9FCw75dgGT3Zw/bw9tt48KqI2X7q1q3tgNlQLe65c7I/Lkr4w4e/8H IarVYgbLjyteMHL9BSBbGZjSGkia+rJh6BPLvZGhFpWVpQjypMsy/TL09SMpn1XAc42a7g yjzfeJxkyNJj9GtTUT3wXteNOG0Wf+Qqtm8EjMrouesreib0QUtx6KL1wcy7YLGbFz5b8E H1ZyqeIej3xjR8qO75tb5hv3hw3l9txp0Y5j7Bj9odjmg03Y3JxPKWrlyrGOuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=27ec1f0833a153c4052c74e0863c556057735b26 commit 27ec1f0833a153c4052c74e0863c556057735b26 Author: Konstantin Belousov AuthorDate: 2022-09-18 11:51:03 +0000 Commit: Konstantin Belousov 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;