Bug 1219841

Summary: dracut: segfault with rd.break option
Product: [openSUSE] openSUSE Tumbleweed Reporter: Antonio Feijoo <antonio.feijoo>
Component: BasesystemAssignee: dracut maintainers <dracut-maintainers>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Antonio Feijoo 2024-02-12 15:18:09 UTC
Commit https://github.com/openSUSE/dracut/commit/3950f801e26a3aeb1e3bc91e31c7fd4591588252 fixed a regression with multiple `rd.break=` options set on the kernel command line. But, it detected a call to `strcmp` without checking that the arguments are not NULL first, which causes a segfault when passing the `rd.break` option without value on the kernel command line.

> Feb 12 11:37:23 localhost systemd[1]: Starting dracut cmdline hook...
> Feb 12 11:37:23 localhost dracut-cmdline[237]: dracut-059+suse.538.ge7a5cff9-1.3
> Feb 12 11:37:23 localhost dracut-cmdline[237]: Using kernel command line parameters:  rd.driver.pre=btrfs resume=UUID=de0a0a36-ef3b-4935-aae6-209c689c0dd2 root=UUID=5594bae0-44c9-49e5-b17b-8ef41682899e rootfstype=btrfs rootflags=rw,relatime,discard=async,space_cache=v2,subvolid=266,subvol=/@/.snapshots/1/snapshot,subvol=@/.snapshots/1/snapshot   BOOT_IMAGE=/boot/vmlinuz-6.7.4-1-default root=UUID=5594bae0-44c9-49e5-b17b-8ef41682899e console=tty0 console=ttyS0,9600 security=apparmor mitigations=auto rd.break
> Feb 12 11:37:23 localhost kernel: dracut-getargs[279]: segfault at 0 ip 00007f88b1c88726 sp 00007ffc3fbefc98 error 4 in libc.so.6[7f88b1b31000+16d000] likely on CPU 0 (core 0, socket 0)
> Feb 12 11:37:23 localhost kernel: Code: 1f 44 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 66 90 89 f8 09 f0 c1 e0 14 3d 00 00 00 f8 0f 87 1a 03 00 00 <62> e1 fe 28 6f 07 62 b2 7d 20 26 d0 62 f1 7d 22 74 0e c5 fb 93 c9
> Feb 12 11:37:23 localhost systemd-coredump[280]: Failed to connect to coredump service: No such file or directory
> Feb 12 11:37:23 localhost systemd[1]: Finished dracut cmdline hook.
> Feb 12 11:37:23 localhost systemd[1]: Starting dracut pre-udev hook...
> Feb 12 11:37:23 localhost kernel: dracut-getargs[315]: segfault at 0 ip 00007f2d52753726 sp 00007ffd0a7f8f78 error 4 in libc.so.6[7f2d525fc000+16d000] likely on CPU 1 (core 0, socket 1)

However these segfaults are not critical, because it happens on a separate C binary used to parse the kernel command line, so the system boots anyway.

Fix to be backported: https://github.com/dracutdevs/dracut/pull/2607/commits/b9d395a373a1da0e869d2706e123157e7737c365
Comment 1 Antonio Feijoo 2024-02-12 15:21:27 UTC
https://github.com/openSUSE/dracut/pull/312
Comment 3 Antonio Feijoo 2024-02-19 07:38:11 UTC
Fix merged since snapshot 20240216. Closing.
Comment 5 Maintenance Automation 2024-04-02 08:30:06 UTC
SUSE-RU-2024:1081-1: An update that has four fixes can now be installed.

Category: recommended (important)
Bug References: 1217083, 1219841, 1220485, 1221675
Maintenance Incident: [SUSE:Maintenance:33012](https://smelt.suse.de/incident/33012/)
Sources used:
Basesystem Module 15-SP5 (src):
 dracut-055+suse.382.g80b55af2-150500.3.18.1
openSUSE Leap 15.5 (src):
 dracut-055+suse.382.g80b55af2-150500.3.18.1
SUSE Linux Enterprise Micro 5.5 (src):
 dracut-055+suse.382.g80b55af2-150500.3.18.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.