Bug 2150254

Summary: [RHEL8] With encrypt action when --header parameter and data device parameter are same it corrupts the data
Product: Red Hat Enterprise Linux 8 Reporter: guazhang <guazhang>
Component: cryptsetupAssignee: Daniel Zaťovič <dzatovic>
Status: CLOSED ERRATA QA Contact: guazhang <guazhang>
Severity: high Docs Contact:
Priority: high    
Version: 8.8CC: agk, jbrassow, okozina, prajnoha, storage-qe
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: cryptsetup-2.3.7-5.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2150251 Environment:
Last Closed: 2023-05-16 09:09:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2150251    
Bug Blocks:    

Comment 2 Ondrej Kozina 2022-12-14 09:45:10 UTC
Fixed in upstream with: https://gitlab.com/cryptsetup/cryptsetup/-/merge_requests/463

Comment 3 guazhang@redhat.com 2023-01-13 00:16:32 UTC
Hi,

[root@storageqe-69 ~]# echo 'redhatredhat' |cryptsetup reencrypt  --encrypt /dev/loop0  --header  /dev/loop0  --type luks2  -q
Encryption without detached header (--header) is not possible without data device size reduction (--reduce-device-size).
[root@storageqe-69 ~]# rpm -qa |grep cryptsetup
cryptsetup-devel-2.3.7-5.el8.x86_64
cryptsetup-libs-2.3.7-5.el8.x86_64
cryptsetup-2.3.7-5.el8.x86_64
[root@storageqe-69 ~]# 

test pass with the fixed package.

Comment 7 errata-xmlrpc 2023-05-16 09:09:15 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (cryptsetup bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:2996