]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
rtld: ignore fstatfs(2) errors when checking MNT_NOEXEC flag
authorKonstantin Belousov <kib@FreeBSD.org>
Sat, 6 Nov 2021 03:06:34 +0000 (05:06 +0200)
committerKonstantin Belousov <kib@FreeBSD.org>
Sat, 6 Nov 2021 04:40:17 +0000 (06:40 +0200)
commitc5637b8be8a5b6aaf663a58b0027f7f924d78b04
treeab480583f5009227d22867c7e4b6f08900875596
parent8363963a8f3fc8226b1e3aa627e2fdd09688704e
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
libexec/rtld-elf/rtld.c