nfsrahead SIGBUS crash on aarch64 for non-NFS block devices

Ubahakwe Emeka <[email protected]>
Newsgroups gmane.linux.nfs
Message-ID <CAOBhB-TKRMtBPpXVhwu00h-vUJopZYzUnPkhAV6PWNoEDWz-mQ@mail.gmail.com>
nfsrahead crashes with SIGBUS on aarch64 when invoked by udev for
non-NFS block devices (virtio disks, loop devices, etc).

The udev rule 99-nfsrahead.rules fires for all block devices with no
filter for NFS-backed devices. nfsrahead is supposed to exit gracefully
for non-NFS devices but instead crashes in __libc_free() due to a
misaligned pointer — a hard fault on aarch64, silent on x86_64.

Stack trace:
#0  __libc_free (libc.so.6)
#1  nfsrahead + 0x2074
#2  __libc_start_main (libc.so.6)
#3  nfsrahead + 0x22f0

Triggered for: 254:0 (virtio disk), 7:1, 7:2 (loop devices)

Fix needed:
1. nfsrahead should detect non-NFS devices and exit 0 gracefully
2. Fix the misaligned pointer in the cleanup/exit path on aarch64
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.