aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Potapenko <glider@google.com>2020-05-14 13:40:13 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2020-05-14 13:40:13 +1000
commitaca969cacf07f41070d788ce2b8ca71f09d5207d (patch)
treef9a58b5aefbac3c8547e5fa68df80affa53d4673
parent32db14b6f43bd602e00abebde25340e1524be830 (diff)
downloadlinux-next-aca969cacf07f41070d788ce2b8ca71f09d5207d.tar.gz
fs/binfmt_elf.c: allocate initialized memory in fill_thread_core_info()
Notice: this object is not reachable from any branch.
KMSAN reported uninitialized data being written to disk when dumping core. As a result, several kilobytes of kmalloc memory may be written to the core file and then read by a non-privileged user. Link: http://lkml.kernel.org/r/20200419100848.63472-1-glider@google.com Link: https://github.com/google/kmsan/issues/76 Signed-off-by: Alexander Potapenko <glider@google.com> Reported-by: sam <sunhaoyl@outlook.com> Acked-by: Kees Cook <keescook@chromium.org> Cc: Alexey Dobriyan <adobriyan@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Notice: this object is not reachable from any branch.
-rw-r--r--fs/binfmt_elf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index fb76970290466..1a8b0c74f5b0c 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -1729,7 +1729,7 @@ static int fill_thread_core_info(struct elf_thread_core_info *t,
(!regset->active || regset->active(t->task, regset) > 0)) {
int ret;
size_t size = regset_size(t->task, regset);
- void *data = kmalloc(size, GFP_KERNEL);
+ void *data = kzalloc(size, GFP_KERNEL);
if (unlikely(!data))
return 0;
ret = regset->get(t->task, regset,