Skip to content

Commit d7ffde3

Browse files
Jens Freimanndavem330
authored andcommitted
vhost: use USER_DS in vhost_worker thread
On some architectures address spaces are set up in a way that this is not necessary to work properly but on some others (like s390) it is. Make sure we operate on the user address space to allow copy_xxx_user() from the vhost_worker() thread by setting it explicitly before calling use_mm() and revert it after unuse_mm(). Signed-off-by: Jens Freimann <[email protected]> Signed-off-by: Christian Borntraeger <[email protected]> Acked-by: Michael S. Tsirkin <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 57efd44 commit d7ffde3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/vhost/vhost.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,9 @@ static int vhost_worker(void *data)
191191
struct vhost_dev *dev = data;
192192
struct vhost_work *work = NULL;
193193
unsigned uninitialized_var(seq);
194+
mm_segment_t oldfs = get_fs();
194195

196+
set_fs(USER_DS);
195197
use_mm(dev->mm);
196198

197199
for (;;) {
@@ -229,6 +231,7 @@ static int vhost_worker(void *data)
229231

230232
}
231233
unuse_mm(dev->mm);
234+
set_fs(oldfs);
232235
return 0;
233236
}
234237

0 commit comments

Comments
 (0)