Mikulas Patocka
7f7efa30fa
dm-integrity: don't modify bio's immutable bio_vec in integrity_metadata()
...
commit b86f4b790c998afdbc88fe1aa55cfe89c4068726 upstream.
__bio_for_each_segment assumes that the first struct bio_vec argument
doesn't change - it calls "bio_advance_iter_single((bio), &(iter),
(bvl).bv_len)" to advance the iterator. Unfortunately, the dm-integrity
code changes the bio_vec with "bv.bv_len -= pos". When this code path
is taken, the iterator would be out of sync and dm-integrity would
report errors. This happens if the machine is out of memory and
"kmalloc" fails.
Fix this bug by making a copy of "bv" and changing the copy instead.
Fixes: 7eada909bf ("dm: add integrity target")
Cc: stable@vger.kernel.org # v4.12+
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com >
Signed-off-by: Mike Snitzer <snitzer@kernel.org >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-01-01 12:39:07 +00:00
..
2023-12-20 17:00:22 +01:00
2024-01-01 12:39:05 +00:00
2021-10-27 16:53:47 -04:00
2021-10-27 16:53:47 -04:00
2023-04-13 16:55:17 +02:00
2017-06-09 09:27:32 -06:00
2023-04-13 16:55:17 +02:00
2023-04-13 16:55:17 +02:00
2021-10-18 06:17:02 -06:00
2024-01-01 12:39:05 +00:00
2017-11-02 11:10:55 +01:00
2023-04-13 16:55:17 +02:00
2023-04-13 16:55:17 +02:00
2016-12-16 00:13:41 +02:00
2023-04-13 16:55:17 +02:00
2023-04-13 16:55:17 +02:00
2023-04-13 16:55:17 +02:00
2023-08-03 10:24:17 +02:00
2023-04-13 16:55:17 +02:00
2023-04-13 16:55:17 +02:00
2023-04-13 16:55:17 +02:00
2021-04-19 13:20:31 -04:00
2020-03-27 14:42:51 -04:00
2023-05-11 23:03:41 +09:00
2023-10-06 14:56:32 +02:00
2023-07-19 16:22:07 +02:00
2023-12-03 07:32:11 +01:00
2021-10-18 14:43:22 -06:00
2023-04-13 16:55:17 +02:00
2023-04-13 16:55:17 +02:00
2023-04-13 16:55:17 +02:00
2023-04-13 16:55:17 +02:00
2023-05-11 23:03:41 +09:00
2022-07-07 11:49:34 -04:00
2021-08-20 15:59:47 -04:00
2023-07-23 13:49:38 +02:00
2024-01-01 12:39:07 +00:00
2023-04-13 16:55:17 +02:00
2021-06-28 16:30:13 -04:00
2023-04-13 16:55:17 +02:00
2023-10-06 14:56:32 +02:00
2023-04-13 16:55:17 +02:00
2023-04-13 16:55:17 +02:00
2023-04-13 16:55:17 +02:00
2023-07-19 16:22:07 +02:00
2009-09-04 20:40:34 +01:00
2023-04-13 16:55:17 +02:00
2023-07-19 16:22:07 +02:00
2023-07-19 16:22:07 +02:00
2023-04-13 16:55:17 +02:00
2011-10-31 19:31:18 -04:00
2023-04-13 16:55:17 +02:00
2022-05-09 15:39:23 -04:00
2023-04-13 16:55:17 +02:00
2023-04-13 16:55:17 +02:00
2023-04-13 16:55:17 +02:00
2023-07-19 16:22:07 +02:00
2023-07-19 16:22:07 +02:00
2023-08-03 10:24:05 +02:00
2023-04-13 16:55:17 +02:00
2023-04-13 16:55:17 +02:00
2023-04-13 16:55:17 +02:00
2023-07-19 16:22:07 +02:00
2023-07-19 16:22:07 +02:00
2023-07-19 16:22:07 +02:00
2023-04-13 16:55:17 +02:00
2023-04-13 16:55:17 +02:00
2023-07-19 16:22:07 +02:00
2023-04-13 16:55:17 +02:00
2022-01-06 09:48:55 -05:00
2023-10-06 14:56:32 +02:00
2022-05-16 13:35:56 -07:00
2024-01-01 12:39:05 +00:00
2022-02-22 13:55:50 -05:00
2023-06-21 16:00:55 +02:00
2023-04-13 16:55:17 +02:00
2023-07-19 16:22:07 +02:00
2021-08-10 13:34:23 -04:00
2023-12-08 08:51:14 +01:00
2023-04-13 16:55:17 +02:00
2023-07-23 13:49:43 +02:00
2023-12-08 08:51:14 +01:00
2021-05-25 16:14:05 -04:00
2020-08-04 15:48:13 -04:00
2023-12-08 08:51:14 +01:00
2023-07-19 16:22:07 +02:00
2020-12-04 18:04:35 -05:00
2022-08-02 14:21:25 -07:00
2023-07-19 16:22:07 +02:00
2021-06-04 12:07:24 -04:00
2023-10-10 22:00:44 +02:00
2022-07-14 12:14:31 -06:00
2023-09-23 11:11:10 +02:00
2023-04-13 16:55:17 +02:00
2023-03-22 13:33:58 +01:00
2022-08-02 14:38:59 -07:00
2022-08-02 17:22:46 -06:00
2023-09-13 09:42:41 +02:00
2023-07-19 16:20:58 +02:00
2022-08-23 14:54:54 -05:00
2018-10-18 09:36:35 -07:00
2022-02-04 07:43:18 -07:00
2023-09-13 09:42:44 +02:00
2020-05-13 12:02:23 -07:00
2022-05-22 23:07:21 -07:00
2018-05-30 15:33:32 -06:00
2023-12-13 18:39:17 +01:00
2023-09-13 09:42:44 +02:00
2023-09-13 09:42:44 +02:00
2023-07-23 13:49:37 +02:00
2023-07-19 16:21:45 +02:00
2023-09-23 11:11:09 +02:00
2022-03-08 15:16:54 -08:00
2023-09-13 09:42:44 +02:00
2022-08-02 17:14:31 -06:00
2022-08-02 17:14:31 -06:00
2023-12-13 18:39:21 +01:00
2022-09-22 00:05:04 -07:00
2023-09-13 09:42:41 +02:00
2022-09-22 00:05:05 -07:00