Re: [PATCH] x86/fpu/xstate: Clear uninitialized xstate areas in core dump

2020-05-07 Thread Yu-cheng Yu
On Thu, 2020-05-07 at 20:22 +0200, Thomas Gleixner wrote: > Yu-cheng Yu writes: > > @@ -983,6 +983,7 @@ int copy_xstate_to_kernel(void *kbuf, struct > > xregs_state *xsave, unsigned int of > > { > > unsigned int offset, size; > > struct xstate_header header; > > + int last_off; > >

Re: [PATCH] x86/fpu/xstate: Clear uninitialized xstate areas in core dump

2020-05-07 Thread Thomas Gleixner
Yu-cheng Yu writes: > @@ -983,6 +983,7 @@ int copy_xstate_to_kernel(void *kbuf, struct xregs_state > *xsave, unsigned int of > { > unsigned int offset, size; > struct xstate_header header; > + int last_off; > int i; > > /* > @@ -1006,7 +1007,17 @@ int

Re: [PATCH] x86/fpu/xstate: Clear uninitialized xstate areas in core dump

2020-05-07 Thread Yu-cheng Yu
On Thu, 2020-05-07 at 09:52 -0700, Dave Hansen wrote: > On 5/7/20 9:49 AM, Yu-cheng Yu wrote: > > In a core dump, copy_xstate_to_kernel() copies only enabled user xfeatures > > to a kernel buffer without touching areas for disabled xfeatures. However, > > those uninitialized areas may contain

Re: [PATCH] x86/fpu/xstate: Clear uninitialized xstate areas in core dump

2020-05-07 Thread Yu-cheng Yu
On Thu, 2020-05-07 at 18:56 +0200, Sebastian Andrzej Siewior wrote: > On 2020-05-07 09:49:04 [-0700], Yu-cheng Yu wrote: > > In a core dump, copy_xstate_to_kernel() copies only enabled user xfeatures > > to a kernel buffer without touching areas for disabled xfeatures. However, > > those

Re: [PATCH] x86/fpu/xstate: Clear uninitialized xstate areas in core dump

2020-05-07 Thread Sebastian Andrzej Siewior
On 2020-05-07 09:49:04 [-0700], Yu-cheng Yu wrote: > In a core dump, copy_xstate_to_kernel() copies only enabled user xfeatures > to a kernel buffer without touching areas for disabled xfeatures. However, > those uninitialized areas may contain random data, which is then written to > the core

Re: [PATCH] x86/fpu/xstate: Clear uninitialized xstate areas in core dump

2020-05-07 Thread Dave Hansen
On 5/7/20 9:49 AM, Yu-cheng Yu wrote: > In a core dump, copy_xstate_to_kernel() copies only enabled user xfeatures > to a kernel buffer without touching areas for disabled xfeatures. However, > those uninitialized areas may contain random data, which is then written to > the core dump file and

[PATCH] x86/fpu/xstate: Clear uninitialized xstate areas in core dump

2020-05-07 Thread Yu-cheng Yu
In a core dump, copy_xstate_to_kernel() copies only enabled user xfeatures to a kernel buffer without touching areas for disabled xfeatures. However, those uninitialized areas may contain random data, which is then written to the core dump file and can be read by a non-privileged user. Fix it by