]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
dm-integrity: fix a bug if the bio is out of limits
authorMikulas Patocka <mpatocka@redhat.com>
Thu, 9 Jul 2026 19:25:39 +0000 (21:25 +0200)
committerMikulas Patocka <mpatocka@redhat.com>
Fri, 10 Jul 2026 12:39:47 +0000 (14:39 +0200)
commit5a266764fadaff8b5c1fe37a186ebf9b09cb953e
treefd1b6f1fc0ca287089e176a95fabf06704a256cb
parentedf025f083854f80032b73a1aad69a3c90db236f
dm-integrity: fix a bug if the bio is out of limits

If dm_integrity_check_limits fails, the code would exit with
DM_MAPIO_KILL. However, the range would be already locked at this point,
and it wouldn't be unlocked, resulting in a deadlock. Let's move the
limit check up, so that when it exits, no resources are leaked.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Assisted-by: Claude:claude-opus-4.6
Fixes: fb0987682c62 ("dm-integrity: introduce the Inline mode")
Cc: stable@vger.kernel.org
drivers/md/dm-integrity.c