linux-stable/drivers/md
Mikulas Patocka 0a9bab391e dm-crypt, dm-verity: disable tasklets
Tasklets have an inherent problem with memory corruption. The function
tasklet_action_common calls tasklet_trylock, then it calls the tasklet
callback and then it calls tasklet_unlock. If the tasklet callback frees
the structure that contains the tasklet or if it calls some code that may
free it, tasklet_unlock will write into free memory.

The commits 8e14f61015 and d9a02e016a try to fix it for dm-crypt, but
it is not a sufficient fix and the data corruption can still happen [1].
There is no fix for dm-verity and dm-verity will write into free memory
with every tasklet-processed bio.

There will be atomic workqueues implemented in the kernel 6.9 [2]. They
will have better interface and they will not suffer from the memory
corruption problem.

But we need something that stops the memory corruption now and that can be
backported to the stable kernels. So, I'm proposing this commit that
disables tasklets in both dm-crypt and dm-verity. This commit doesn't
remove the tasklet support, because the tasklet code will be reused when
atomic workqueues will be implemented.

[1] https://lore.kernel.org/all/d390d7ee-f142-44d3-822a-87949e14608b@suse.de/T/
[2] https://lore.kernel.org/lkml/20240130091300.2968534-1-tj@kernel.org/

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
Fixes: 39d42fa96b ("dm crypt: add flags to optionally bypass kcryptd workqueues")
Fixes: 5721d4e5a9 ("dm verity: Add optional "try_verify_in_tasklet" feature")
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
2024-02-02 12:33:50 -05:00
..
bcache for-6.8/block-2024-01-08 2024-01-11 13:58:04 -08:00
persistent-data
dm-audit.c
dm-audit.h
dm-bio-prison-v1.c
dm-bio-prison-v1.h
dm-bio-prison-v2.c
dm-bio-prison-v2.h
dm-bio-record.h
dm-bufio.c mm, treewide: rename MAX_ORDER to MAX_PAGE_ORDER 2024-01-08 15:27:15 -08:00
dm-builtin.c
dm-cache-background-tracker.c
dm-cache-background-tracker.h
dm-cache-block-types.h
dm-cache-metadata.c Many singleton patches against the MM code. The patch series which are 2023-11-02 19:38:47 -10:00
dm-cache-metadata.h
dm-cache-policy-internal.h
dm-cache-policy-smq.c
dm-cache-policy.c
dm-cache-policy.h
dm-cache-target.c
dm-clone-metadata.c
dm-clone-metadata.h
dm-clone-target.c
dm-core.h dm: limit the number of targets and parameter size area 2024-01-30 14:05:02 -05:00
dm-crypt.c dm-crypt, dm-verity: disable tasklets 2024-02-02 12:33:50 -05:00
dm-delay.c dm-delay: avoid duplicate logic 2023-11-17 14:41:14 -05:00
dm-dust.c
dm-ebs-target.c
dm-era-target.c
dm-exception-store.c
dm-exception-store.h
dm-flakey.c mm, treewide: rename MAX_ORDER to MAX_PAGE_ORDER 2024-01-08 15:27:15 -08:00
dm-ima.c
dm-ima.h
dm-init.c
dm-integrity.c dm-integrity: don't modify bio's immutable bio_vec in integrity_metadata() 2023-12-18 13:11:05 -05:00
dm-io-rewind.c
dm-io-tracker.h
dm-io.c
dm-ioctl.c dm: limit the number of targets and parameter size area 2024-01-30 14:05:02 -05:00
dm-kcopyd.c block: remove support for the host aware zone model 2023-12-19 20:17:43 -07:00
dm-linear.c
dm-log-userspace-base.c dm log userspace: replace deprecated strncpy with strscpy 2023-10-23 13:02:48 -04:00
dm-log-userspace-transfer.c
dm-log-userspace-transfer.h
dm-log-writes.c
dm-log.c
dm-mpath.c
dm-mpath.h
dm-path-selector.c
dm-path-selector.h
dm-ps-historical-service-time.c
dm-ps-io-affinity.c
dm-ps-queue-length.c
dm-ps-round-robin.c
dm-ps-service-time.c
dm-raid.c dm-raid: delay flushing event_work() after reconfig_mutex is released 2023-12-18 13:05:21 -05:00
dm-raid1.c
dm-region-hash.c
dm-rq.c
dm-rq.h
dm-snap-persistent.c
dm-snap-transient.c
dm-snap.c
dm-stats.c dm stats: limit the number of entries 2024-01-30 14:06:44 -05:00
dm-stats.h
dm-stripe.c - Update DM core to directly call the map function for both the linear 2023-11-01 12:55:54 -10:00
dm-switch.c
dm-sysfs.c
dm-table.c dm: limit the number of targets and parameter size area 2024-01-30 14:05:02 -05:00
dm-target.c dm error: Add support for zoned block devices 2023-10-31 11:06:21 -04:00
dm-thin-metadata.c
dm-thin-metadata.h
dm-thin.c
dm-uevent.c
dm-uevent.h
dm-unstripe.c
dm-verity-fec.c dm-verity: align struct dm_verity_fec_io properly 2023-11-29 12:58:06 -05:00
dm-verity-fec.h
dm-verity-loadpin.c
dm-verity-target.c dm-crypt, dm-verity: disable tasklets 2024-02-02 12:33:50 -05:00
dm-verity-verify-sig.c
dm-verity-verify-sig.h
dm-verity.h dm-crypt, dm-verity: disable tasklets 2024-02-02 12:33:50 -05:00
dm-writecache.c dm writecache: allow allocations larger than 2GiB 2024-01-30 14:07:30 -05:00
dm-zero.c
dm-zone.c
dm-zoned-metadata.c block: remove support for the host aware zone model 2023-12-19 20:17:43 -07:00
dm-zoned-reclaim.c
dm-zoned-target.c block: remove support for the host aware zone model 2023-12-19 20:17:43 -07:00
dm-zoned.h
dm.c bdev: rename freeze and thaw helpers 2023-11-18 14:59:23 +01:00
dm.h
Kconfig for-6.8/block-2024-01-08 2024-01-11 13:58:04 -08:00
Makefile md: Remove deprecated CONFIG_MD_FAULTY 2023-12-19 10:37:50 -08:00
md-autodetect.c md: Remove deprecated CONFIG_MD_LINEAR 2023-12-19 10:16:51 -08:00
md-bitmap.c md: cleanup mddev_create/destroy_serial_pool() 2023-10-10 18:49:51 -07:00
md-bitmap.h
md-cluster.c md-cluster: check for timeout while a new disk adding 2023-10-12 09:16:19 -07:00
md-cluster.h
md-linear.h
md-multipath.h
md.c for-6.8/block-2024-01-18 2024-01-18 18:22:40 -08:00
md.h md: remove flag RemoveSynchronized 2023-11-27 15:49:04 -08:00
raid0.c
raid0.h
raid1-10.c md: factor out a helper exceed_read_errors() to check read_errors 2023-12-15 15:22:15 -08:00
raid1.c md: fix a suspicious RCU usage warning 2024-01-24 22:58:00 -08:00
raid1.h
raid5-cache.c md/raid5: remove rcu protection to access rdev from conf 2023-11-27 15:49:05 -08:00
raid5-log.h
raid5-ppl.c md/raid5: remove rcu protection to access rdev from conf 2023-11-27 15:49:05 -08:00
raid5.c for-6.8/block-2024-01-08 2024-01-11 13:58:04 -08:00
raid5.h md/raid5: remove rcu protection to access rdev from conf 2023-11-27 15:49:05 -08:00
raid10.c md: factor out a helper exceed_read_errors() to check read_errors 2023-12-15 15:22:15 -08:00
raid10.h