Bug 1932946

Summary: bitlk: crypt_init_by_name_and_header() dereferences NULL pointer when data device device for active dm-crypt disappeared
Product: [Fedora] Fedora Reporter: Tom Sundberg <tomcom980>
Component: cryptsetupAssignee: Milan Broz <gmazyland>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 33CC: agk, gmazyland, okozina, tbzatek, vtrefny
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/a9e4e09ae1c29a2d606d4c314431604e256b1e85
Whiteboard: abrt_hash:e44fa75fbdc3145f619713eb6cab1204b9e84644;VARIANT_ID=workstation;
Fixed In Version: cryptsetup-2.3.5-2.fc34 cryptsetup-2.3.5-2.fc33 cryptsetup-2.3.5-2.fc32 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-03-19 20:11:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: backtrace
none
File: core_backtrace
none
File: cpuinfo
none
File: dso_list
none
File: environ
none
File: exploitable
none
File: limits
none
File: maps
none
File: mountinfo
none
File: open_fds
none
File: proc_pid_status
none
File: var_log_messages none

Description Tom Sundberg 2021-02-25 13:23:02 UTC
Description of problem:
I had a virt-manager VM running, and I redirected a flashdrive to the virtual machine. Disks wouldn't open after un-redirecting the flashdrive.

Version-Release number of selected component:
udisks2-2.9.1-2.fc33

Additional info:
reporter:       libreport-2.14.0
backtrace_rating: 4
cgroup:         0::/system.slice/udisks2.service
cmdline:        /usr/libexec/udisks2/udisksd
crash_function: device_open
executable:     /usr/libexec/udisks2/udisksd
journald_cursor: s=060ed13377974d77b9539b16e664e224;i=b7a11;b=cd3487d4ec4a49f386396e20fbbe8808;m=a87804190;t=5bc2829b3180a;x=39d164b042171725
kernel:         5.10.16-200.fc33.x86_64
rootdir:        /
runlevel:       N 5
type:           CCpp
uid:            0

Truncated backtrace:
Thread no. 1 (9 frames)
 #0 device_open at lib/utils_device.c:303
 #1 BITLK_read_sb at lib/bitlk/bitlk.c:470
 #2 _crypt_load_bitlk.constprop.0 at lib/setup.c:988
 #3 _init_by_name_crypt at lib/setup.c:1296
 #4 crypt_init_by_name_and_header at lib/setup.c:1486
 #5 _crypto_close at crypto.c:1132
 #6 run_task_job at udisksthreadedjob.c:214
 #7 g_task_thread_pool_thread at ../gio/gtask.c:1417
 #9 g_thread_proxy at ../glib/gthread.c:820

Comment 1 Tom Sundberg 2021-02-25 13:23:07 UTC
Created attachment 1759310 [details]
File: backtrace

Comment 2 Tom Sundberg 2021-02-25 13:23:09 UTC
Created attachment 1759311 [details]
File: core_backtrace

Comment 3 Tom Sundberg 2021-02-25 13:23:10 UTC
Created attachment 1759312 [details]
File: cpuinfo

Comment 4 Tom Sundberg 2021-02-25 13:23:12 UTC
Created attachment 1759313 [details]
File: dso_list

Comment 5 Tom Sundberg 2021-02-25 13:23:13 UTC
Created attachment 1759314 [details]
File: environ

Comment 6 Tom Sundberg 2021-02-25 13:23:14 UTC
Created attachment 1759315 [details]
File: exploitable

Comment 7 Tom Sundberg 2021-02-25 13:23:17 UTC
Created attachment 1759316 [details]
File: limits

Comment 8 Tom Sundberg 2021-02-25 13:23:19 UTC
Created attachment 1759317 [details]
File: maps

Comment 9 Tom Sundberg 2021-02-25 13:23:21 UTC
Created attachment 1759318 [details]
File: mountinfo

Comment 10 Tom Sundberg 2021-02-25 13:23:23 UTC
Created attachment 1759319 [details]
File: open_fds

Comment 11 Tom Sundberg 2021-02-25 13:23:26 UTC
Created attachment 1759320 [details]
File: proc_pid_status

Comment 12 Tom Sundberg 2021-02-25 13:23:28 UTC
Created attachment 1759321 [details]
File: var_log_messages

Comment 13 Tom Sundberg 2021-02-26 06:44:19 UTC
*** Bug 1933231 has been marked as a duplicate of this bug. ***

Comment 14 Tomáš Bžatek 2021-03-01 16:34:16 UTC
Reassigning to cryptsetup. The invocation of crypt_init_by_name_and_header() from libblockdev side looks sane on a first sight.

Comment 15 Milan Broz 2021-03-01 19:48:33 UTC
Yes, this uncovered a bug in libcryptsetup when it is called on an active Bitlocker mapping but the underlying device already disappeared.
Fix will be included in the next stable release.

Comment 17 Fedora Update System 2021-03-11 14:33:44 UTC
FEDORA-2021-17c262e08d has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-17c262e08d

Comment 18 Fedora Update System 2021-03-11 14:33:47 UTC
FEDORA-2021-28e528d2b6 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2021-28e528d2b6

Comment 19 Fedora Update System 2021-03-11 14:33:50 UTC
FEDORA-2021-3a694e18c9 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2021-3a694e18c9

Comment 20 Fedora Update System 2021-03-11 19:52:02 UTC
FEDORA-2021-17c262e08d has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-17c262e08d`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-17c262e08d

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 21 Fedora Update System 2021-03-12 00:19:22 UTC
FEDORA-2021-3a694e18c9 has been pushed to the Fedora 33 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-3a694e18c9`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-3a694e18c9

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 22 Fedora Update System 2021-03-12 00:21:30 UTC
FEDORA-2021-28e528d2b6 has been pushed to the Fedora 32 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-28e528d2b6`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-28e528d2b6

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 23 Fedora Update System 2021-03-19 20:11:49 UTC
FEDORA-2021-17c262e08d has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 24 Fedora Update System 2021-03-23 01:32:11 UTC
FEDORA-2021-3a694e18c9 has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 25 Fedora Update System 2021-03-27 01:23:15 UTC
FEDORA-2021-28e528d2b6 has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.