]> git.baikalelectronics.ru Git - kernel.git/commit
file caps: always start with clear bprm->caps_*
authorSerge Hallyn <serue@us.ibm.com>
Thu, 30 Oct 2008 16:52:23 +0000 (11:52 -0500)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 1 Nov 2008 16:49:45 +0000 (09:49 -0700)
commite2ee950dc4ede15b6056284789eaf425781f2f14
treeda0da58f10bcb7dd7a885f6032b46d1025af208b
parentf0793d3c79dd0ae1c6642d0d67e64a0d5fedc632
file caps: always start with clear bprm->caps_*

While Linux doesn't honor setuid on scripts.  However, it mistakenly
behaves differently for file capabilities.

This patch fixes that behavior by making sure that get_file_caps()
begins with empty bprm->caps_*.  That way when a script is loaded,
its bprm->caps_* may be filled when binfmt_misc calls prepare_binprm(),
but they will be cleared again when binfmt_elf calls prepare_binprm()
next to read the interpreter's file capabilities.

Signed-off-by: Serge Hallyn <serue@us.ibm.com>
Acked-by: David Howells <dhowells@redhat.com>
Acked-by: Andrew G. Morgan <morgan@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
security/commoncap.c