LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 0/2] avoid prepare_creds in faccessat when possible
@ 2015-03-09 20:35 Mateusz Guzik
  2015-03-09 20:35 ` [PATCH 1/2] CAPABILITIES: add cap_isequal helper Mateusz Guzik
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Mateusz Guzik @ 2015-03-09 20:35 UTC (permalink / raw)
  To: Alexander Viro, Serge Hallyn
  Cc: Paul Moore, Eric Paris, linux-fsdevel, linux-kernel,
	linux-security-module

Sometimes faccessat needs to modify current thread's credentials, but
calls prepare_creds unconditionally.

However, typically resulting credentials are identical to original ones
and in that case newcredentials are unnecessary. We can detect this before
allocating anything.

This patch series adds a helper which allows comparing capability sets and
modifies faccessat to use it.

Mateusz Guzik (2):
  CAPABILITIES: add cap_isequal helper
  fs: avoid unnecessary prepare_creds in faccessat

 fs/open.c                  | 53 ++++++++++++++++++++++++++++++----------------
 include/linux/capability.h | 10 +++++++++
 2 files changed, 45 insertions(+), 18 deletions(-)

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-03-13 16:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-09 20:35 [PATCH 0/2] avoid prepare_creds in faccessat when possible Mateusz Guzik
2015-03-09 20:35 ` [PATCH 1/2] CAPABILITIES: add cap_isequal helper Mateusz Guzik
2015-03-13 14:02   ` Paul Moore
2015-03-13 16:13     ` Mateusz Guzik
2015-03-09 20:35 ` [PATCH 2/2] fs: avoid unnecessary prepare_creds in faccessat Mateusz Guzik
2015-03-13 12:08 ` [PATCH 0/2] avoid prepare_creds in faccessat when possible Mateusz Guzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).