# Re: \[PULL\] vhost: cleanups and fixes

- From: Linus Torvalds \<torvalds@linux-foundation.org\>
- Date: 2018-11-02 17:16:19 
- List: netdev
- Page: https://ratatoskr.run/netdev/2018/11/5422066
- Thread: https://ratatoskr.run/kvm/2018/11/5421560/t.md

```text
On Fri, Nov 2, 2018 at 10:10 AM Linus Torvalds
[ref] wrote:
>
> Don't you take over the VM with "use_mm()" when you do the copies? So
> yes, it's a kernel thread, but it has a user VM, and though that
> should have the user limits.

Oooh. *Just* as I sent this, I realized that "use_mm()" doesn't update
the thread addr_limit.

That actually looks like a bug to me - although one that you've
apparently been aware of and worked around.

Wouldn't it be nicer to just make "use_mm()" do

        set_fs(USER_DS);

instead? And undo it on unuse_mm()?

And, in fact, maybe we should default kernel threads to have a zero
address limit, so that they can't do any user accesses at all without
doing this?

Adding Al to the cc, because I think he's been looking at set_fs() in general.

                  Linus
```
