rev |
line source |
pascal@15676
|
1 https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=4004afd5f51ad0a86be405522b1ecf28ba66f4e5
|
pascal@15676
|
2 --- linux-3.2.53/arch/ia64/include/asm/processor.h
|
pascal@15676
|
3 +++ linux-3.2.53/arch/ia64/include/asm/processor.h
|
pascal@15676
|
4 @@ -320,7 +320,7 @@
|
pascal@15676
|
5 regs->loadrs = 0; \
|
pascal@15676
|
6 regs->r8 = get_dumpable(current->mm); /* set "don't zap registers" flag */ \
|
pascal@15676
|
7 regs->r12 = new_sp - 16; /* allocate 16 byte scratch area */ \
|
pascal@15676
|
8 - if (unlikely(!get_dumpable(current->mm))) { \
|
pascal@15676
|
9 + if (unlikely(get_dumpable(current->mm) != SUID_DUMP_USER)) { \
|
pascal@15676
|
10 /* \
|
pascal@15676
|
11 * Zap scratch regs to avoid leaking bits between processes with different \
|
pascal@15676
|
12 * uid/privileges. \
|
pascal@15676
|
13 --- linux-3.2.53/include/linux/binfmts.h
|
pascal@15676
|
14 +++ linux-3.2.53/include/linux/binfmts.h
|
pascal@15676
|
15 @@ -112,9 +112,6 @@
|
pascal@15676
|
16 extern void would_dump(struct linux_binprm *, struct file *);
|
pascal@15676
|
17
|
pascal@15676
|
18 extern int suid_dumpable;
|
pascal@15676
|
19 -#define SUID_DUMP_DISABLE 0 /* No setuid dumping */
|
pascal@15676
|
20 -#define SUID_DUMP_USER 1 /* Dump as user of process */
|
pascal@15676
|
21 -#define SUID_DUMP_ROOT 2 /* Dump as root */
|
pascal@15676
|
22
|
pascal@15676
|
23 /* Stack area protections */
|
pascal@15676
|
24 #define EXSTACK_DEFAULT 0 /* Whatever the arch defaults to */
|
pascal@15676
|
25 --- linux-3.2.53/include/linux/sched.h
|
pascal@15676
|
26 +++ linux-3.2.53/include/linux/sched.h
|
pascal@15676
|
27 @@ -402,6 +402,9 @@
|
pascal@15676
|
28
|
pascal@15676
|
29 extern void set_dumpable(struct mm_struct *mm, int value);
|
pascal@15676
|
30 extern int get_dumpable(struct mm_struct *mm);
|
pascal@15676
|
31 +#define SUID_DUMP_DISABLE 0 /* No setuid dumping */
|
pascal@15676
|
32 +#define SUID_DUMP_USER 1 /* Dump as user of process */
|
pascal@15676
|
33 +#define SUID_DUMP_ROOT 2 /* Dump as root */
|
pascal@15676
|
34
|
pascal@15676
|
35 /* mm flags */
|
pascal@15676
|
36 /* dumpable bits */
|
pascal@15676
|
37 --- linux-3.2.53/kernel/ptrace.c
|
pascal@15676
|
38 +++ linux-3.2.53/kernel/ptrace.c
|
pascal@15676
|
39 @@ -246,7 +246,7 @@
|
pascal@15676
|
40 smp_rmb();
|
pascal@15676
|
41 if (task->mm)
|
pascal@15676
|
42 dumpable = get_dumpable(task->mm);
|
pascal@15676
|
43 - if (!dumpable && !task_ns_capable(task, CAP_SYS_PTRACE))
|
pascal@15676
|
44 + if (dumpable != SUID_DUMP_USER && !task_ns_capable(task, CAP_SYS_PTRACE))
|
pascal@15676
|
45 return -EPERM;
|
pascal@15676
|
46
|
pascal@15676
|
47 return security_ptrace_access_check(task, mode);
|