Bug 2369804 - Escaped quotes in kernel command-line break Anaconda
Summary: Escaped quotes in kernel command-line break Anaconda
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda
Version: 43
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: anaconda-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-06-02 14:13 UTC by Michael Mrozek
Modified: 2025-06-02 14:13 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Michael Mrozek 2025-06-02 14:13:40 UTC
There's a block of code in Anaconda that tries to account for a corrupted kernel command-line string by adding an extra double-quote: https://github.com/rhinstaller/anaconda/blob/7ae48f73b80e86d0f64b43f037785c22144cab2e/pyanaconda/core/kernel.py#L97-L99

    (left, middle, right) = cmdline.rpartition("BOOT_IMAGE=")
    if right.count('"') % 2:
        cmdline = left + middle + '"' + right

This code doesn't account for escaped quotes, so e.g. if you add this to the kernel command-line:

    foo=bar\"baz

The above code thinks there's an unbalanced number of quotes, inserts one, and causes shlex.split() to throw a "No closing quotation" ValueError.


Reproducible: Always

Steps to Reproduce:
1. Load install media that runs Anaconda
2. Edit the command-line in GRUB to add an argument containing an escaped double-quote
3. Continue the boot
Actual Results:
Anaconda throws a ValueError very early in its startup

Expected Results:
Anaconda loads the GUI normally


Note You need to log in before you can comment on or make changes to this bug.