Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a97385c authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: ffs: Execute copy_to_user() with USER_DS set"

parents f60412e8 d85f74fc
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -871,9 +871,13 @@ static void ffs_user_copy_worker(struct work_struct *work)
	ffs_log("enter: ret %d", ret);
	ffs_log("enter: ret %d", ret);


	if (io_data->read && ret > 0) {
	if (io_data->read && ret > 0) {
		mm_segment_t oldfs = get_fs();

		set_fs(USER_DS);
		use_mm(io_data->mm);
		use_mm(io_data->mm);
		ret = ffs_copy_to_iter(io_data->buf, ret, &io_data->data);
		ret = ffs_copy_to_iter(io_data->buf, ret, &io_data->data);
		unuse_mm(io_data->mm);
		unuse_mm(io_data->mm);
		set_fs(oldfs);
	}
	}


	io_data->kiocb->ki_complete(io_data->kiocb, ret, ret);
	io_data->kiocb->ki_complete(io_data->kiocb, ret, ret);