android_kernel_samsung_a7y1.../drivers/md
Mikulas Patocka a09046d5f7 dm cache: fix a crash due to incorrect work item cancelling
commit 7cdf6a0aae1cccf5167f3f04ecddcf648b78e289 upstream.

The crash can be reproduced by running the lvm2 testsuite test
lvconvert-thin-external-cache.sh for several minutes, e.g.:
  while :; do make check T=shell/lvconvert-thin-external-cache.sh; done

The crash happens in this call chain:
do_waker -> policy_tick -> smq_tick -> end_hotspot_period -> clear_bitset
-> memset -> __memset -- which accesses an invalid pointer in the vmalloc
area.

The work entry on the workqueue is executed even after the bitmap was
freed. The problem is that cancel_delayed_work doesn't wait for the
running work item to finish, so the work item can continue running and
re-submitting itself even after cache_postsuspend. In order to make sure
that the work item won't be running, we must use cancel_delayed_work_sync.

Also, change flush_workqueue to drain_workqueue, so that if some work item
submits itself or another work item, we are properly waiting for both of
them.

Fixes: c6b4fcbad044 ("dm: add cache target")
Cc: stable@vger.kernel.org # v3.9
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-07 14:10:49 +02:00
..
bcache bcache: explicity type cast in bset_bkey_last() 2020-04-07 13:57:25 +02:00
persistent-data dm space map common: fix to ensure new block isn't already in use 2020-04-07 13:50:02 +02:00
alta_bigdata.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bitmap.c md: Avoid namespace collision with bitmap API 2020-04-07 13:45:07 +02:00
bitmap.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-android-verity.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-android-verity.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-bio-prison.c dm: Use kzalloc for all structs with embedded biosets/mempools 2020-04-07 09:27:22 +02:00
dm-bio-prison.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-bio-record.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-bufio.c Revert "dm bufio: fix deadlock with loop device" 2020-04-06 20:53:42 +02:00
dm-bufio.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-builtin.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-cache-block-types.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-cache-metadata.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-cache-metadata.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-cache-policy-cleaner.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-cache-policy-internal.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-cache-policy-mq.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-cache-policy-smq.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-cache-policy.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-cache-policy.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-cache-target.c dm cache: fix a crash due to incorrect work item cancelling 2020-04-07 14:10:49 +02:00
dm-crypt.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-delay.c dm delay: fix a crash when invalid device is specified 2020-04-06 18:14:27 +02:00
dm-dirty.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-era-target.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-exception-store.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-exception-store.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-flakey.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-io.c dm: Use kzalloc for all structs with embedded biosets/mempools 2020-04-07 09:27:22 +02:00
dm-ioctl.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-kcopyd.c dm: Use kzalloc for all structs with embedded biosets/mempools 2020-04-07 09:27:22 +02:00
dm-linear.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-log-userspace-base.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-log-userspace-transfer.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-log-userspace-transfer.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-log-writes.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-log.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-mpath.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-mpath.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-path-selector.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-path-selector.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-queue-length.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-raid.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-raid1.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-region-hash.c dm: Use kzalloc for all structs with embedded biosets/mempools 2020-04-07 09:27:22 +02:00
dm-round-robin.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-service-time.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-snap-persistent.c block: fix an integer overflow in logical block size 2020-04-07 13:37:29 +02:00
dm-snap-transient.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-snap.c dm: Use kzalloc for all structs with embedded biosets/mempools 2020-04-07 09:27:22 +02:00
dm-stats.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-stats.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-stripe.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-switch.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-sysfs.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-table.c dm table: fix invalid memory accesses with too high sector number 2020-04-06 21:10:33 +02:00
dm-target.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-thin-metadata.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-thin-metadata.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-thin.c dm: Use kzalloc for all structs with embedded biosets/mempools 2020-04-07 09:27:22 +02:00
dm-uevent.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-uevent.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-verity-avb.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-verity-debug.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-verity-debug.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-verity-fec.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-verity-fec.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-verity-target.c dm verity: use message limit for data block corruption message 2020-04-06 19:31:08 +02:00
dm-verity.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm-zero.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dm.c dm: fix potential for q->make_request_fn NULL pointer 2020-04-07 13:54:55 +02:00
dm.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
faulty.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
linear.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
linear.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
md-cluster.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
md-cluster.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
md.c md: don't set In_sync if array is frozen 2020-04-07 07:38:24 +02:00
md.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
multipath.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
multipath.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
raid1.c md: raid1: check rdev before reference in raid1_sync_request func 2020-04-07 13:24:22 +02:00
raid1.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
raid5-cache.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
raid5.c md/raid6: Set R5_ReadError when there is read failure on parity disk 2020-04-07 07:40:38 +02:00
raid5.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
raid10.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
raid10.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
raid0.c block: fix an integer overflow in logical block size 2020-04-07 13:37:29 +02:00
raid0.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30