HomeFreeBSD

rtld: ignore fstatfs(2) errors when checking MNT_NOEXEC flag

Description

rtld: ignore fstatfs(2) errors when checking MNT_NOEXEC flag

File descriptor we operate on might reference something that is not a
file, e.g. shmfd. In this case, we cannot check MNT_NOEXEC in
principle.

If fstatfs(2) caused some failure on normal filesystem, then typical
expectation is that read or mmap of this file would also fail. If not,
mmap(2) PROT_EXEC on MNT_NOEXEC filesystem returns EACCES.

Reported by: obiwac@gmail.com
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

Details

Provenance
kibAuthored on Nov 6 2021, 3:06 AM
Parents
rG8363963a8f3f: rtld: fix dangerous_ld_env calculation for ld_dynamic_weak
Branches
Unknown
Tags
Unknown