Re: [kernel-hardening] Re: [PATCH v9 1/4] syscalls: Verify address limit before returning to user-mode
From: Al Viro
Date: Fri May 12 2017 - 03:18:52 EST
On Fri, May 12, 2017 at 09:00:12AM +0200, Ingo Molnar wrote:
> > How about trying to remove all of them? If we could actually get rid
> > of all of them, we could drop the arch support, and we'd get faster,
> > simpler, shorter uaccess code throughout the kernel.
>
> I'm all for that!
Oh, for... Ingo, do you really want to go through all ->write() and ->read()
instances, converting all of them to iov_iter? Or, better yet, deal with
the patch flood from Nick Krause sock puppet brigade?
Folks, seriously, have you even looked through that zoo? I have, and it's
really, really not fun. Sure, we can say "fuck 'em, no need to allow
splice() on random crap". Would be perfectly reasonable, expect that
it's not the only place doing kernel_write() and its ilk...
And converting everything to ->read_iter()/->write_iter() means an insane
amount of code churn, not to mention coping with random bogosities in
semantics. ->read() and ->write() are going to stay around, pretty
much indefinitely.