]> git.baikalelectronics.ru Git - kernel.git/commit
dm verity: fix crash on bufio buffer that was allocated with vmalloc
authorMikulas Patocka <mpatocka@redhat.com>
Wed, 22 Aug 2018 16:45:51 +0000 (12:45 -0400)
committerMike Snitzer <snitzer@redhat.com>
Tue, 4 Sep 2018 15:25:25 +0000 (11:25 -0400)
commitce15350f1d04b2f661e5cff1e8855d12d2bc2860
treec59725182cd0fe512e89d88e6a85d22167957f10
parent77e0a4623a7dc6c49e4b731092b7a6d5605e640c
dm verity: fix crash on bufio buffer that was allocated with vmalloc

Since commit 32b85f037c71 ("dm verity: switch to using asynchronous hash
crypto API") dm-verity uses asynchronous crypto calls for verification,
so that it can use hardware with asynchronous processing of crypto
operations.

These asynchronous calls don't support vmalloc memory, but the buffer data
can be allocated with vmalloc if dm-bufio is short of memory and uses a
reserved buffer that was preallocated in dm_bufio_client_create().

Fix verity_hash_update() so that it deals with vmalloc'd memory
correctly.

Reported-by: "Xiao, Jin" <jin.xiao@intel.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Fixes: 32b85f037c71 ("dm verity: switch to using asynchronous hash crypto API")
Cc: stable@vger.kernel.org # 4.12+
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-verity-target.c