Re: [git pull] coredump infoleak fix

From: Ingo Molnar
Date: Fri May 29 2020 - 05:35:40 EST



* Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:

> IOW, copy_xstate_to_kernel()/copy_xstate_to_user() needs not only to map
> from compacted format to standard one; it also needs to compensate for
> that "we might skip saving the components that are in init state; we'll
> report which ones got skipped by way of ->header.xfeatures" thing.
>
> Again, those leaked uninit chunks are *not* in the same places for all
> threads. Without any overflows, etc. involved. And at least for
> the set 0 (x87 registers) the init state is not all-zeroes, so blanket
> memset() done first is not going to give the right results.

I'm not arguing against your fix (at all!) and I'll pull it in for
v5.8 if Linus doesn't beat me to it.

I was arguing:

>> shouldn't we also zero-initialize the dump data

with emphasis on the 'also'. :-)

To me the biggest practical fail here was the exposure of genuinely
uninitialized data - not that the dumped information might not be a
100% semantically correct FPU dump.

[ Unless I'm missing some non-coredump aspect of all this (such as the
wrong saving done in signal handling context for example?), which is
always a possibility. ]

Thanks,

Ingo