Al Viro
4228c037f8
fix short copy handling in copy_mc_pipe_to_iter()
...
commit c3497fd009ef2c59eea60d21c3ac22de3585ed7d upstream.
Unlike other copying operations on ITER_PIPE, copy_mc_to_iter() can
result in a short copy. In that case we need to trim the unused
buffers, as well as the length of partially filled one - it's not
enough to set ->head, ->iov_offset and ->count to reflect how
much had we copied. Not hard to fix, fortunately...
I'd put a helper (pipe_discard_from(pipe, head)) into pipe_fs_i.h,
rather than iov_iter.c - it has nothing to do with iov_iter and
having it will allow us to avoid an ugly kludge in fs/splice.c.
We could put it into lib/iov_iter.c for now and move it later,
but I don't see the point going that way...
Cc: stable@kernel.org # 4.19+
Fixes: ca146f6f09 "lib/iov_iter: Fix pipe handling in _copy_to_iter_mcsafe()"
Reviewed-by: Jeff Layton <jlayton@kernel.org >
Reviewed-by: Christian Brauner (Microsoft) <brauner@kernel.org >
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-08-17 14:22:51 +02:00
..
2022-06-22 14:22:03 +02:00
2022-05-18 10:26:49 +02:00
2021-07-08 11:48:20 -07:00
2022-06-09 10:22:53 +02:00
2022-04-13 20:59:21 +02:00
2021-09-08 11:50:26 -07:00
2022-01-27 11:03:58 +01:00
2021-07-08 11:48:20 -07:00
2022-04-08 14:23:56 +02:00
2021-07-08 11:48:20 -07:00
2021-04-14 23:04:44 +10:00
2021-11-18 19:16:17 +01:00
2021-09-24 16:13:35 -07:00
2021-07-01 11:06:05 -07:00
2021-05-02 00:43:35 +09:00
2021-07-08 11:48:20 -07:00
2022-06-06 08:43:37 +02:00
2021-05-26 13:20:50 +02:00
2021-05-06 19:24:12 -07:00
2021-08-13 10:27:50 +02:00
2021-09-14 13:23:22 -07:00
2021-04-01 09:54:37 +01:00
2021-07-08 11:48:22 -07:00
2021-06-23 16:41:41 -06:00
2021-05-05 16:07:40 +02:00
2021-05-06 19:24:12 -07:00
2021-06-05 08:58:12 -07:00
2021-08-19 09:02:55 +09:00
2021-06-22 13:56:43 +02:00
2021-08-13 10:07:44 +02:00
2021-07-01 11:06:05 -07:00
2021-07-01 11:06:06 -07:00
2021-05-06 19:24:12 -07:00
2021-07-01 11:06:06 -07:00
2021-11-18 19:16:17 +01:00
2021-07-01 11:06:05 -07:00
2021-08-13 14:09:32 -10:00
2021-07-08 11:48:20 -07:00
2021-09-08 11:50:26 -07:00
2021-11-18 19:16:52 +01:00
2021-04-16 16:10:37 -07:00
2021-05-06 19:24:12 -07:00
2021-05-06 19:24:12 -07:00
2022-05-09 09:14:30 +02:00
2022-07-12 16:35:18 +02:00
2022-08-17 14:22:51 +02:00
2021-08-19 09:02:55 +09:00
2022-06-22 14:22:03 +02:00
2022-05-30 09:29:16 +02:00
2021-09-24 16:13:34 -07:00
2021-07-20 13:49:44 -07:00
2021-11-12 15:05:49 +01:00
2022-04-13 20:59:27 +02:00
2021-07-08 11:48:20 -07:00
2021-04-10 11:09:41 +02:00
2021-07-02 12:08:10 -07:00
2021-05-19 15:05:11 +02:00
2021-08-13 18:37:38 +02:00
2021-07-08 11:48:20 -07:00
2022-06-09 10:23:31 +02:00
2021-06-22 16:42:08 +02:00
2022-04-13 20:58:59 +02:00
2021-04-16 16:10:37 -07:00
2022-06-22 14:22:03 +02:00
2022-06-22 14:22:03 +02:00
2021-07-08 11:48:20 -07:00
2021-11-25 09:48:45 +01:00
2022-06-14 18:36:24 +02:00
2021-07-08 11:48:20 -07:00
2021-08-08 13:00:20 +01:00
2021-09-17 13:52:17 +01:00
2021-04-16 16:10:37 -07:00
2021-07-01 11:06:05 -07:00
2021-09-19 17:13:35 -07:00
2021-05-06 19:24:12 -07:00
2022-06-06 08:43:36 +02:00
2021-04-16 16:10:37 -07:00
2022-05-30 09:29:10 +02:00
2021-07-08 11:48:20 -07:00
2021-07-08 11:48:20 -07:00
2021-07-08 11:48:20 -07:00
2021-09-03 10:08:28 -07:00
2021-07-08 11:48:20 -07:00
2021-08-24 19:52:40 -03:00
2022-05-30 09:28:59 +02:00
2022-05-30 09:29:15 +02:00
2021-06-29 10:53:46 -07:00
2021-05-19 10:51:40 +02:00
2021-07-08 11:48:20 -07:00
2022-04-13 20:59:28 +02:00
2021-11-21 13:44:12 +01:00
2021-08-30 07:50:56 -07:00
2021-06-18 11:43:09 +02:00
2021-08-13 10:27:49 +02:00
2021-07-08 11:48:20 -07:00
2021-11-18 19:16:26 +01:00
2021-05-13 16:14:45 +02:00
2021-07-01 11:06:03 -07:00
2022-01-27 11:05:43 +01:00
2021-09-03 09:58:15 -07:00
2021-09-03 10:08:28 -07:00
2022-04-08 14:23:54 +02:00
2021-06-25 11:31:03 -06:00
2022-04-08 14:24:01 +02:00
2022-01-27 11:05:44 +01:00
2021-09-08 12:55:35 -07:00
2021-09-06 11:04:03 -07:00
2021-09-08 11:50:26 -07:00
2021-08-22 00:21:36 -07:00
2021-07-01 11:06:05 -07:00
2022-04-13 20:59:27 +02:00
2021-09-03 09:58:14 -07:00
2022-04-08 14:24:09 +02:00
2021-07-19 11:39:28 +02:00
2021-08-13 13:19:06 -06:00
2022-05-30 09:29:10 +02:00
2022-04-08 14:24:09 +02:00