From nobody Thu Nov 23 04:02:35 2023 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 4SbPb02Gsdz51CT8; Thu, 23 Nov 2023 04:02:36 +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 4SbPb01Gvsz4Qhw; Thu, 23 Nov 2023 04:02:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700712156; 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=EkPDazf3GvC+p1VoC4eoh5NlVy035eON2iiVFCIqHVg=; b=UF5DkXJnZX/zXRTpACZk+PvBOzm1S9uOCrpmj9r8AcA7PAi6kmn47ntNCUThdGN+eKR7ph qXDlnIpQ8yFtUCIdEZvbTHksNZKd2BbKAsxTTG3aPqmC12NPyXGcVcShxSBflVW0LAd7LV k3aWKjLxtjKd9Xi4+BBkNJnoDglWzSj9w5nMQ0RTgKbJnTzU5sX1+ZoCzBvr8NsLQPUMQ3 N+KjoYRHr1nJ1XyZ13K6WqRx7k9yEh7SRfe0QUEis6TCXZR3y/SenPYmpQINSc9SVhEQjL Figuzd1TY7t0jacu5s8ckZephfPJRey+/wnHLLYgkSVcpWij+pJ1fXq6b3GYHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700712156; 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=EkPDazf3GvC+p1VoC4eoh5NlVy035eON2iiVFCIqHVg=; b=bvDKnNTtDDrzHpwEx3bsegRYaASCSiLW1aL9JUXoK3a3Xcb+u6C6q1XQ5OgJeyDqHiVywW ZziGNdxWDil5VdIIkt4eKFdwr51HfhKyXtRfuJTAA94Mkkc/dRYp/7ClnlDZFwcqJSf0kO lgOfu14csqdasVJVHDBB3HC4waAFJiLtIUPKApa40NsZPJR7xEMcUoP431Shju3Pbgd8Ki kF6qL0vIkuIq0KGUdqhZ4dA281WbcAWuBpKwxutLS4aHkygdk+otQWNDEBpzlpKebXj4xq oniVOcqlurf0KeDpHJ5s0E3adYt7ohP7wMSZf/3Ym2AUIFE/xrI0+O+PrZrJjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700712156; a=rsa-sha256; cv=none; b=u+wVyvYqRPxQd6gQ3gFtSyY49dwajZbHuG5oDR00KgjooC3pvenbPURI/8Cw85D+wuefuR /qmCy/+SdblX5xfqisVMLCQu4vainUK2qMNJl2ZDFCifbukBvjBui2OQK9l/voQKj6Xd8v op8kl2qEUYFs+GctenneKI7RODFOjYhK2OLlHxhrRp6I66f8a0hHgEyK9cWp8KaDswFAkl CW8b8Y3Hm6O7imRvTcACG/yHLN1EiklfRDx4OZXSr4+wbTcHk7Omn0BziviOsniNr5hgbI jE68EKbpC1oZBIULThnOqy4MftWtnQGLuYvc9CerOVukr+t7TKjsLM+jyLbWfA== 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 4SbPb00KX4zn2D; Thu, 23 Nov 2023 04:02:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3AN42ZiX005550; Thu, 23 Nov 2023 04:02:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AN42ZTT005547; Thu, 23 Nov 2023 04:02:35 GMT (envelope-from git) Date: Thu, 23 Nov 2023 04:02:35 GMT Message-Id: <202311230402.3AN42ZTT005547@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: 0ea5e0c7ee26 - stable/13 - fuse_vnop_copy_file_range(): add safety 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: 0ea5e0c7ee262f0d1178b6ca4871ab353e3aa0e3 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0ea5e0c7ee262f0d1178b6ca4871ab353e3aa0e3 commit 0ea5e0c7ee262f0d1178b6ca4871ab353e3aa0e3 Author: Konstantin Belousov AuthorDate: 2023-11-14 22:49:35 +0000 Commit: Konstantin Belousov CommitDate: 2023-11-23 04:02:00 +0000 fuse_vnop_copy_file_range(): add safety (cherry picked from commit 4c6cded2166111079c6b5e8b2353171dcc7ed0c4) --- sys/fs/fuse/fuse_vnops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c index 0b683a7c63bd..6871461d26f1 100644 --- a/sys/fs/fuse/fuse_vnops.c +++ b/sys/fs/fuse/fuse_vnops.c @@ -862,7 +862,7 @@ fuse_vnop_copy_file_range(struct vop_copy_file_range_args *ap) pid_t pid; int err; - if (mp != vnode_mount(outvp)) + if (mp == NULL || mp != vnode_mount(outvp)) goto fallback; if (incred->cr_uid != outcred->cr_uid) @@ -871,6 +871,7 @@ fuse_vnop_copy_file_range(struct vop_copy_file_range_args *ap) if (incred->cr_groups[0] != outcred->cr_groups[0]) goto fallback; + /* Caller busied mp, mnt_data can be safely accessed. */ if (fsess_not_impl(mp, FUSE_COPY_FILE_RANGE)) goto fallback;