diff options
author | Kawai, Hidehiro <hidehiro.kawai.ez@hitachi.com> | 2007-07-19 04:48:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-19 13:04:46 -0400 |
commit | 6c5d523826dc639df709ed0f88c5d2ce25379652 (patch) | |
tree | ef2fa8cb30266b3a9b047902794e78c583b099da /security | |
parent | 76fdbb25f963de5dc1e308325f0578a2f92b1c2d (diff) |
coredump masking: reimplementation of dumpable using two flags
This patch changes mm_struct.dumpable to a pair of bit flags.
set_dumpable() converts three-value dumpable to two flags and stores it into
lower two bits of mm_struct.flags instead of mm_struct.dumpable.
get_dumpable() behaves in the opposite way.
[akpm@linux-foundation.org: export set_dumpable]
Signed-off-by: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: David Howells <dhowells@redhat.com>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'security')
-rw-r--r-- | security/commoncap.c | 2 | ||||
-rw-r--r-- | security/dummy.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/security/commoncap.c b/security/commoncap.c index 384379ede4fd..338606eb7238 100644 --- a/security/commoncap.c +++ b/security/commoncap.c | |||
@@ -148,7 +148,7 @@ void cap_bprm_apply_creds (struct linux_binprm *bprm, int unsafe) | |||
148 | 148 | ||
149 | if (bprm->e_uid != current->uid || bprm->e_gid != current->gid || | 149 | if (bprm->e_uid != current->uid || bprm->e_gid != current->gid || |
150 | !cap_issubset (new_permitted, current->cap_permitted)) { | 150 | !cap_issubset (new_permitted, current->cap_permitted)) { |
151 | current->mm->dumpable = suid_dumpable; | 151 | set_dumpable(current->mm, suid_dumpable); |
152 | 152 | ||
153 | if (unsafe & ~LSM_UNSAFE_PTRACE_CAP) { | 153 | if (unsafe & ~LSM_UNSAFE_PTRACE_CAP) { |
154 | if (!capable(CAP_SETUID)) { | 154 | if (!capable(CAP_SETUID)) { |
diff --git a/security/dummy.c b/security/dummy.c index d6a112ce2975..19d813d5e083 100644 --- a/security/dummy.c +++ b/security/dummy.c | |||
@@ -130,7 +130,7 @@ static void dummy_bprm_free_security (struct linux_binprm *bprm) | |||
130 | static void dummy_bprm_apply_creds (struct linux_binprm *bprm, int unsafe) | 130 | static void dummy_bprm_apply_creds (struct linux_binprm *bprm, int unsafe) |
131 | { | 131 | { |
132 | if (bprm->e_uid != current->uid || bprm->e_gid != current->gid) { | 132 | if (bprm->e_uid != current->uid || bprm->e_gid != current->gid) { |
133 | current->mm->dumpable = suid_dumpable; | 133 | set_dumpable(current->mm, suid_dumpable); |
134 | 134 | ||
135 | if ((unsafe & ~LSM_UNSAFE_PTRACE_CAP) && !capable(CAP_SETUID)) { | 135 | if ((unsafe & ~LSM_UNSAFE_PTRACE_CAP) && !capable(CAP_SETUID)) { |
136 | bprm->e_uid = current->uid; | 136 | bprm->e_uid = current->uid; |