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

Commit dd367069 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" into msm-4.14

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

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

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

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