Bug#891936: [Pkg-zfsonlinux-devel] Bug#891936: zfs-dkms: 32/64-bit detection via /proc/kallsyms is a bad idea
Hi, On Sat, Mar 3, 2018 at 2:52 AM, Fabian Grünbichlerwrote: > Package: zfs-dkms > Version: 0.7.6-1 > Severity: normal > > the zfs-dkms package tries to detect whether the (running) kernel is a > 32-bit or 64-bit one with the following stanza (in zfs-dkms.config / > zfs-dkms.postinst): > > $ head -1 /proc/kallsyms|awk '{print $1}'|wc -c > > and checking the length of the resulting string. > > if the check fails or reports a 32-bit kernel, the user is prompted via > debconf whether the build should be aborted. > > both the check and the resulting actions is wrong and should likely be > dropped altogether: > - kallsyms recently got more restrictive and does not print address for > all entries. the recent 4.15 kernel uploaded to sid has two lines > starting with " (null)" at the top, which breaks the check > - kallsyms might be disabled (in a custom kernel build) > - the running kernel is not necessarily the (only) one that dkms builds for > - ZFS supports 32-bit (although with a footnote about potential > address space related stability problems) > > if this check is still desired, it should probably be fixed and made > more smart and check the actual kernel sources that dkms will build > with. > I prefer to keep the check because 32-bit kernels are never first-class citizens in the world of ZFS, even if it builds and works at most cases. On conventional hardware (say, x86 workstations and servers), deliberately using a 32-bit kernel is rare; for other purposes user should evaluate the risks themselves before deciding on storage choice. Regards, Aron
Bug#891936: [zfs-dkms]
Control: tag -1 patch The most widespread symptom can be fixed with a little bit of grep hackery (patch attached). This fixes the "some/all lines starting with ' *(null)'" case, though I haven't tested this on any 32-bit machines (I don't have any). commit e56332bf68aa71e22e13f7294f7587a202c7b68a Author: Antonio RussoDate: Fri Mar 2 17:05:22 2018 -0500 Handle /proc/kallsym obfuscation diff --git a/debian/zfs-dkms.postinst b/debian/zfs-dkms.postinst index cb87e1ce..0ecb9674 100644 --- a/debian/zfs-dkms.postinst +++ b/debian/zfs-dkms.postinst @@ -6,7 +6,7 @@ set -e kernelbits=unknown if [ -r /proc/kallsyms ]; then - addrlen=$(head -1 /proc/kallsyms|awk '{print $1}'|wc -c) + addrlen=$(head -1 /proc/kallsyms| grep -o '^ *[^ ]*' |wc -c) if [ $addrlen = 17 ]; then kernelbits=64 elif [ $addrlen = 9 ]; then
Bug#891936: zfs-dkms: 32/64-bit detection via /proc/kallsyms is a bad idea
Package: zfs-dkms Version: 0.7.6-1 Severity: normal the zfs-dkms package tries to detect whether the (running) kernel is a 32-bit or 64-bit one with the following stanza (in zfs-dkms.config / zfs-dkms.postinst): $ head -1 /proc/kallsyms|awk '{print $1}'|wc -c and checking the length of the resulting string. if the check fails or reports a 32-bit kernel, the user is prompted via debconf whether the build should be aborted. both the check and the resulting actions is wrong and should likely be dropped altogether: - kallsyms recently got more restrictive and does not print address for all entries. the recent 4.15 kernel uploaded to sid has two lines starting with " (null)" at the top, which breaks the check - kallsyms might be disabled (in a custom kernel build) - the running kernel is not necessarily the (only) one that dkms builds for - ZFS supports 32-bit (although with a footnote about potential address space related stability problems) if this check is still desired, it should probably be fixed and made more smart and check the actual kernel sources that dkms will build with. -- System Information: Debian Release: buster/sid APT prefers unstable-debug APT policy: (500, 'unstable-debug'), (500, 'unstable'), (500, 'testing'), (500, 'stable') Architecture: amd64 (x86_64) Kernel: Linux 4.15.0-1-amd64 (SMP w/4 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled Versions of packages zfs-dkms depends on: ii debconf [debconf-2.0] 1.5.66 ii dkms 2.3-3 ii lsb-release9.20170808 ii spl-dkms 0.7.6-1 Versions of packages zfs-dkms recommends: ii linux-libc-dev 4.15.4-1 ii zfs-zed 0.7.6-1 ii zfsutils-linux 0.7.6-1 zfs-dkms suggests no packages. -- debconf information excluded To: sub...@bugs.debian.org Cc: Bcc: Subject: Reply-To: