linux-kernel-test/arch
Eric W. Biederman 84d77d3f06 ptrace: Don't allow accessing an undumpable mm
It is the reasonable expectation that if an executable file is not
readable there will be no way for a user without special privileges to
read the file.  This is enforced in ptrace_attach but if ptrace
is already attached before exec there is no enforcement for read-only
executables.

As the only way to read such an mm is through access_process_vm
spin a variant called ptrace_access_vm that will fail if the
target process is not being ptraced by the current process, or
the current process did not have sufficient privileges when ptracing
began to read the target processes mm.

In the ptrace implementations replace access_process_vm by
ptrace_access_vm.  There remain several ptrace sites that still use
access_process_vm as they are reading the target executables
instructions (for kernel consumption) or register stacks.  As such it
does not appear necessary to add a permission check to those calls.

This bug has always existed in Linux.

Fixes: v1.0
Cc: stable@vger.kernel.org
Reported-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2016-11-22 12:57:38 -06:00
..
alpha ptrace: Don't allow accessing an undumpable mm 2016-11-22 12:57:38 -06:00
arc ARC fixes for 4.9-rc5 2016-11-11 16:51:50 -08:00
arm Merge branch 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm 2016-11-20 10:27:39 -08:00
arm64 ARM: SoC fixes for v4.9-rc 2016-11-19 18:40:47 -08:00
avr32
blackfin ptrace: Don't allow accessing an undumpable mm 2016-11-22 12:57:38 -06:00
c6x
cris ptrace: Don't allow accessing an undumpable mm 2016-11-22 12:57:38 -06:00
frv
h8300 h8300: fix syscall restarting 2016-10-27 18:43:42 -07:00
hexagon
ia64 ptrace: Don't allow accessing an undumpable mm 2016-11-22 12:57:38 -06:00
m32r
m68k
metag
microblaze
mips ptrace: Don't allow accessing an undumpable mm 2016-11-22 12:57:38 -06:00
mn10300
nios2 nios2: fix timer initcall return value 2016-11-11 08:45:08 -08:00
openrisc openrisc: Define __ro_after_init to avoid crash 2016-11-06 08:01:12 -08:00
parisc parisc: Ignore the pkey system calls for now 2016-11-02 23:07:14 +01:00
powerpc ptrace: Don't allow accessing an undumpable mm 2016-11-22 12:57:38 -06:00
s390 Merge branch 'maybe-uninitialized' (patches from Arnd) 2016-11-11 10:03:01 -08:00
score
sh
sparc sparc64: Handle extremely large kernel TLB range flushes more gracefully. 2016-10-27 09:11:05 -07:00
tile tile: handle __ro_after_init like parisc does 2016-11-14 16:46:41 -05:00
um
unicore32
x86 KVM fixes for v4.9-rc6 2016-11-19 13:31:40 -08:00
xtensa xtensa: wire up new pkey_{mprotect,alloc,free} syscalls 2016-11-14 12:31:49 -08:00
.gitignore
Kconfig