|
Message-ID: <20180118163818.GB16649@infradead.org> Date: Thu, 18 Jan 2018 08:38:18 -0800 From: Christoph Hellwig <hch@...radead.org> To: Linus Torvalds <torvalds@...ux-foundation.org> Cc: Alan Cox <alan@...ux.intel.com>, Eric Dumazet <edumazet@...gle.com>, Dan Williams <dan.j.williams@...el.com>, Linux Kernel Mailing List <linux-kernel@...r.kernel.org>, linux-arch@...r.kernel.org, Andi Kleen <ak@...ux.intel.com>, Kees Cook <keescook@...omium.org>, kernel-hardening@...ts.openwall.com, Greg Kroah-Hartman <gregkh@...uxfoundation.org>, the arch/x86 maintainers <x86@...nel.org>, Ingo Molnar <mingo@...hat.com>, Al Viro <viro@...iv.linux.org.uk>, "H. Peter Anvin" <hpa@...or.com>, Thomas Gleixner <tglx@...utronix.de>, Andrew Morton <akpm@...ux-foundation.org> Subject: Re: [PATCH v3 8/9] x86: use __uaccess_begin_nospec and ASM_IFENCE in get_user paths On Wed, Jan 17, 2018 at 11:26:08AM -0800, Linus Torvalds wrote: > But there are about ~100 set_fs() calls in generic code, and some of > those really are pretty fundamental. Doing things like "kernel_read()" > without set_fs() is basically impossible. Not if we move to iov_iter or iov_iter-like behavior for all reads and writes. There is an issue with how vectored writes are handles in plain read/write vs read_iter/write_iter inherited from readv/writev, but that's nothing a flag, or a second set of methods with the same signature. But there are more annoying things, most notable in-kernel ioctls calls. We have quite a few of them, and while many are just utterly stupid and can be replaced with direct function calls or new methods (I've done quite a few conversions of those) some might be left. Something like iov_iter might be the answer again. Then we have things like probe_kernel_read/probe_kernel_write which abuse the exception handling in get/put user. But with a little arch helper we don't strictly need get_fs/set_fs for that.
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.