[PATCH 3/3] kernel: set USER_DS in kthread_use_mm

Greg KH greg at kroah.com
Thu Apr 16 06:43:11 UTC 2020


On Thu, Apr 16, 2020 at 07:31:58AM +0200, Christoph Hellwig wrote:
> Some architectures like arm64 and s390 require USER_DS to be set for
> kernel threads to access user address space, which is the whole purpose
> of kthread_use_mm, but other like x86 don't.  That has lead to a huge
> mess where some callers are fixed up once they are tested on said
> architectures, while others linger around and yet other like io_uring
> try to do "clever" optimizations for what usually is just a trivial
> asignment to a member in the thread_struct for most architectures.
> 
> Make kthread_use_mm set USER_DS, and kthread_unuse_mm restore to the
> previous value instead.
> 
> Signed-off-by: Christoph Hellwig <hch at lst.de>
> Acked-by: Michael S. Tsirkin <mst at redhat.com> [vhost]
> ---

Acked-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org> [usb]


More information about the amd-gfx mailing list