Add file_ns_capable() helper function for open-time capability checking

Nothing is using it yet, but this will allow us to delay the open-time
checks to use time, without breaking the normal UNIX permission
semantics where permissions are determined by the opener (and the file
descriptor can then be passed to a different process, or the process can
drop capabilities).

Issue: SEC-1716
Change-Id: Ib1d401f43052cbde6c6a55fddb5f89c5b8472bfd
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(adapted from commit 935d8aabd4331f47a89c3e1daa5779d23cf244ee)
2 files changed