mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* + fs-binfmt_elfc-allocate-initialized-memory-in-fill_thread_core_info.patch added to -mm tree
@ 2020-04-20 22:34 akpm
  0 siblings, 0 replies; 2+ messages in thread
From: akpm @ 2020-04-20 22:34 UTC (permalink / raw)
  To: adobriyan, glider, keescook, mm-commits, stable, sunhaoyl


The patch titled
     Subject: fs/binfmt_elf.c: allocate initialized memory in fill_thread_core_info()
has been added to the -mm tree.  Its filename is
     fs-binfmt_elfc-allocate-initialized-memory-in-fill_thread_core_info.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/fs-binfmt_elfc-allocate-initialized-memory-in-fill_thread_core_info.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/fs-binfmt_elfc-allocate-initialized-memory-in-fill_thread_core_info.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Alexander Potapenko <glider@google.com>
Subject: fs/binfmt_elf.c: allocate initialized memory in fill_thread_core_info()

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>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/binfmt_elf.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/binfmt_elf.c~fs-binfmt_elfc-allocate-initialized-memory-in-fill_thread_core_info
+++ a/fs/binfmt_elf.c
@@ -1733,7 +1733,7 @@ static int fill_thread_core_info(struct
 		    (!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,
_

Patches currently in -mm which might be from glider@google.com are

fs-binfmt_elfc-allocate-initialized-memory-in-fill_thread_core_info.patch

^ permalink raw reply	[flat|nested] 2+ messages in thread

* + fs-binfmt_elfc-allocate-initialized-memory-in-fill_thread_core_info.patch added to -mm tree
@ 2020-04-20 22:32 akpm
  0 siblings, 0 replies; 2+ messages in thread
From: akpm @ 2020-04-20 22:32 UTC (permalink / raw)
  To: glider, mm-commits, sunhaoyl


The patch titled
     Subject: fs/binfmt_elf.c: allocate initialized memory in fill_thread_core_info()
has been added to the -mm tree.  Its filename is
     fs-binfmt_elfc-allocate-initialized-memory-in-fill_thread_core_info.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/fs-binfmt_elfc-allocate-initialized-memory-in-fill_thread_core_info.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/fs-binfmt_elfc-allocate-initialized-memory-in-fill_thread_core_info.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Alexander Potapenko <glider@google.com>
Subject: fs/binfmt_elf.c: allocate initialized memory in fill_thread_core_info()

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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/binfmt_elf.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/binfmt_elf.c~fs-binfmt_elfc-allocate-initialized-memory-in-fill_thread_core_info
+++ a/fs/binfmt_elf.c
@@ -1733,7 +1733,7 @@ static int fill_thread_core_info(struct
 		    (!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,
_

Patches currently in -mm which might be from glider@google.com are

fs-binfmt_elfc-allocate-initialized-memory-in-fill_thread_core_info.patch

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-20 22:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-20 22:34 + fs-binfmt_elfc-allocate-initialized-memory-in-fill_thread_core_info.patch added to -mm tree akpm
  -- strict thread matches above, loose matches on Subject: below --
2020-04-20 22:32 akpm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).