]> git.baikalelectronics.ru Git - kernel.git/commit
dm integrity: allow unaligned bv_offset
authorMikulas Patocka <mpatocka@redhat.com>
Tue, 7 Nov 2017 15:40:40 +0000 (10:40 -0500)
committerMike Snitzer <snitzer@redhat.com>
Fri, 10 Nov 2017 20:44:59 +0000 (15:44 -0500)
commit5a7d6a853f018aa0a168970fbfb41fc5f705125c
tree2a2e8cc8d4add04b7ffefa615e6d9c2ad4b6a2c5
parent4954060bd8948df4f4fcfd89c075904b2b03c350
dm integrity: allow unaligned bv_offset

When slub_debug is enabled kmalloc returns unaligned memory. XFS uses
this unaligned memory for its buffers (if an unaligned buffer crosses a
page, XFS frees it and allocates a full page instead - see the function
xfs_buf_allocate_memory).

dm-integrity checks if bv_offset is aligned on page size and this check
fail with slub_debug and XFS.

Fix this bug by removing the bv_offset check, leaving only the check for
bv_len.

Fixes: 3ea59c6f463a ("dm: add integrity target")
Cc: stable@vger.kernel.org # v4.12+
Reported-by: Bruno Prémont <bonbons@sysophe.eu>
Reviewed-by: Milan Broz <gmazyland@gmail.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-integrity.c