Go to file
Willy Tarreau 3824d119cb lib/syscall: fix syscall registers retrieval on 32-bit platforms
commit 4f134b89a24b965991e7c345b9a4591821f7c2a6 upstream.

Lilith >_> and Claudio Bozzato of Cisco Talos security team reported
that collect_syscall() improperly casts the syscall registers to 64-bit
values leaking the uninitialized last 24 bytes on 32-bit platforms, that
are visible in /proc/self/syscall.

The cause is that info->data.args are u64 while syscall_get_arguments()
uses longs, as hinted by the bogus pointer cast in the function.

Let's just proceed like the other call places, by retrieving the
registers into an array of longs before assigning them to the caller's
array.  This was successfully tested on x86_64, i386 and ppc32.

Reference: CVE-2020-28588, TALOS-2020-1211
Fixes: 631b7abacd02 ("ptrace: Remove maxargs from task_current_syscall()")
Cc: Greg KH <greg@kroah.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Tested-by: Michael Ellerman <mpe@ellerman.id.au> (ppc32)
Signed-off-by: Willy Tarreau <w@1wt.eu>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-16 16:42:06 +08:00
Documentation dt-bindings: net: correct interrupt flags in examples 2021-03-16 16:41:54 +08:00
LICENSES Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
arch x86/uprobes: Do not use prefixes.nbytes when looping over prefixes.bytes 2021-03-16 16:42:04 +08:00
block blk-cgroup: Pre-allocate tree node on blkg_conf_prep 2021-03-16 16:40:25 +08:00
certs Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
crypto crypto: algif_skcipher - EBUSY on aio should be an error 2021-03-16 16:38:24 +08:00
drivers iommu/amd: Set DTE[IntTabLen] to represent 512 IRTEs 2021-03-16 16:42:06 +08:00
fs coredump: fix core_pattern parse error 2021-03-16 16:42:04 +08:00
include genirq/irqdomain: Add an irq_create_mapping_affinity() function 2021-03-16 16:42:03 +08:00
init printk: reduce LOG_BUF_SHIFT range for H8300 2021-03-16 16:39:45 +08:00
ipc ipc/util.c: sysvipc_find_ipc() incorrectly updates position index 2021-03-16 16:27:51 +08:00
kernel tracing: Fix userstacktrace option for instances 2021-03-16 16:42:06 +08:00
lib lib/syscall: fix syscall registers retrieval on 32-bit platforms 2021-03-16 16:42:06 +08:00
mm mm/swapfile: do not sleep with a spin lock held 2021-03-16 16:42:05 +08:00
net net/sched: act_mpls: ensure LSE is pullable before reading it 2021-03-16 16:41:57 +08:00
package config/arm64: OPEN CONFIG_PSI and phytium configs 2021-03-16 11:02:59 +08:00
samples samples/bpf: Fix possible deadlock in xdpsock 2021-03-16 16:39:46 +08:00
scripts scripts/setlocalversion: make git describe output more reliable 2021-03-16 16:39:28 +08:00
security ima: extend boot_aggregate with kernel measurements 2021-03-16 16:41:53 +08:00
sound ALSA: hda/generic: Add option to enforce preferred_dacs pairs 2021-03-16 16:42:02 +08:00
tools x86/uprobes: Do not use prefixes.nbytes when looping over prefixes.bytes 2021-03-16 16:42:04 +08:00
usr Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
virt KVM: arm64: vgic-v3: Drop the reporting of GICR_TYPER.Last for userspace 2021-03-16 16:41:35 +08:00
.clang-format Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
.cocciconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
.get_maintainer.ignore Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
.gitattributes Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
.gitignore Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
COPYING Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
CREDITS Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Kbuild Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Kconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
MAINTAINERS Documentation/llvm: add documentation on building w/ Clang/LLVM 2021-03-16 16:34:24 +08:00
Makefile kbuild: fix broken builds because of GZIP,BZIP2,LZOP variables 2021-03-16 16:35:20 +08:00
README Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
README.md Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
backport_remove_lists.txt Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
tools_key.pub Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00

README.md

Tencent Linux Kernel 4.0