The oss-fuzz code uses an lsan_suppressions file to suppress certain
leak-sanitizer cases that are known issues or not our code's bug.
This is useful more widely than just for the fuzzer harness: if you
want to build QEMU with the leak sanitizer enabled and run 'make
check' then you will want to suppress some bogus leak reports.
Move the file up a directory, and add the usual SPDX identifier
and a comment describing how to use it.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
.gitlab-ci.d/buildtest.yml | 2 +-
scripts/lsan_suppressions.txt | 11 +++++++++++
scripts/oss-fuzz/lsan_suppressions.txt | 5 -----
3 files changed, 12 insertions(+), 6 deletions(-)
create mode 100644 scripts/lsan_suppressions.txt
delete mode 100644 scripts/oss-fuzz/lsan_suppressions.txt
diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml
index 1b656b9eb0..7548057c54 100644
--- a/.gitlab-ci.d/buildtest.yml
+++ b/.gitlab-ci.d/buildtest.yml
@@ -626,7 +626,7 @@ build-oss-fuzz:
IMAGE: fedora
script:
- mkdir build-oss-fuzz
- - export LSAN_OPTIONS=suppressions=scripts/oss-fuzz/lsan_suppressions.txt
+ - export LSAN_OPTIONS=suppressions=scripts/lsan_suppressions.txt
- CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
./scripts/oss-fuzz/build.sh
- export ASAN_OPTIONS="fast_unwind_on_malloc=0"
diff --git a/scripts/lsan_suppressions.txt b/scripts/lsan_suppressions.txt
new file mode 100644
index 0000000000..ffade3ba5a
--- /dev/null
+++ b/scripts/lsan_suppressions.txt
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+# This is a set of suppressions for LeakSanitizer; you can use it by setting
+# LSAN_OPTIONS="suppressions=/path/to/scripts/lsan_suppressions.txt"
+# when running a QEMU built with the leak-sanitizer.
+
+# The tcmalloc on Fedora37 confuses things
+leak:/lib64/libtcmalloc_minimal.so.4
+
+# libxkbcommon also leaks in qemu-keymap
+leak:/lib64/libxkbcommon.so.0
diff --git a/scripts/oss-fuzz/lsan_suppressions.txt b/scripts/oss-fuzz/lsan_suppressions.txt
deleted file mode 100644
index 7d90c280d0..0000000000
--- a/scripts/oss-fuzz/lsan_suppressions.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-# The tcmalloc on Fedora37 confuses things
-leak:/lib64/libtcmalloc_minimal.so.4
-
-# libxkbcommon also leaks in qemu-keymap
-leak:/lib64/libxkbcommon.so.0
--
2.43.0
I forgot to cc the 'device fuzzing' maintainers on this patch; sorry about that. -- PMM On Fri, 27 Feb 2026 at 13:57, Peter Maydell <peter.maydell@linaro.org> wrote: > > The oss-fuzz code uses an lsan_suppressions file to suppress certain > leak-sanitizer cases that are known issues or not our code's bug. > This is useful more widely than just for the fuzzer harness: if you > want to build QEMU with the leak sanitizer enabled and run 'make > check' then you will want to suppress some bogus leak reports. > > Move the file up a directory, and add the usual SPDX identifier > and a comment describing how to use it. > > Signed-off-by: Peter Maydell <peter.maydell@linaro.org> > --- > .gitlab-ci.d/buildtest.yml | 2 +- > scripts/lsan_suppressions.txt | 11 +++++++++++ > scripts/oss-fuzz/lsan_suppressions.txt | 5 ----- > 3 files changed, 12 insertions(+), 6 deletions(-) > create mode 100644 scripts/lsan_suppressions.txt > delete mode 100644 scripts/oss-fuzz/lsan_suppressions.txt > > diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml > index 1b656b9eb0..7548057c54 100644 > --- a/.gitlab-ci.d/buildtest.yml > +++ b/.gitlab-ci.d/buildtest.yml > @@ -626,7 +626,7 @@ build-oss-fuzz: > IMAGE: fedora > script: > - mkdir build-oss-fuzz > - - export LSAN_OPTIONS=suppressions=scripts/oss-fuzz/lsan_suppressions.txt > + - export LSAN_OPTIONS=suppressions=scripts/lsan_suppressions.txt > - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address" > ./scripts/oss-fuzz/build.sh > - export ASAN_OPTIONS="fast_unwind_on_malloc=0" > diff --git a/scripts/lsan_suppressions.txt b/scripts/lsan_suppressions.txt > new file mode 100644 > index 0000000000..ffade3ba5a > --- /dev/null > +++ b/scripts/lsan_suppressions.txt > @@ -0,0 +1,11 @@ > +# SPDX-License-Identifier: GPL-2.0-or-later > + > +# This is a set of suppressions for LeakSanitizer; you can use it by setting > +# LSAN_OPTIONS="suppressions=/path/to/scripts/lsan_suppressions.txt" > +# when running a QEMU built with the leak-sanitizer. > + > +# The tcmalloc on Fedora37 confuses things > +leak:/lib64/libtcmalloc_minimal.so.4 > + > +# libxkbcommon also leaks in qemu-keymap > +leak:/lib64/libxkbcommon.so.0 > diff --git a/scripts/oss-fuzz/lsan_suppressions.txt b/scripts/oss-fuzz/lsan_suppressions.txt > deleted file mode 100644 > index 7d90c280d0..0000000000 > --- a/scripts/oss-fuzz/lsan_suppressions.txt > +++ /dev/null > @@ -1,5 +0,0 @@ > -# The tcmalloc on Fedora37 confuses things > -leak:/lib64/libtcmalloc_minimal.so.4 > - > -# libxkbcommon also leaks in qemu-keymap > -leak:/lib64/libxkbcommon.so.0 > -- > 2.43.0
Hi, Peter On 27/02/2026 09:04, Peter Maydell wrote: > I forgot to cc the 'device fuzzing' maintainers on this patch; > sorry about that. > > -- PMM > > On Fri, 27 Feb 2026 at 13:57, Peter Maydell <peter.maydell@linaro.org> wrote: >> >> The oss-fuzz code uses an lsan_suppressions file to suppress certain >> leak-sanitizer cases that are known issues or not our code's bug. >> This is useful more widely than just for the fuzzer harness: if you >> want to build QEMU with the leak sanitizer enabled and run 'make >> check' then you will want to suppress some bogus leak reports. >> >> Move the file up a directory, and add the usual SPDX identifier >> and a comment describing how to use it. >> >> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> >> --- >> .gitlab-ci.d/buildtest.yml | 2 +- >> scripts/lsan_suppressions.txt | 11 +++++++++++ >> scripts/oss-fuzz/lsan_suppressions.txt | 5 ----- >> 3 files changed, 12 insertions(+), 6 deletions(-) >> create mode 100644 scripts/lsan_suppressions.txt >> delete mode 100644 scripts/oss-fuzz/lsan_suppressions.txt >> >> diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml >> index 1b656b9eb0..7548057c54 100644 >> --- a/.gitlab-ci.d/buildtest.yml >> +++ b/.gitlab-ci.d/buildtest.yml >> @@ -626,7 +626,7 @@ build-oss-fuzz: >> IMAGE: fedora >> script: >> - mkdir build-oss-fuzz >> - - export LSAN_OPTIONS=suppressions=scripts/oss-fuzz/lsan_suppressions.txt >> + - export LSAN_OPTIONS=suppressions=scripts/lsan_suppressions.txt >> - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address" >> ./scripts/oss-fuzz/build.sh >> - export ASAN_OPTIONS="fast_unwind_on_malloc=0" >> diff --git a/scripts/lsan_suppressions.txt b/scripts/lsan_suppressions.txt >> new file mode 100644 >> index 0000000000..ffade3ba5a >> --- /dev/null >> +++ b/scripts/lsan_suppressions.txt >> @@ -0,0 +1,11 @@ >> +# SPDX-License-Identifier: GPL-2.0-or-later >> + >> +# This is a set of suppressions for LeakSanitizer; you can use it by setting >> +# LSAN_OPTIONS="suppressions=/path/to/scripts/lsan_suppressions.txt" >> +# when running a QEMU built with the leak-sanitizer. >> + >> +# The tcmalloc on Fedora37 confuses things >> +leak:/lib64/libtcmalloc_minimal.so.4 >> + >> +# libxkbcommon also leaks in qemu-keymap >> +leak:/lib64/libxkbcommon.so.0 >> diff --git a/scripts/oss-fuzz/lsan_suppressions.txt b/scripts/oss-fuzz/lsan_suppressions.txt >> deleted file mode 100644 >> index 7d90c280d0..0000000000 >> --- a/scripts/oss-fuzz/lsan_suppressions.txt >> +++ /dev/null >> @@ -1,5 +0,0 @@ >> -# The tcmalloc on Fedora37 confuses things >> -leak:/lib64/libtcmalloc_minimal.so.4 >> - >> -# libxkbcommon also leaks in qemu-keymap >> -leak:/lib64/libxkbcommon.so.0 >> -- >> 2.43.0 > The similarity index is under 40%, so `git log --follow` doesn't follow the move; not a big deal, but separate patches for the move and the new lines would avoid this and make it easier for folks to get the full history in one go. Also, there's a missed reference in the docker test script (diff below). Thanks, Yodel -- >8 -- diff --git a/tests/docker/test-fuzz b/tests/docker/test-fuzz index 7e506ae1f6..d2bdc8afba 100755 --- a/tests/docker/test-fuzz +++ b/tests/docker/test-fuzz @@ -18,7 +18,7 @@ cd "$BUILD_DIR" cp -a $QEMU_SRC . cd src mkdir build-oss-fuzz -export LSAN_OPTIONS=suppressions=scripts/oss-fuzz/lsan_suppressions.txt +export LSAN_OPTIONS=suppressions=scripts/lsan_suppressions.txt env CC="clang" CXX="clang++" CFLAGS="-fsanitize=address" ./scripts/oss-fuzz/build.sh export ASAN_OPTIONS="fast_unwind_on_malloc=0" for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f | grep -v slirp); do
On Fri, 27 Feb 2026 at 15:32, Yodel Eldar <yodel.eldar@yodel.dev> wrote: > Also, there's a missed reference in the docker test script (diff below). Oops, thanks for catching that. -- PMM
© 2016 - 2026 Red Hat, Inc.