[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200427154050.e431ad7fb228610cc6b95973@linux-foundation.org>
Date: Mon, 27 Apr 2020 15:40:50 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Christoph Hellwig <hch@....de>
Cc: Alexander Viro <viro@...iv.linux.org.uk>,
Jeremy Kerr <jk@...abs.org>, Arnd Bergmann <arnd@...db.de>,
"Eric W . Biederman" <ebiederm@...ssion.com>,
linuxppc-dev@...ts.ozlabs.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH 2/7] signal: factor copy_siginfo_to_external32 from
copy_siginfo_to_user32
On Sun, 26 Apr 2020 09:40:39 +0200 Christoph Hellwig <hch@....de> wrote:
> On Sat, Apr 25, 2020 at 09:47:24PM -0700, Andrew Morton wrote:
> > I looked at fixing it but surely this sort of thing:
> >
> >
> > int copy_siginfo_to_user32(struct compat_siginfo __user *to,
> > const struct kernel_siginfo *from)
> > #if defined(CONFIG_X86_X32_ABI) || defined(CONFIG_IA32_EMULATION)
> > {
> > return __copy_siginfo_to_user32(to, from, in_x32_syscall());
> > }
> > int __copy_siginfo_to_user32(struct compat_siginfo __user *to,
> > const struct kernel_siginfo *from, bool x32_ABI)
> > #endif
> > {
> > ...
> >
> >
> > is too ugly to live?
>
> I fixed it up in my earlier versions, but Eric insisted to keep it,
> which is why I switched to his version given that he is the defacto
> signal.c maintainer.
>
> Here is what I would have preferred:
>
> https://www.spinics.net/lists/kernel/msg3473847.html
> https://www.spinics.net/lists/kernel/msg3473840.html
> https://www.spinics.net/lists/kernel/msg3473843.html
OK, but that doesn't necessitate the above monstrosity? How about
static int __copy_siginfo_to_user32(struct compat_siginfo __user *to,
const struct kernel_siginfo *from, bool x32_ABI)
{
struct compat_siginfo new;
copy_siginfo_to_external32(&new, from);
...
}
int copy_siginfo_to_user32(struct compat_siginfo __user *to,
const struct kernel_siginfo *from)
{
#if defined(CONFIG_X86_X32_ABI) || defined(CONFIG_IA32_EMULATION)
return __copy_siginfo_to_user32(to, from, in_x32_syscall());
#else
return __copy_siginfo_to_user32(to, from, 0);
#endif
}
Or something like that - I didn't try very hard. We know how to do
this stuff, and surely this thing isn't how!
Powered by blists - more mailing lists