From 8a35daed23c7ced64b35816c7d01079b4ad7f883 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 01 2019 19:09:12 +0000 Subject: import fuse-2.9.2-11.el7 --- diff --git a/.fuse.metadata b/.fuse.metadata new file mode 100644 index 0000000..8f30afc --- /dev/null +++ b/.fuse.metadata @@ -0,0 +1 @@ +fcfc005b1edcd5e8b325729a1b325ff0e8b2a5ab SOURCES/fuse-2.9.2.tar.gz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea325b4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/fuse-2.9.2.tar.gz diff --git a/SOURCES/buffer_size.patch b/SOURCES/buffer_size.patch new file mode 100644 index 0000000..b911282 --- /dev/null +++ b/SOURCES/buffer_size.patch @@ -0,0 +1,54 @@ +From a83b3ec1d7ce2d656a4c476d65486371d1a659b2 Mon Sep 17 00:00:00 2001 +From: Carlos Maiolino +Date: Tue, 2 May 2017 12:46:10 +0200 +Subject: [PATCH] From 4f8f034a8969a48f210bf00be78a67cfb6964c72 Mon Sep 17 + 00:00:00 2001 From: Carlos Maiolino + Date: Thu, 20 Apr 2017 + 14:53:01 +0200 Subject: [PATCH] make buffer size match kernel max transfer + size + +Currently libfuse has a hardcoded buffer limit to 128kib, while fuse +kernel module has a limit up to 32 pages. + +This patch changes buffer limit to match the current page size, instead +of assuming 4096 bytes pages, enabling architectures with bigger pages +to use larger buffers, improving performance. + +Also, add a new macro (HEADER_SIZE) to specify the space needed to +accommodate the header, making it easier to understand why those extra +4096 bytes are needed + +Signed-off-by: Carlos Maiolino +Signed-off-by: Carlos Maiolino +--- + lib/fuse_kern_chan.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/lib/fuse_kern_chan.c b/lib/fuse_kern_chan.c +index 5f77bbf..4cc9b73 100644 +--- a/lib/fuse_kern_chan.c ++++ b/lib/fuse_kern_chan.c +@@ -80,7 +80,10 @@ static void fuse_kern_chan_destroy(struct fuse_chan *ch) + close(fuse_chan_fd(ch)); + } + +-#define MIN_BUFSIZE 0x21000 ++#define KERNEL_BUF_PAGES 32 ++ ++/* room needed in buffer to accommodate header */ ++#define HEADER_SIZE 0x1000 + + struct fuse_chan *fuse_kern_chan_new(int fd) + { +@@ -89,7 +92,6 @@ struct fuse_chan *fuse_kern_chan_new(int fd) + .send = fuse_kern_chan_send, + .destroy = fuse_kern_chan_destroy, + }; +- size_t bufsize = getpagesize() + 0x1000; +- bufsize = bufsize < MIN_BUFSIZE ? MIN_BUFSIZE : bufsize; ++ size_t bufsize = KERNEL_BUF_PAGES * getpagesize() + HEADER_SIZE; + return fuse_chan_new(&op, fd, bufsize, NULL); + } +-- +2.9.3 + diff --git a/SOURCES/fuse-0001-More-parentheses.patch b/SOURCES/fuse-0001-More-parentheses.patch new file mode 100644 index 0000000..4d34710 --- /dev/null +++ b/SOURCES/fuse-0001-More-parentheses.patch @@ -0,0 +1,52 @@ +From 22ba14e45e84e0bd12a9ab1c9d0460b9ae27c10c Mon Sep 17 00:00:00 2001 +From: Peter Lemenkov +Date: Mon, 9 Aug 2010 12:10:40 +0400 +Subject: [PATCH 1/1] More parentheses + +Signed-off-by: Peter Lemenkov +--- + lib/fuse.c | 8 +++----- + lib/fuse_lowlevel.c | 2 +- + 2 files changed, 4 insertions(+), 6 deletions(-) + +diff --git a/lib/fuse.c b/lib/fuse.c +index d511964..328ebba 100644 +--- a/lib/fuse.c ++++ b/lib/fuse.c +@@ -991,17 +991,15 @@ static int fuse_compat_open(struct fuse_fs *fs, const char *path, + { + int err; + if (!fs->compat || fs->compat >= 25) +- err = fs->op.open(path, fi); ++ err = (fs->op.open)(path, fi); + else if (fs->compat == 22) { + struct fuse_file_info_compat tmp; + memcpy(&tmp, fi, sizeof(tmp)); +- err = ((struct fuse_operations_compat22 *) &fs->op)->open(path, +- &tmp); ++ err = (((struct fuse_operations_compat22 *) &fs->op)->open)(path, &tmp); + memcpy(fi, &tmp, sizeof(tmp)); + fi->fh = tmp.fh; + } else +- err = ((struct fuse_operations_compat2 *) &fs->op) +- ->open(path, fi->flags); ++ err = (((struct fuse_operations_compat2 *) &fs->op)->open)(path, fi->flags); + return err; + } + +diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c +index c86a910..4f19d61 100644 +--- a/lib/fuse_lowlevel.c ++++ b/lib/fuse_lowlevel.c +@@ -716,7 +716,7 @@ static void do_open(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) + fi.flags = arg->flags; + + if (req->f->op.open) +- req->f->op.open(req, nodeid, &fi); ++ (req->f->op.open)(req, nodeid, &fi); + else + fuse_reply_open(req, &fi); + } +-- +1.7.9.3 + diff --git a/SOURCES/fuse-aarch64.patch b/SOURCES/fuse-aarch64.patch new file mode 100644 index 0000000..180f544 --- /dev/null +++ b/SOURCES/fuse-aarch64.patch @@ -0,0 +1,20 @@ +Upstream-Status: Submitted + +Signed-off-by: Riku Voipio + +--- a/include/fuse_kernel.h ++++ b/include/fuse_kernel.h +@@ -88,12 +88,7 @@ + #ifndef _LINUX_FUSE_H + #define _LINUX_FUSE_H + +-#include +-#define __u64 uint64_t +-#define __s64 int64_t +-#define __u32 uint32_t +-#define __s32 int32_t +-#define __u16 uint16_t ++#include + + /* + * Version negotiation: diff --git a/SOURCES/fuse.conf b/SOURCES/fuse.conf new file mode 100644 index 0000000..cd4c6bd --- /dev/null +++ b/SOURCES/fuse.conf @@ -0,0 +1,2 @@ +# mount_max = 1000 +# user_allow_other diff --git a/SOURCES/fusermount-don-t-feed-escaped-commas-into-mount-opti.patch b/SOURCES/fusermount-don-t-feed-escaped-commas-into-mount-opti.patch new file mode 100644 index 0000000..fb6934f --- /dev/null +++ b/SOURCES/fusermount-don-t-feed-escaped-commas-into-mount-opti.patch @@ -0,0 +1,47 @@ +From 520f09be3c2d351722c33daf7389d6ac4716be98 Mon Sep 17 00:00:00 2001 +From: Jann Horn +Date: Fri, 13 Jul 2018 15:15:36 -0700 +Subject: [PATCH] fusermount: don't feed "escaped commas" into mount options + +The old code permits the following behavior: + +$ _FUSE_COMMFD=10000 priv_strace -etrace=mount -s200 fusermount -o 'foobar=\,allow_other' mount +mount("/dev/fuse", ".", "fuse", MS_NOSUID|MS_NODEV, "foobar=\\,allow_other,fd=3,rootmode=40000,user_id=1000,group_id=1000") = -1 EINVAL (Invalid argument) + +However, backslashes do not have any special meaning for the kernel here. + +As it happens, you can't abuse this because there is no FUSE mount option +that takes a string value that can contain backslashes; but this is very +brittle. Don't interpret "escape characters" in places where they don't +work. +--- + util/fusermount.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/util/fusermount.c b/util/fusermount.c +index 26a0b75bbecb..5175c0115a05 100644 +--- a/util/fusermount.c ++++ b/util/fusermount.c +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + + #define FUSE_COMMFD_ENV "_FUSE_COMMFD" + +@@ -739,8 +740,10 @@ static int do_mount(const char *mnt, char **typep, mode_t rootmode, + unsigned len; + const char *fsname_str = "fsname="; + const char *subtype_str = "subtype="; ++ bool escape_ok = begins_with(s, fsname_str) || ++ begins_with(s, subtype_str); + for (len = 0; s[len]; len++) { +- if (s[len] == '\\' && s[len + 1]) ++ if (escape_ok && s[len] == '\\' && s[len + 1]) + len++; + else if (s[len] == ',') + break; +-- +2.14.3 + diff --git a/SOURCES/libfuse-fix-crash-in-unlock_path.patch b/SOURCES/libfuse-fix-crash-in-unlock_path.patch new file mode 100644 index 0000000..cb138ee --- /dev/null +++ b/SOURCES/libfuse-fix-crash-in-unlock_path.patch @@ -0,0 +1,50 @@ +From 3a2bd4da6b0b713276528d0c818f9e7be515e8ec Mon Sep 17 00:00:00 2001 +From: "Ratna_Bolla@dell.com" +Date: Mon, 4 Feb 2013 18:30:14 +0100 +Subject: [PATCH] libfuse: fix crash in unlock_path() + +Patch by Ratna Manoj. + +queue_element_unlock() should set ->first_locked and ->second_locked to false. + +Discovered with 'fs_racer'. The assert(wnode->treelock == TREELOCK_WRITE) in +unlock_path() was hit within minutes. + +Miklos: simplified patch +--- + ChangeLog | 4 ++++ + lib/fuse.c | 2 ++ + 2 files changed, 6 insertions(+) + +diff --git a/ChangeLog b/ChangeLog +index dbd10e85ebf8..076bcaf54490 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2013-02-04 Miklos Szeredi ++ ++ * libfuse: fix crash in unlock_path(). Patch by Ratna Manoj ++ + 2012-10-01 Miklos Szeredi + + * Released 2.9.2 +diff --git a/lib/fuse.c b/lib/fuse.c +index 599a587fbe60..1917346c759d 100644 +--- a/lib/fuse.c ++++ b/lib/fuse.c +@@ -1021,10 +1021,12 @@ static void queue_element_unlock(struct fuse *f, struct lock_queue_element *qe) + if (qe->first_locked) { + wnode = qe->wnode1 ? *qe->wnode1 : NULL; + unlock_path(f, qe->nodeid1, wnode, NULL); ++ qe->first_locked = false; + } + if (qe->second_locked) { + wnode = qe->wnode2 ? *qe->wnode2 : NULL; + unlock_path(f, qe->nodeid2, wnode, NULL); ++ qe->second_locked = false; + } + } + +-- +2.14.3 + diff --git a/SPECS/fuse.spec b/SPECS/fuse.spec new file mode 100644 index 0000000..5ab3a0d --- /dev/null +++ b/SPECS/fuse.spec @@ -0,0 +1,338 @@ +Name: fuse +Version: 2.9.2 +Release: 11%{?dist} +Summary: File System in Userspace (FUSE) utilities + +Group: System Environment/Base +License: GPL+ +URL: https://github.com/libfuse/libfuse +Source0: https://github.com/libfuse/libfuse/releases/download/fuse_2_9_4/%{name}-%{version}.tar.gz +Source1: %{name}.conf + +Patch1: fuse-0001-More-parentheses.patch +Patch2: fuse-aarch64.patch +Patch3: buffer_size.patch +Patch4: libfuse-fix-crash-in-unlock_path.patch +Patch5: fusermount-don-t-feed-escaped-commas-into-mount-opti.patch + +Requires: which +Conflicts: filesystem < 3 +BuildRequires: libselinux-devel + +Requires(preun): chkconfig + +%description +With FUSE it is possible to implement a fully functional filesystem in a +userspace program. This package contains the FUSE userspace tools to +mount a FUSE filesystem. + +%package libs +Summary: File System in Userspace (FUSE) libraries +Group: System Environment/Libraries +License: LGPLv2+ +Conflicts: filesystem < 3 + +%description libs +Devel With FUSE it is possible to implement a fully functional filesystem in a +userspace program. This package contains the FUSE libraries. + + +%package devel +Summary: File System in Userspace (FUSE) devel files +Group: Development/Libraries +Requires: %{name}-libs = %{version}-%{release} +Requires: pkgconfig +License: LGPLv2+ +Conflicts: filesystem < 3 + +%description devel +With FUSE it is possible to implement a fully functional filesystem in a +userspace program. This package contains development files (headers, +pgk-config) to develop FUSE based applications/filesystems. + + +%prep +%setup -q +#disable device creation during build/install +sed -i 's|mknod|echo Disabled: mknod |g' util/Makefile.in +%patch1 -p1 -b .add_parentheses +%patch2 -p1 -b .aarch64 +%patch3 -p1 -b .buffer_size +%patch4 -p1 -b .unlock_path_crash +%patch5 -p1 -b .escaped_commas + +%build +# Can't pass --disable-static here, or else the utils don't build +export MOUNT_FUSE_PATH="%{_sbindir}" +CFLAGS="%{optflags} -D_GNU_SOURCE -fPIE -pie -Wl,-z,relro,-z,now" %configure +make %{?_smp_mflags} + +%install +make install DESTDIR=%{buildroot} +find %{buildroot} -type f -name "*.la" -exec rm -f {} ';' +# change from 4755 to 0755 to allow stripping -- fixed later in files +chmod 0755 %{buildroot}/%{_bindir}/fusermount + +# Get rid of static libs +rm -f %{buildroot}/%{_libdir}/*.a +# No need to create init-script +rm -f %{buildroot}%{_sysconfdir}/init.d/fuse + +# Install config-file +install -p -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir} + +# Delete pointless udev rules, which do not belong in /etc (brc#748204) +rm -f %{buildroot}%{_sysconfdir}/udev/rules.d/99-fuse.rules + +%post libs -p /sbin/ldconfig + +%postun libs -p /sbin/ldconfig + +%files +%doc AUTHORS ChangeLog COPYING FAQ Filesystems NEWS README README.NFS +%{_sbindir}/mount.fuse +%attr(4755,root,root) %{_bindir}/fusermount +%{_bindir}/ulockmgr_server +%config(noreplace) %{_sysconfdir}/%{name}.conf +%{_mandir}/man1/* +%{_mandir}/man8/* + +%files libs +%doc COPYING.LIB +%{_libdir}/libfuse.so.* +%{_libdir}/libulockmgr.so.* + +%files devel +%{_libdir}/libfuse.so +%{_libdir}/libulockmgr.so +%{_libdir}/pkgconfig/*.pc +%{_includedir}/fuse.h +%{_includedir}/ulockmgr.h +%{_includedir}/fuse + +%changelog +* Tue Jul 24 2018 Miklos Szeredi - 2.9.2-11 +- Fixed CVE-2018-10906 (rhbz#1605159) + +* Fri Jan 05 2018 Miklos Szeredi - 2.9.2-10 +- Fix crash in unlock_path() (rhbz#1527008) + +* Fri Oct 27 2017 Miklos Szeredi - 2.9.2-9 +- Update URLs in specfile to point to github project + +* Tue May 02 2017 Carlos Maiolino - 2.9.2-8 +- Make buffer size match kernel max transfer size + +* Thu May 19 2016 Carlos Maiolino - 2.9.2-7 +- Enable PIE and RELRO check + +* Tue Jun 17 2014 Brian Foster - 2.9.2-6 +- Use kernel types not sys types. + +* Fri Jan 24 2014 Daniel Mach - 2.9.2-5 +- Mass rebuild 2014-01-24 + +* Fri Dec 27 2013 Daniel Mach - 2.9.2-4 +- Mass rebuild 2013-12-27 + +* Sat May 18 2013 Peter Lemenkov - 2.9.2-3 +- Removed pre-F12 stuff +- Dropped ancient dependency on initscripts and chkconfig + +* Wed Feb 13 2013 Fedora Release Engineering - 2.9.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Thu Dec 06 2012 Adam Jackson +- Remove ancient Requires: kernel >= 2.6.14, FC6 was 2.6.18. + +* Tue Oct 23 2012 Tom Callaway - 2.9.2-1 +- update to 2.9.2 + +* Tue Aug 28 2012 Tom Callaway - 2.9.1-1 +- update to 2.9.1 + +* Thu Jul 19 2012 Fedora Release Engineering - 2.8.7-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Mon Apr 16 2012 Peter Lemenkov - 2.8.7-1 +- Ver. 2.8.7 + +* Sun Apr 15 2012 Kay Sievers - 2.8.6-4 +- remove needless udev rule + +* Wed Jan 25 2012 Harald Hoyer 2.8.6-3 +- install everything in /usr + https://fedoraproject.org/wiki/Features/UsrMove + +* Fri Jan 13 2012 Fedora Release Engineering - 2.8.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Thu Sep 22 2011 Peter Lemenkov - 2.8.6-1 +- Ver. 2.8.6 +- Dropped patch 3 - fixed upstream + +* Thu Mar 03 2011 Peter Lemenkov - 2.8.5-5 +- Use noreplace for /etc/fuse.conf + +* Tue Feb 15 2011 Peter Lemenkov - 2.8.5-4 +- Provide /etc/fuse.conf (see rhbz #292811) + +* Tue Feb 08 2011 Fedora Release Engineering - 2.8.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Wed Oct 27 2010 Peter Lemenkov 2.8.5-2 +- Fixed rhbz #622255 + +* Tue Oct 26 2010 Peter Lemenkov 2.8.5-1 +- Ver. 2.8.5 + +* Tue Jun 8 2010 Peter Lemenkov 2.8.4-1 +- Ver. 2.8.4 +- CVE-2009-3297 patch dropped (merged upstream) + +* Tue Jan 26 2010 Peter Lemenkov 2.8.1-4 +- Fixed CVE-2009-3297 (rhbz #558833) + +* Thu Nov 19 2009 Peter Lemenkov 2.8.1-3 +- Fixed udev rules (bz# 538606) + +* Thu Nov 19 2009 Peter Lemenkov 2.8.1-2 +- Removed support for MAKEDEV (bz# 511220) + +* Thu Sep 17 2009 Peter Lemenkov 2.8.1-1 +- Ver. 2.8.1 + +* Wed Aug 19 2009 Peter Lemenkov 2.8.0-1 +- Ver. 2.8.0 + +* Fri Jul 24 2009 Fedora Release Engineering - 2.7.4-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Tue Feb 24 2009 Fedora Release Engineering - 2.7.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Wed Jan 28 2009 Peter Lemenkov 2.7.4-2 +- Fixed BZ#479581 + +* Sat Aug 23 2008 Peter Lemenkov 2.7.4-1 +- Ver. 2.7.4 + +* Sat Jul 12 2008 Peter Lemenkov 2.7.3-3 +- Fixed initscripts (BZ#441284) + +* Thu Feb 28 2008 Peter Lemenkov 2.7.3-2 +- Fixed BZ#434881 + +* Wed Feb 20 2008 Peter Lemenkov 2.7.3-1 +- Ver. 2.7.3 +- Removed usergroup fuse +- Added chkconfig support (BZ#228088) + +* Tue Feb 19 2008 Fedora Release Engineering - 2.7.2-2 +- Autorebuild for GCC 4.3 + +* Mon Jan 21 2008 Tom "spot" Callaway 2.7.2-1 +- bump to 2.7.2 +- fix license tag + +* Sun Nov 4 2007 Tom "spot" Callaway 2.7.0-9 +- fix initscript to work with chkconfig + +* Mon Oct 1 2007 Peter Lemenkov 2.7.0-8 +- Added Require: which (BZ#312511) + +* Fri Sep 21 2007 Tom "spot" Callaway 2.7.0-7 +- revert udev rules change + +* Thu Sep 20 2007 Tom "spot" Callaway 2.7.0-6 +- change udev rules so that /dev/fuse is chmod 666 (bz 298651) + +* Wed Aug 29 2007 Tom "spot" Callaway 2.7.0-5 +- fix open issue (bz 265321) + +* Wed Aug 29 2007 Fedora Release Engineering - 2.7.0-4 +- Rebuild for selinux ppc32 issue. + +* Sun Jul 22 2007 Tom "spot" Callaway 2.7.0-3 +- put pkgconfig file in correct place +- enable compat symlinks for files in /bin + +* Sat Jul 21 2007 Tom "spot" Callaway 2.7.0-2 +- redefine exec_prefix to / +- redefine bindir to /bin +- redefine libdir to %%{_lib} +- don't pass --disable-static to configure +- manually rm generated static libs + +* Wed Jul 18 2007 Peter Lemenkov 2.7.0-1 +- Version 2.7.0 +- Redefined exec_prefix due to demands from NTFS-3G + +* Wed Jun 6 2007 Peter Lemenkov 2.6.5-2 +- Add BR libselinux-devel (bug #235145) +- Config files properly marked as config (bug #211122) + +* Sat May 12 2007 Peter Lemenkov 2.6.5-1 +- Version 2.6.5 + +* Thu Feb 22 2007 Peter Lemenkov 2.6.3-2 +- Fixed bug #229642 + +* Wed Feb 7 2007 Peter Lemenkov 2.6.3-1 +* Ver. 2.6.3 + +* Tue Dec 26 2006 Peter Lemenkov 2.6.1-1 +- Ver. 2.6.1 + +* Sat Nov 25 2006 Peter Lemenkov 2.6.0-2 +- fixed nasty typo (see bug #217075) + +* Fri Nov 3 2006 Peter Lemenkov 2.6.0-1 +- Ver. 2.6.0 + +* Sun Oct 29 2006 Peter Lemenkov 2.5.3-5 +- Fixed udev-rule again + +* Sat Oct 7 2006 Peter Lemenkov 2.5.3-4 +- Fixed udev-rule + +* Tue Sep 12 2006 Peter Lemenkov 2.5.3-3%{?dist} +- Rebuild for FC6 + +* Wed May 03 2006 Peter Lemenkov 2.5.3-1%{?dist} +- Update to 2.5.3 + +* Thu Mar 30 2006 Peter Lemenkov 2.5.2-4%{?dist} +- rebuild + +* Mon Feb 13 2006 Peter Lemenkov - 2.5.2-3 +- Proper udev rule + +* Mon Feb 13 2006 Peter Lemenkov - 2.5.2-2 +- Added missing requires + +* Tue Feb 07 2006 Peter Lemenkov - 2.5.2-1 +- Update to 2.5.2 +- Dropped fuse-mount.fuse.patch + +* Wed Nov 23 2005 Thorsten Leemhuis - 2.4.2-1 +- Use dist + +* Wed Nov 23 2005 Thorsten Leemhuis - 2.4.2-1 +- Update to 2.4.2 (solves CVE-2005-3531) +- Update README.fedora + +* Sat Nov 12 2005 Thorsten Leemhuis - 2.4.1-3 +- Add README.fedora +- Add hint to README.fedora and that you have to be member of the group "fuse" + in the description +- Use groupadd instead of fedora-groupadd + +* Fri Nov 04 2005 Thorsten Leemhuis - 2.4.1-2 +- Rename packages a bit +- use makedev.d/40-fuse.nodes +- fix /sbin/mount.fuse +- Use a fuse group to restict access to fuse-filesystems + +* Fri Oct 28 2005 Thorsten Leemhuis - 2.4.1-1 +- Initial RPM release.