diff --git a/0003-Use-destroy_req-instead-of-free-to-destroy-fuse_req.patch b/0003-Use-destroy_req-instead-of-free-to-destroy-fuse_req.patch new file mode 100644 index 0000000000000000000000000000000000000000..e6354989b2f497a9ceae84b2664d34cdc7635790 --- /dev/null +++ b/0003-Use-destroy_req-instead-of-free-to-destroy-fuse_req.patch @@ -0,0 +1,30 @@ +From 9e1601add411511c94527f6f7f6f071729b0c52c Mon Sep 17 00:00:00 2001 +From: Frank Dinoff +Date: Tue, 26 Jul 2022 15:49:01 -0400 +Subject: [PATCH] Use destroy_req instead of free to destroy fuse_req + +If we get the interrupt before the fuse op, the fuse_req is deleted without +decrementing the refcount on the cloned file descriptor. This leads to a +leak of the cloned /dev/fuse file descriptor. +--- + lib/fuse_lowlevel.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c +index e5de2a5..e82cd9e 100644 +--- a/lib/fuse_lowlevel.c ++++ b/lib/fuse_lowlevel.c +@@ -1762,7 +1762,9 @@ static struct fuse_req *check_interrupt(struct fuse_session *se, + if (curr->u.i.unique == req->unique) { + req->interrupted = 1; + list_del_req(curr); +- free(curr); ++ fuse_chan_put(curr->ch); ++ curr->ch = NULL; ++ destroy_req(curr); + return NULL; + } + } +-- +2.33.0 + diff --git a/fuse3.spec b/fuse3.spec index 7c4a0de8d2e60ec031ff2ca4d147e068ee823348..281bb5daefa6ffaada52e5ae6fddce45db03756c 100644 --- a/fuse3.spec +++ b/fuse3.spec @@ -2,7 +2,7 @@ Name: fuse3 Version: %{fuse3ver} -Release: 1 +Release: 2 Summary: User space File System of fuse3 License: GPL+ and LGPLv2+ URL: http://fuse.sf.net @@ -11,6 +11,7 @@ Source1: fuse.conf Patch1: 0001-fix-chown-and-mknod-failed.patch Patch2: 0002-revert-fuse_daemonize-chdir-to-even-if-not-run.patch +Patch3: 0003-Use-destroy_req-instead-of-free-to-destroy-fuse_req.patch BuildRequires: libselinux-devel, pkgconfig, systemd-udev, meson, fdupes BuildRequires: autoconf, automake, libtool, gettext-devel, ninja-build @@ -101,6 +102,9 @@ install -p -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir} %{_mandir}/man8/* %changelog +* Sun Jun 25 2023 louhongxiang -3.13.0-2 +- fix fd leak by using destory_req instead of free. + * Thu Feb 9 2023 zhanchengbin -3.13.0-1 - upgrade to 3.13.0