This change allows to pick code paths in the kernel that are tuned for
alignment sensitive (and stricted in C meaning) code paths. In particular
the IPv6 code uses this heavily and skips whenever possible the process
of aligning of networking data.
With this modification all ATF tests are executed on amd64 without
triggering any UBSan reports in dmesg.
In theory __NO_STRICT_ALIGNMENT could be tuned for vax and m68k, however
these machines are still unsupported in LLVM sanitizers and syzkaller.
sys/netinet6/scope6.c:404:6, member access within misaligned address 0xfffffaea81276086 for type 'struct in6_addr' which requires 4 byte alignment
Reported-by: syzbot+a86f58d17685317b3df9@syzkaller.appspotmail.com
sys/net/rtsock_shared.c:629:41, member access within misaligned address 0xffffddb5db3ff04c for type 'struct rt_msghdr50' which requires 8 byte alignment
Reported-by: syzbot+0a3a022bc9d2b8880c16@syzkaller.appspotmail.com
breaks for some setups which lack it (netbsd<8, possibly other things).
Use the compiler targetting netbsd that uses netbsd headers to figure out
PACKAGE_VERSION to avoid this problem.
and kms messages, eliding the vblank, atomic and prime messages,
which are the truly noisy ones (and may result in impossibly slow
to use systems.)
XXX: pullup-all.
__has_feature(leak_sanitizer) was merged with Clang/LLVM today:
https://reviews.llvm.org/D67719
GCC specific ifdef __SANITIZE_LEAK__ is pending in upstream review...
https://gcc.gnu.org/ml/gcc-patches/2019-09/msg01270.html and can be
rejected as GCC upstream does not see value in feature parity with LLVM
sanitizers. For the time being this will be a NetBSD specific extension.
Today GCC/Clang allow to specify typedef char[] with the dynamic VLA
property (as introduced in C99). This means that __CTASSERT(), when
misused with run-time semantics, was a dummy check generating either
1 or -1 size of typedef char[].
It was caught in runtime by kUBSan as -1 is size of VLA with unspecified
semantics in runtime (Undefined Behavior).
Use bit-field to enforce compile-time constant.
This approach has been inspired by the Perl variation of static_assert().
The new member is caled f_mntfromlabel and it is the dkw_wname
of the corresponding wedge. This is now used by df -W to display
the mountpoint name as NAME=
by /sbin/{zfs,zpool,mount_zfs}. The general effect is to move them
from /usr/lib to /lib. Compatibility links are installed in /usr/lib
and nothing that is installed, say in /usr/pkg, appears to break.
With this, it is possible to have a /var and /usr mount using ZFS
legacy mounting early on in the boot process.
Run tested on amd64 and i386 and compile tested on evbarm.