Because we resolve symlinks in userspace, fs.protected_symlinks doesn't
get applied by the kernel to our lookups. While it's not really clear
whether this is really necessary for scoped lookups, for consistency we
should just emulate may_follow_link().
Unfortunately, checking fs.protected_symlinks requires looking at
/proc/sys which can't be done with the currently-exposed ProcfsHandle
API so we have to create a private API for that (until we come up with a
nicer one for users to use). This also means that we can no longer apply
"subset=pid" to fsopen-based procfs handles.
Because we resolve symlinks in userspace, fs.protected_symlinks doesn't get applied by the kernel to our lookups. While it's not really clear whether this is really necessary for scoped lookups, for consistency we should just emulate may_follow_link().
Unfortunately, checking fs.protected_symlinks requires looking at /proc/sys which can't be done with the currently-exposed ProcfsHandle API so we have to create a private API for that (until we come up with a nicer one for users to use). This also means that we can no longer apply "subset=pid" to fsopen-based procfs handles.
Fixes #58 Signed-off-by: Aleksa Sarai cyphar@cyphar.com