!54 fuse3: backport upstream patches
From: @hifi521 Reviewed-by: @liuzhiqiang26 Signed-off-by: @liuzhiqiang26
This commit is contained in:
commit
4b7bd3fed5
51
0003-Fix-use-after-free-warning.patch
Normal file
51
0003-Fix-use-after-free-warning.patch
Normal file
@ -0,0 +1,51 @@
|
||||
From f2144c6c3a0d4eda5f8384b56cdeb5193a3c06ef Mon Sep 17 00:00:00 2001
|
||||
From: Matthias Goergens <matthias.goergens@gmail.com>
|
||||
Date: Tue, 28 Mar 2023 13:35:56 +0800
|
||||
Subject: [PATCH] Fix use-after-free warning
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
When building, I get the following warning:
|
||||
|
||||
```bash
|
||||
$ ninja
|
||||
[18/71] Compiling C object lib/libfuse3.so.3.14.1.p/modules_iconv.c.o
|
||||
../lib/modules/iconv.c: In function ‘iconv_convpath’:
|
||||
../lib/modules/iconv.c:85:38: warning: pointer ‘newpath’ may be used after ‘realloc’ [-Wuse-after-free]
|
||||
85 | p = tmp + (p - newpath);
|
||||
| ~~~^~~~~~~~~~
|
||||
../lib/modules/iconv.c:80:31: note: call to ‘realloc’ here
|
||||
80 | tmp = realloc(newpath, newpathlen + 1);
|
||||
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
[71/71] Linking target example/passthrough_hp
|
||||
```
|
||||
|
||||
It's a false positive, I thinks. But it's also easy to silence this
|
||||
warning with a small refactor.
|
||||
---
|
||||
lib/modules/iconv.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/modules/iconv.c b/lib/modules/iconv.c
|
||||
index 3d18a36..a0bf72b 100644
|
||||
--- a/lib/modules/iconv.c
|
||||
+++ b/lib/modules/iconv.c
|
||||
@@ -77,12 +77,13 @@ static int iconv_convpath(struct iconv *ic, const char *path, char **newpathp,
|
||||
|
||||
inc = (pathlen + 1) * 4;
|
||||
newpathlen += inc;
|
||||
+ int dp = p - newpath;
|
||||
tmp = realloc(newpath, newpathlen + 1);
|
||||
err = -ENOMEM;
|
||||
if (!tmp)
|
||||
goto err;
|
||||
|
||||
- p = tmp + (p - newpath);
|
||||
+ p = tmp + dp;
|
||||
plen += inc;
|
||||
newpath = tmp;
|
||||
}
|
||||
--
|
||||
2.41.0
|
||||
|
||||
30
0004-Disable-leak-suppression-773.patch
Normal file
30
0004-Disable-leak-suppression-773.patch
Normal file
@ -0,0 +1,30 @@
|
||||
From 34d9d2abf1da37961d4f0a2ad55dcf11ed46a33e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Matthias=20G=C3=B6rgens?= <matthias.goergens@gmail.com>
|
||||
Date: Wed, 12 Apr 2023 15:40:18 +0800
|
||||
Subject: [PATCH] Disable leak suppression (#773)
|
||||
|
||||
Conflict: they -> the
|
||||
|
||||
---
|
||||
test/lsan_suppress.txt | 10 ----------
|
||||
1 file changed, 10 deletions(-)
|
||||
|
||||
diff --git a/test/lsan_suppress.txt b/test/lsan_suppress.txt
|
||||
index e054e7c..44703fc 100644
|
||||
--- a/test/lsan_suppress.txt
|
||||
+++ b/test/lsan_suppress.txt
|
||||
@@ -1,11 +1 @@
|
||||
# Suppression file for address sanitizer.
|
||||
-
|
||||
-# There are some leaks in command line option parsing. They should be
|
||||
-# fixed at some point, but are harmless since the consume just a small,
|
||||
-# constant amount of memory and do not grow.
|
||||
-leak:fuse_opt_parse
|
||||
-
|
||||
-
|
||||
-# Leaks in fusermount3 are harmless as well (it's a short-lived
|
||||
-# process) - but patches are welcome!
|
||||
-leak:fusermount.c
|
||||
--
|
||||
2.41.0
|
||||
|
||||
11
fuse3.spec
11
fuse3.spec
@ -2,15 +2,17 @@
|
||||
|
||||
Name: fuse3
|
||||
Version: %{fuse3ver}
|
||||
Release: 1
|
||||
Release: 2
|
||||
Summary: User space File System of fuse3
|
||||
License: GPL+ and LGPLv2+
|
||||
URL: http://fuse.sf.net
|
||||
Source0: https://github.com/libfuse/libfuse/releases/download/fuse-%{fuse3ver}/fuse-%{fuse3ver}.tar.xz
|
||||
Source1: fuse.conf
|
||||
|
||||
Patch1: 0001-fix-chown-and-mknod-failed.patch
|
||||
Patch2: 0002-revert-fuse_daemonize-chdir-to-even-if-not-run.patch
|
||||
Patch1: 0001-fix-chown-and-mknod-failed.patch
|
||||
Patch2: 0002-revert-fuse_daemonize-chdir-to-even-if-not-run.patch
|
||||
Patch3: 0003-Fix-use-after-free-warning.patch
|
||||
Patch4: 0004-Disable-leak-suppression-773.patch
|
||||
|
||||
BuildRequires: libselinux-devel, pkgconfig, systemd-udev, meson, fdupes
|
||||
BuildRequires: autoconf, automake, libtool, gettext-devel, ninja-build
|
||||
@ -101,6 +103,9 @@ install -p -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}
|
||||
%{_mandir}/man8/*
|
||||
|
||||
%changelog
|
||||
* Tue Jul 11 2023 zhanchengbin <zhanchengbin1@huawei.com> -3.13.0-2
|
||||
- backport upstream patches
|
||||
|
||||
* Thu Feb 9 2023 zhanchengbin <zhanchengbin1@huawei.com> -3.13.0-1
|
||||
- upgrade to 3.13.0
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user