]> git.ipfire.org Git - thirdparty/util-linux.git/commit
fincore: do not fall back to mincore if cachestat fails with EPERM
authorThomas Weißschuh <thomas@t-8ch.de>
Sat, 1 Nov 2025 13:58:34 +0000 (14:58 +0100)
committerThomas Weißschuh <thomas@t-8ch.de>
Sat, 1 Nov 2025 20:38:14 +0000 (21:38 +0100)
commit6cdbe06519ebc235c3d0fbb8e0092ffc8abf0ce6
tree99101dc5957058797f3bfa3ed053224da344261d
parent7492ca660b235cfea5cf78f1c3d5f0dc4e535545
fincore: do not fall back to mincore if cachestat fails with EPERM

cachestat() and mincore() both require that the tested file is
(potentially) writable by the current user. If this permission check
fails, cachestat() will return EPERM while mincore() will simply mark
all pages as resident in core, as a proper EPERM would violate its API
contract. But when cachestat() fails with EPERM we know that mincore()
will not return real data, so instead show an error message.

Reported-by: Christian Hesse <mail@eworm.de>
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
misc-utils/fincore.c