summary refs log tree commit diff
path: root/drivers/md/dm-thin.c
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2019-02-08 10:52:07 -0500
committerMike Snitzer <snitzer@redhat.com>2019-02-11 12:06:48 -0500
commitff0c129d3b5ecb3df7c8f5e2236582bf745b6c5f (patch)
tree6b152c456b89d04e477d64ab9a4eb4d058c2e884 /drivers/md/dm-thin.c
parentd13937116f1e82bf508a6325111b322c30c85eb9 (diff)
downloadlinux-ff0c129d3b5ecb3df7c8f5e2236582bf745b6c5f.tar.gz
dm crypt: don't overallocate the integrity tag space
bio_sectors() returns the value in the units of 512-byte sectors (no
matter what the real sector size of the device).  dm-crypt multiplies
bio_sectors() by on_disk_tag_size to calculate the space allocated for
integrity tags.  If dm-crypt is running with sector size larger than
512b, it allocates more data than is needed.

Device Mapper trims the extra space when passing the bio to
dm-integrity, so this bug didn't result in any visible misbehavior.
But it must be fixed to avoid wasteful memory allocation for the block
integrity payload.

Fixes: ef43aa38063a6 ("dm crypt: add cryptographic data integrity protection (authenticated encryption)")
Cc: stable@vger.kernel.org # 4.12+
Reported-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-thin.c')
0 files changed, 0 insertions, 0 deletions