Re: [PATCH] fs/binfmt_elf.c: allocate initialized memory in fill_thread_core_info()

2020-05-27 Thread Kees Cook
On Mon, Apr 20, 2020 at 03:41:40PM -0700, Kees Cook wrote: > On Mon, Apr 20, 2020 at 03:33:52PM -0700, Andrew Morton wrote: > > On Sun, 19 Apr 2020 12:08:48 +0200 gli...@google.com wrote: > > > > > KMSAN reported uninitialized data being written to disk when dumping > > > core. As a result,

Re: [PATCH] fs/binfmt_elf.c: allocate initialized memory in fill_thread_core_info()

2020-05-27 Thread Borislav Petkov
On Wed, May 27, 2020 at 08:53:03PM +0100, Al Viro wrote: > Either way would work - I was going to send it to Linus tonight and an > extra Acked-by: would be welcome. OTOH, if you would rather have all > x86-related patches go through x86 git... your subtree, your rules. Ok, here we go:

Re: [PATCH] fs/binfmt_elf.c: allocate initialized memory in fill_thread_core_info()

2020-05-27 Thread Al Viro
On Wed, May 27, 2020 at 09:04:56PM +0200, Borislav Petkov wrote: > On Tue, May 26, 2020 at 11:38:17PM +0100, Al Viro wrote: > > Folks, could you test the following? > > > > copy_xstate_to_kernel(): don't leave parts of destination uninitialized > > > > copy the corresponding pieces of

Re: [PATCH] fs/binfmt_elf.c: allocate initialized memory in fill_thread_core_info()

2020-05-27 Thread Borislav Petkov
On Tue, May 26, 2020 at 11:38:17PM +0100, Al Viro wrote: > Folks, could you test the following? > > copy_xstate_to_kernel(): don't leave parts of destination uninitialized > > copy the corresponding pieces of init_fpstate into the gaps instead. > > Signed-off-by: Al Viro Am I taking this

Re: [PATCH] fs/binfmt_elf.c: allocate initialized memory in fill_thread_core_info()

2020-05-27 Thread Alexander Potapenko
On Wed, May 27, 2020 at 12:38 AM Al Viro wrote: > > On Mon, May 25, 2020 at 12:45:35AM +0100, Al Viro wrote: > > On Wed, May 13, 2020 at 04:33:49AM +0100, Al Viro wrote: > > > > > FWIW, what I'm going to do is > > > * make all callers of copy_regset_to_user() pass 0 as pos > > > (there are

Re: [PATCH] fs/binfmt_elf.c: allocate initialized memory in fill_thread_core_info()

2020-05-26 Thread Al Viro
On Mon, May 25, 2020 at 12:45:35AM +0100, Al Viro wrote: > On Wed, May 13, 2020 at 04:33:49AM +0100, Al Viro wrote: > > > FWIW, what I'm going to do is > > * make all callers of copy_regset_to_user() pass 0 as pos > > (there are very few exceptions - one on arm64, three on sparc32 > > and

Re: [PATCH] fs/binfmt_elf.c: allocate initialized memory in fill_thread_core_info()

2020-05-24 Thread Al Viro
On Wed, May 13, 2020 at 04:33:49AM +0100, Al Viro wrote: > FWIW, what I'm going to do is > * make all callers of copy_regset_to_user() pass 0 as pos > (there are very few exceptions - one on arm64, three on sparc32 > and five on sparc64; I hadn't dealt with arm64 one yet, but all > cases on

Re: [PATCH] fs/binfmt_elf.c: allocate initialized memory in fill_thread_core_info()

2020-05-12 Thread Al Viro
On Tue, May 12, 2020 at 10:20:21AM +0200, Alexander Potapenko wrote: > On Tue, May 12, 2020 at 5:44 AM Al Viro wrote: > > > > On Tue, May 12, 2020 at 02:09:01AM +0100, Al Viro wrote: > > > On Tue, Apr 21, 2020 at 10:14:25AM +0200, Alexander Potapenko wrote: > > > > > Not lately and I would also

Re: [PATCH] fs/binfmt_elf.c: allocate initialized memory in fill_thread_core_info()

2020-05-11 Thread Al Viro
On Tue, May 12, 2020 at 02:09:01AM +0100, Al Viro wrote: > On Tue, Apr 21, 2020 at 10:14:25AM +0200, Alexander Potapenko wrote: > > > Not lately and I would also like to hear the details; which regset it is? > > > Should be reasonably easy to find - just memset() the damn thing to > > > something

Re: [PATCH] fs/binfmt_elf.c: allocate initialized memory in fill_thread_core_info()

2020-05-11 Thread Al Viro
On Tue, Apr 21, 2020 at 10:14:25AM +0200, Alexander Potapenko wrote: > > Not lately and I would also like to hear the details; which regset it is? > > Should be reasonably easy to find - just memset() the damn thing to > > something > > recognizable, do whatever triggers that KMSAN report and