From nobody Mon Jan 20 22:33:10 2025 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 4YcQ8k3VWgz5l3ng; Mon, 20 Jan 2025 22:33:10 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcQ8k2kZTz4NY7; Mon, 20 Jan 2025 22:33:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412390; 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=GGkjC5Pj2ZaRZfpglaNsoUK5gj0PTLOxhX+p9isKfws=; b=kMIE77DoMkli0egqzTb2XBA+eYxzzL2745QfjvYdvKye866ZDc6ruCGWmj/jqykY403m4g XBfMl/iIeGce8Zdu2O7JWn/cfCdd6gofrf2u9Y7W3CsbPrxyPhrUzynOXdmriXMAD/waw/ VLsCJA7KbPV+2dHSAZ5PDSxCxAmRA4NqIiEaNrKhwDFKKxOkXXLOB/j/4VIpYz/OBmwRKq VZmlX4+i0ARpr5KSR3IpsclQGReEeaNnyMpnqHbBXSPxBevgWLiIodbCkb/S8v2ezD3Z6L CgL1aBlEv56IYGWn3uW3UOhvXeZBS9m9RvVNKQiJTLLi2Z+9hXVtPThUUjh0Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412390; 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=GGkjC5Pj2ZaRZfpglaNsoUK5gj0PTLOxhX+p9isKfws=; b=VH4gX/blK56UIhtsAp3fAbgv091PT6qtMtbGCwyT+SVTJCtSbg0fWd/iR9tu45jpwpJgbY /TWKws59NFVg3694KsYQEtE0eThKZjUKzPgUr0ZBuSy8JEwP1bULtr1+HUTzjhIAVTwEGZ +inii79RnfGD5pXQGkPHHrX0GthCAG/y68uRLdFUEmvS21PBBkzt8tyaxoVZF4U3iBjQl4 JUnCcWkrB7xBe+TNYQtIJoF85JJKsQNlRR9MF21Uv9yfRhxDfdOZ//PI/EjVO22mVCZnTw 39FDdRN1d/5yA99dW4WxctG0gbkWgv5yP/1NV/EFt4K8OaWOd2XuUNV5yOvt9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737412390; a=rsa-sha256; cv=none; b=vW3L1jhGBsAn3dLZBanNm1HFp4WdP/4x0ou+qGeyLF/FHPCsxKietV1yw0/griHfdD3VXN 8W+UABmgDGq08PaEs5r4z/6sVvx8u2j7/6GkuHsm0KY/WNY9M7GugExPaUR5pEimL7XToJ RFleMCKDAy2mueY/eSZd6/dxaxvdLIIdiMSsaFXbsaGWpwU8cQtUP1uep4d4Ul+ErEeCWl QvrShdtFubv7BTNZ/kIJembJwcFK2HjGqliHNwVBMIxNJqIzM8+xwjb3t356pCzfJiQQMl RSHkRMamnCmNX7r9sKIgUVqovg2MyXcE5P22V8Srr45hA2HdmBw7wr8EFdqkhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4YcQ8k276pzgRW; Mon, 20 Jan 2025 22:33:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KMXAqx006278; Mon, 20 Jan 2025 22:33:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KMXAbL006275; Mon, 20 Jan 2025 22:33:10 GMT (envelope-from git) Date: Mon, 20 Jan 2025 22:33:10 GMT Message-Id: <202501202233.50KMXAbL006275@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 2b4a45992a04 - stable/13 - fusefs: FUSE_NOTIFY_INVAL_* must busy the mountpoint 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2b4a45992a043459ab0d63410059822a2efb6045 Auto-Submitted: auto-generated The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=2b4a45992a043459ab0d63410059822a2efb6045 commit 2b4a45992a043459ab0d63410059822a2efb6045 Author: Alan Somers AuthorDate: 2024-12-13 14:00:20 +0000 Commit: Alan Somers CommitDate: 2025-01-20 22:31:29 +0000 fusefs: FUSE_NOTIFY_INVAL_* must busy the mountpoint Unusually, the FUSE_NOTIFY_INVAL_INODE and FUSE_NOTIFY_INVAL_ENTRY messages are fully asynchronous. The server sends them to the kernel unsolicited. That means that unlike every other fuse message coming from the server, these two arrive to a potentially unbusied mountpoint. So they must explicitly busy it. Otherwise a page fault could result if the mountpoint were being unmounted. Reported by: JSML4ThWwBID69YC@protonmail.com (cherry picked from commit 989998529387b4d98dfaa6c499ad88b006f78de8) --- sys/fs/fuse/fuse_device.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/fs/fuse/fuse_device.c b/sys/fs/fuse/fuse_device.c index 88ebe702ec0a..7b163bc04bc2 100644 --- a/sys/fs/fuse/fuse_device.c +++ b/sys/fs/fuse/fuse_device.c @@ -440,7 +440,6 @@ fuse_device_write(struct cdev *dev, struct uio *uio, int ioflag) err = devfs_get_cdevpriv((void **)&data); if (err != 0) return (err); - mp = data->mp; if (uio->uio_resid < sizeof(struct fuse_out_header)) { SDT_PROBE2(fusefs, , device, trace, 1, @@ -543,6 +542,13 @@ fuse_device_write(struct cdev *dev, struct uio *uio, int ioflag) } else if (ohead.unique == 0){ /* unique == 0 means asynchronous notification */ SDT_PROBE1(fusefs, , device, fuse_device_write_notify, &ohead); + mp = data->mp; + vfs_ref(mp); + err = vfs_busy(mp, 0); + vfs_rel(mp); + if (err) + return (err); + switch (ohead.error) { case FUSE_NOTIFY_INVAL_ENTRY: err = fuse_internal_invalidate_entry(mp, uio); @@ -567,6 +573,7 @@ fuse_device_write(struct cdev *dev, struct uio *uio, int ioflag) /* Not implemented */ err = ENOSYS; } + vfs_unbusy(mp); } else { /* no callback at all! */ SDT_PROBE1(fusefs, , device, fuse_device_write_missing_ticket,