mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-05 12:16:29 -04:00
bcachefs: Fix encryption path on arm
flush_dcache_page() is not a noop on arm, but we were using virt_to_page() instead of vmalloc_to_page() for an address on the kernel stack - vmalloc memory, leading to an oops in flush_dcache_page(). Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
committed by
Kent Overstreet
parent
232697ab9d
commit
c346def9af
@@ -116,7 +116,12 @@ static inline int do_encrypt(struct crypto_sync_skcipher *tfm,
|
||||
{
|
||||
struct scatterlist sg;
|
||||
|
||||
sg_init_one(&sg, buf, len);
|
||||
sg_init_table(&sg, 1);
|
||||
sg_set_page(&sg,
|
||||
is_vmalloc_addr(buf)
|
||||
? vmalloc_to_page(buf)
|
||||
: virt_to_page(buf),
|
||||
len, offset_in_page(buf));
|
||||
return do_encrypt_sg(tfm, nonce, &sg, len);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user