Commit 4a1f40d0 authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Li Lingfeng
Browse files

dm-crypt: don't modify the data when using authenticated encryption

stable inclusion
from stable-v4.19.308
commit 43a202bd552976497474ae144942e32cc5f34d7e
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9E2LW
CVE: CVE-2024-26763

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=43a202bd552976497474ae144942e32cc5f34d7e

--------------------------------

commit 50c70240097ce41fe6bce6478b80478281e4d0f7 upstream.

It was said that authenticated encryption could produce invalid tag when
the data that is being encrypted is modified [1]. So, fix this problem by
copying the data into the clone bio first and then encrypt them inside the
clone bio.

This may reduce performance, but it is needed to prevent the user from
corrupting the device by writing data with O_DIRECT and modifying them at
the same time.

[1] https://lore.kernel.org/all/20240207004723.GA35324@sol.localdomain/T/



Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarLi Lingfeng <lilingfeng3@huawei.com>
parent 1ed85cbd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment