Re: [PATCH] mm/mincore: allow for making sys_mincore() privileged
From: Jiri Kosina
Date: Sat Jan 05 2019 - 15:12:38 EST
On Sat, 5 Jan 2019, Linus Torvalds wrote:
> > There are possibilities [1] how mincore() could be used as a converyor of
> > a sidechannel information about pagecache metadata.
>
> Can we please just limit it to vma's that are either anonymous, or map
> a file that the user actually owns?
>
> Then the capability check could be for "override the file owner check"
> instead, which makes tons of sense.
Makes sense.
I am still not completely sure what to return in such cases though; we can
either blatantly lie and always pretend that the pages are resident (to
avoid calling process entering some prefaulting mode), or return -ENOMEM
for mappings of files that don't belong to the user (in case it's not
CAP_SYS_ADMIN one).
--
Jiri Kosina
SUSE Labs