#978463 libfsapfs: memory tests fundamentally broken, please disable them on riscv64

Package:
src:libfsapfs
Source:
libfsapfs
Submitter:
Aurelien Jarno
Date:
2024-12-28 12:21:03 UTC
Severity:
normal
Tags:
#978463#5
Date:
2020-12-27 19:50:15 UTC
From:
To:
Hi,

fails to build on riscv64:
https://buildd.debian.org/status/fetch.php?pkg=libfsapfs&arch=riscv64&ver=20201107-1&stamp=1607191812&raw=0

This is due to fundamentally broken tests assuming that memcpy and
memset can fail returning NULL, and interposing these libc functions in
the tests with functions that sometimes return NULL. This tests should
be simply removed as they do not make sense. See bug #978433 for more
details as the same code is basically replicated in dozen of packages.

A simpler way to fix the issue for riscv64 is to disable all memory
tests on this architecture, as it is already done for a long list of
cases. This is what the patch below does:
--- libfsapfs-20201107/debian/patches/01-disable-memory-tests-on-riscv64.patch	1970-01-01 01:00:00.000000000 +0100
+++ libfsapfs-20201107/debian/patches/01-disable-memory-tests-on-riscv64.patch	2020-12-27 14:46:43.000000000 +0100
@@ -0,0 +1,11 @@
+--- libfsapfs-20201107.orig/tests/fsapfs_test_memory.h
++++ libfsapfs-20201107/tests/fsapfs_test_memory.h
+@@ -28,7 +28,7 @@
+ extern "C" {
+ #endif
+
+-#if defined( HAVE_GNU_DL_DLSYM ) && defined( __GNUC__ ) && !defined( LIBFSAPFS_DLL_IMPORT ) && !defined( __arm__ ) && !defined( __clang__ ) && !defined( __CYGWIN__ ) && !defined( __hppa__ ) && !defined( __mips__ ) && !defined( __sparc__ ) && !defined( HAVE_ASAN )
++#if defined( HAVE_GNU_DL_DLSYM ) && defined( __GNUC__ ) && !defined( LIBFSAPFS_DLL_IMPORT ) && !defined( __arm__ ) && !defined( __clang__ ) && !defined( __CYGWIN__ ) && !defined( __hppa__ ) && !defined( __mips__ ) && !defined( __sparc__ ) && !defined( __riscv ) && !defined( HAVE_ASAN )
+ #define HAVE_FSAPFS_TEST_MEMORY		1
+ #endif
+
--- libfsapfs-20201107/debian/patches/series	1970-01-01 01:00:00.000000000 +0100
+++ libfsapfs-20201107/debian/patches/series	2020-12-27 14:46:43.000000000 +0100
@@ -0,0 +1 @@
+01-disable-memory-tests-on-riscv64.patch

Regards,
Aurelien

#978463#8
Date:
2021-01-27 09:17:44 UTC
From:
To:
Hello,

Bug #978463 in libfsapfs reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:

https://salsa.debian.org/pkg-security-team/libfsapfs/-/commit/5d742cfbf88fd07dbbca44ce5db592eb1f766ca7

(this message was generated automatically)
-- 
Greetings

https://bugs.debian.org/978463

#978463#15
Date:
2023-08-04 20:12:25 UTC
From:
To:
Hi,

* Sebastien Delafond <noreply@salsa.debian.org> on 2021-01-27:

could this pending commit (from 2021!) please make it into an upload
to sid?

Chris

#978463#20
Date:
2024-12-28 12:19:32 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
libfsapfs, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 978463@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Hilko Bengen <bengen@debian.org> (supplier of updated libfsapfs package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Sat, 28 Dec 2024 12:18:40 +0100
Source: libfsapfs
Architecture: source
Version: 20240429-1
Distribution: unstable
Urgency: medium
Maintainer: Debian Security Tools <team+pkg-security@tracker.debian.org>
Changed-By: Hilko Bengen <bengen@debian.org>
Closes: 978463 1045347 1080631
Changes:
 libfsapfs (20240429-1) unstable; urgency=medium
 .
   [ Hilko Bengen ]
   * New upstream version 20240429
     - Memory tests are no longer enabled on riscv64 (Closes: #978463)
   * Fix watch file
   * Drop obsolete patch
   * Fix building for Python3
   * Drop libbfio build-dependency; use vendored version
   * Replace build-dependency pkg-config => pkgconf
   * Add python3-setuptools build-dependency (Closes: #1080631)
   * Update symbols file
   * No longer fails to build source after successful build (Closes: #1045347)
 .
   [ Debian Janitor ]
   * Use secure copyright file specification URI.
   * Set debhelper-compat version in Build-Depends.
   * Set upstream metadata fields: Bug-Database, Bug-Submit.
   * Remove Section on libfsapfs1 that duplicates source.
   * Apply multi-arch hints. + python3-fsapfs: Add Multi-Arch: same.
   * Remove constraints unnecessary since buster
   * Set upstream metadata fields: Repository-Browse.
   * Update standards version to 4.6.1, no changes needed.
   * Avoid explicitly specifying -Wl,--as-needed linker flag.
 .
   [ Samuel Henrique ]
   * Configure git-buildpackage for Debian
Checksums-Sha1:
 474b467cdce79da97bed2abc324f79462c361d64 2224 libfsapfs_20240429-1.dsc
 2940e87022f973eabf31cd2dbe6e5a9d2bdb70db 2171864 libfsapfs_20240429.orig.tar.gz
 8ff52b12f8d994c1e368745b165a45a720cc2d41 5976 libfsapfs_20240429-1.debian.tar.xz
 97983395a47063179c730886a8beb44442b255d2 7713 libfsapfs_20240429-1_source.buildinfo
Checksums-Sha256:
 5f9f817ebeaa4767308aab670eaf9bfe887478ceb8880a2319a882ce517a54e5 2224 libfsapfs_20240429-1.dsc
 665f70705e69ce90c87e0f9c185d47002e242b79b0a37ae52751cdfa8363a538 2171864 libfsapfs_20240429.orig.tar.gz
 f1492d07ed0e7adaed795ef2043271a39d7ad8f60e898c6ea24978f282d8d463 5976 libfsapfs_20240429-1.debian.tar.xz
 55a15fe23a4652704fcb34068cf9b6c3c06480ecee29c0235041b5a6ec3ff2cc 7713 libfsapfs_20240429-1_source.buildinfo
Files:
 430e62c17ce1d42cb228859a4db19b02 2224 libs optional libfsapfs_20240429-1.dsc
 ab688e165848dea0865bf26f9193b255 2171864 libs optional libfsapfs_20240429.orig.tar.gz
 fdea6ed0a8267034f76279b59f5e6eb6 5976 libs optional libfsapfs_20240429-1.debian.tar.xz
 3f02e81f9e7d051ca988d6d0b3e250fe 7713 libs optional libfsapfs_20240429-1_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEErnMQVUQqHZbPTUx4dbcQY1whOn4FAmdv5h4ACgkQdbcQY1wh
On5l4w/+KVmuoIjGDSwj0SkfXwWuiKk7B7z582CNd3O+NONobCsQ/QZSF1Qrp2SQ
U8znx0gydDIOHPXoWoATfog5IlomD8oQzSg6jTyGacKvq8In2e9DJnlclCCt3XAC
xIkR0txuAQ5mGJHOWlfS1chRFNGBKAWeLMadIQ4UV+2vcQWMVxEY9+6oUa0cM3Rb
+8KexXHJc6a7XZd0l6lDPFAULTwq8Fb6DxN4S3o1tFaMIp9GN0rBs0Puc8kGvrSv
MuJTsXCkbwmH5ouLL7HKNEfLm5FfS5+wH1ifxqjxank3Tkbd0kRDGuRzJkoOoKld
fFsdo1f4BjSs9CHfvG8GXl5fKNaO8Bm09UbvaZAqRtPPzF3+LYwmR21myHhGSBzW
pUURumA1m4lOFiwcTe6XcYIhANq1r+OIOhM+iuqWa+Ym4VXC4kqbRX8/sX/72V6/
kQzQtj151+9yZ9RtEK1uLbI7jVAZb2DmHF/XsemWkjIGQ6ZNPIjd+1Z5W9DnBjp0
zW3/7GQ52DNjyPExq7F1y5ymD6wVM9kdip1XozsH/pNNJSXrPyjTV1RFe7qlK9vR
wojwcGDz1jlODYhIRLv8GskXBMvp7bNOWGmksvHq/ZqxQPgoP0YRAU7fHTnIJs6b
C2/EaV6TdpjUQXGsZFjhnGXMWxbtdjWJXKkUuAcngDW00QPLVnM=
=EH+1
-----END PGP SIGNATURE-----