]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
dm crypt: don't decrease device limits
authorMikulas Patocka <mpatocka@redhat.com>
Fri, 10 Aug 2018 15:23:56 +0000 (11:23 -0400)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:45:42 +0000 (19:45 -0600)
commit5b758c364aa6546488782edac95f7e8fcf83b100
treedbbdc98f0adb59a2658a7c3e13a0053b49f9b9e3
parent478bdb51bd34cca546ec7b9c34d8c7c235f906f3
dm crypt: don't decrease device limits

BugLink: https://bugs.launchpad.net/bugs/1835972
commit bc9e9cf0401f18e33b78d4c8a518661b8346baf7 upstream.

dm-crypt should only increase device limits, it should not decrease them.

This fixes a bug where the user could creates a crypt device with 1024
sector size on the top of scsi device that had 4096 logical block size.
The limit 4096 would be lost and the user could incorrectly send
1024-I/Os to the crypt device.

Cc: stable@vger.kernel.org
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/md/dm-crypt.c