diff options
author | Kees Cook <keescook@chromium.org> | 2013-02-27 20:03:15 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-27 22:10:11 -0500 |
commit | e579d2c259be42b6f29458327e5153b22414b031 (patch) | |
tree | ac3babd0f075ddfeb5e6fa083651852b34a0a79f /fs/exec.c | |
parent | 5d1fadc1472396d602f0eeb10d37519e2a14e8bc (diff) |
coredump: remove redundant defines for dumpable states
The existing SUID_DUMP_* defines duplicate the newer SUID_DUMPABLE_*
defines introduced in 54b501992dd2 ("coredump: warn about unsafe
suid_dumpable / core_pattern combo"). Remove the new ones, and use the
prior values instead.
Signed-off-by: Kees Cook <keescook@chromium.org>
Reported-by: Chen Gang <gang.chen@asianux.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Alan Cox <alan@linux.intel.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Doug Ledford <dledford@redhat.com>
Cc: Serge Hallyn <serge.hallyn@canonical.com>
Cc: James Morris <james.l.morris@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/exec.c')
-rw-r--r-- | fs/exec.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1111,7 +1111,7 @@ void setup_new_exec(struct linux_binprm * bprm) | |||
1111 | current->sas_ss_sp = current->sas_ss_size = 0; | 1111 | current->sas_ss_sp = current->sas_ss_size = 0; |
1112 | 1112 | ||
1113 | if (uid_eq(current_euid(), current_uid()) && gid_eq(current_egid(), current_gid())) | 1113 | if (uid_eq(current_euid(), current_uid()) && gid_eq(current_egid(), current_gid())) |
1114 | set_dumpable(current->mm, SUID_DUMPABLE_ENABLED); | 1114 | set_dumpable(current->mm, SUID_DUMP_USER); |
1115 | else | 1115 | else |
1116 | set_dumpable(current->mm, suid_dumpable); | 1116 | set_dumpable(current->mm, suid_dumpable); |
1117 | 1117 | ||
@@ -1639,17 +1639,17 @@ EXPORT_SYMBOL(set_binfmt); | |||
1639 | void set_dumpable(struct mm_struct *mm, int value) | 1639 | void set_dumpable(struct mm_struct *mm, int value) |
1640 | { | 1640 | { |
1641 | switch (value) { | 1641 | switch (value) { |
1642 | case SUID_DUMPABLE_DISABLED: | 1642 | case SUID_DUMP_DISABLE: |
1643 | clear_bit(MMF_DUMPABLE, &mm->flags); | 1643 | clear_bit(MMF_DUMPABLE, &mm->flags); |
1644 | smp_wmb(); | 1644 | smp_wmb(); |
1645 | clear_bit(MMF_DUMP_SECURELY, &mm->flags); | 1645 | clear_bit(MMF_DUMP_SECURELY, &mm->flags); |
1646 | break; | 1646 | break; |
1647 | case SUID_DUMPABLE_ENABLED: | 1647 | case SUID_DUMP_USER: |
1648 | set_bit(MMF_DUMPABLE, &mm->flags); | 1648 | set_bit(MMF_DUMPABLE, &mm->flags); |
1649 | smp_wmb(); | 1649 | smp_wmb(); |
1650 | clear_bit(MMF_DUMP_SECURELY, &mm->flags); | 1650 | clear_bit(MMF_DUMP_SECURELY, &mm->flags); |
1651 | break; | 1651 | break; |
1652 | case SUID_DUMPABLE_SAFE: | 1652 | case SUID_DUMP_ROOT: |
1653 | set_bit(MMF_DUMP_SECURELY, &mm->flags); | 1653 | set_bit(MMF_DUMP_SECURELY, &mm->flags); |
1654 | smp_wmb(); | 1654 | smp_wmb(); |
1655 | set_bit(MMF_DUMPABLE, &mm->flags); | 1655 | set_bit(MMF_DUMPABLE, &mm->flags); |
@@ -1662,7 +1662,7 @@ int __get_dumpable(unsigned long mm_flags) | |||
1662 | int ret; | 1662 | int ret; |
1663 | 1663 | ||
1664 | ret = mm_flags & MMF_DUMPABLE_MASK; | 1664 | ret = mm_flags & MMF_DUMPABLE_MASK; |
1665 | return (ret > SUID_DUMPABLE_ENABLED) ? SUID_DUMPABLE_SAFE : ret; | 1665 | return (ret > SUID_DUMP_USER) ? SUID_DUMP_ROOT : ret; |
1666 | } | 1666 | } |
1667 | 1667 | ||
1668 | int get_dumpable(struct mm_struct *mm) | 1668 | int get_dumpable(struct mm_struct *mm) |