Revision 9c1c2b35f1d94de8325344c2777d7ee67492db3b authored by Jeff Layton on 03 April 2019, 17:16:01 UTC, committed by Ilya Dryomov on 21 January 2020, 18:02:37 UTC
Currently, we just assume that it will stick around by virtue of the
submitter's reference, but later patches will allow the syscall to
return early and we can't rely on that reference at that point.

While I'm not aware of any reports of it, Xiubo pointed out that this
may fix a use-after-free.  If the wait for a reply times out or is
canceled via signal, and then the reply comes in after the syscall
returns, the client can end up trying to access r_parent without a
reference.

Take an extra reference to the inode when setting r_parent and release
it when releasing the request.

Cc: stable@vger.kernel.org
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
1 parent def9d27
History
File Mode Size
cpu
syscalls
vsyscall
.gitignore -rw-r--r-- 12 bytes
Makefile -rw-r--r-- 1.6 KB
asm-offsets.c -rw-r--r-- 2.5 KB
crash_dump.c -rw-r--r-- 1.3 KB
debugtraps.S -rw-r--r-- 1018 bytes
disassemble.c -rw-r--r-- 18.5 KB
dma-coherent.c -rw-r--r-- 1.8 KB
dumpstack.c -rw-r--r-- 3.4 KB
dwarf.c -rw-r--r-- 29.1 KB
entry-common.S -rw-r--r-- 8.5 KB
ftrace.c -rw-r--r-- 10.0 KB
head_32.S -rw-r--r-- 8.3 KB
head_64.S -rw-r--r-- 9.0 KB
hw_breakpoint.c -rw-r--r-- 8.2 KB
idle.c -rw-r--r-- 984 bytes
io.c -rw-r--r-- 2.4 KB
io_trapped.c -rw-r--r-- 6.3 KB
iomap.c -rw-r--r-- 3.1 KB
ioport.c -rw-r--r-- 841 bytes
irq.c -rw-r--r-- 5.7 KB
irq_32.c -rw-r--r-- 1008 bytes
irq_64.c -rw-r--r-- 951 bytes
kdebugfs.c -rw-r--r-- 326 bytes
kgdb.c -rw-r--r-- 9.8 KB
kprobes.c -rw-r--r-- 13.3 KB
machine_kexec.c -rw-r--r-- 5.4 KB
machvec.c -rw-r--r-- 2.8 KB
module.c -rw-r--r-- 3.0 KB
nmi_debug.c -rw-r--r-- 1.5 KB
perf_callchain.c -rw-r--r-- 859 bytes
perf_event.c -rw-r--r-- 8.5 KB
process.c -rw-r--r-- 1.7 KB
process_32.c -rw-r--r-- 5.5 KB
process_64.c -rw-r--r-- 13.5 KB
ptrace.c -rw-r--r-- 1.0 KB
ptrace_32.c -rw-r--r-- 12.5 KB
ptrace_64.c -rw-r--r-- 13.9 KB
reboot.c -rw-r--r-- 1.8 KB
relocate_kernel.S -rw-r--r-- 4.0 KB
return_address.c -rw-r--r-- 901 bytes
setup.c -rw-r--r-- 8.7 KB
sh_bios.c -rw-r--r-- 3.8 KB
sh_ksyms_32.c -rw-r--r-- 2.8 KB
sh_ksyms_64.c -rw-r--r-- 1.3 KB
signal_32.c -rw-r--r-- 13.2 KB
signal_64.c -rw-r--r-- 15.9 KB
smp.c -rw-r--r-- 9.5 KB
stacktrace.c -rw-r--r-- 1.8 KB
swsusp.c -rw-r--r-- 711 bytes
sys_sh.c -rw-r--r-- 2.3 KB
sys_sh32.c -rw-r--r-- 1.5 KB
syscalls_32.S -rw-r--r-- 363 bytes
syscalls_64.S -rw-r--r-- 10.3 KB
time.c -rw-r--r-- 1.2 KB
topology.c -rw-r--r-- 1.6 KB
traps.c -rw-r--r-- 4.0 KB
traps_32.c -rw-r--r-- 18.2 KB
traps_64.c -rw-r--r-- 21.0 KB
unwinder.c -rw-r--r-- 4.2 KB
vmlinux.lds.S -rw-r--r-- 1.7 KB

back to top