[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200419080506.GD12222@lst.de>
Date: Sun, 19 Apr 2020 10:05:06 +0200
From: Christoph Hellwig <hch@....de>
To: Christophe Leroy <christophe.leroy@....fr>
Cc: "Eric W. Biederman" <ebiederm@...ssion.com>,
Christoph Hellwig <hch@....de>, Arnd Bergmann <arnd@...db.de>,
x86@...nel.org, linux-kernel@...r.kernel.org,
Alexander Viro <viro@...iv.linux.org.uk>,
linux-fsdevel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
linuxppc-dev@...ts.ozlabs.org, Jeremy Kerr <jk@...abs.org>
Subject: Re: [PATCH 1/2] signal: Factor copy_siginfo_to_external32 from
copy_siginfo_to_user32
On Sat, Apr 18, 2020 at 10:05:19AM +0200, Christophe Leroy wrote:
>
>
> Le 17/04/2020 à 23:09, Eric W. Biederman a écrit :
>>
>> To remove the use of set_fs in the coredump code there needs to be a
>> way to convert a kernel siginfo to a userspace compat siginfo.
>>
>> Call that function copy_siginfo_to_compat and factor it out of
>> copy_siginfo_to_user32.
>
> I find it a pitty to do that.
>
> The existing function could have been easily converted to using
> user_access_begin() + user_access_end() and use unsafe_put_user() to copy
> to userspace to avoid copying through a temporary structure on the stack.
>
> With your change, it becomes impossible to do that.
As Eric said we need a struct to clear all padding. Note that I
though about converting to unsafe_copy_to_user in my variant as we
can pretty easily do that if pre-filling the structure earlier. But
I didn't want to throw in such unrelated changes for now - I'll volunteer
to do it later, though.
Powered by blists - more mailing lists