alistair23-linux/arch/ia64
Kees Cook d049f74f2d exec/ptrace: fix get_dumpable() incorrect tests
The get_dumpable() return value is not boolean.  Most users of the
function actually want to be testing for non-SUID_DUMP_USER(1) rather than
SUID_DUMP_DISABLE(0).  The SUID_DUMP_ROOT(2) is also considered a
protected state.  Almost all places did this correctly, excepting the two
places fixed in this patch.

Wrong logic:
    if (dumpable == SUID_DUMP_DISABLE) { /* be protective */ }
        or
    if (dumpable == 0) { /* be protective */ }
        or
    if (!dumpable) { /* be protective */ }

Correct logic:
    if (dumpable != SUID_DUMP_USER) { /* be protective */ }
        or
    if (dumpable != 1) { /* be protective */ }

Without this patch, if the system had set the sysctl fs/suid_dumpable=2, a
user was able to ptrace attach to processes that had dropped privileges to
that user.  (This may have been partially mitigated if Yama was enabled.)

The macros have been moved into the file that declares get/set_dumpable(),
which means things like the ia64 code can see them too.

CVE-2013-2929

Reported-by: Vasily Kulikov <segoon@openwall.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-11-13 12:09:33 +09:00
..
configs PCI: hotplug: Convert to be builtin only, not modular 2013-07-25 14:11:06 -06:00
dig
hp Add some casts to avoid warnings from efi_runtime_services_t members. 2013-07-10 10:09:04 -07:00
include exec/ptrace: fix get_dumpable() incorrect tests 2013-11-13 12:09:33 +09:00
kernel Merge branch 'x86-mce-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-11-12 11:16:44 +09:00
kvm KVM: Introduce kvm_arch_memslots_updated() 2013-07-18 12:29:25 +02:00
lib
mm mm: use pgdat_end_pfn() to simplify the code in arch 2013-11-13 12:09:03 +09:00
oprofile
pci PCI: Replace printks with appropriate pr_*() 2013-06-18 09:49:23 -07:00
scripts
sn PCI changes for the v3.11 merge window: 2013-07-03 16:31:35 -07:00
uv
xen [IA64] Delete __cpuinit usage from all ia64 users 2013-06-24 15:44:27 -07:00
install.sh
Kconfig Remove GENERIC_HARDIRQ config option 2013-09-13 15:09:52 +02:00
Kconfig.debug
Makefile
module.lds