RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1125404 - [RHEL 7] grub2 improperly escapes spaces in kernel parameters
Summary: [RHEL 7] grub2 improperly escapes spaces in kernel parameters
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: grub2
Version: 7.2
Hardware: All
OS: All
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Peter Jones
QA Contact: Release Test Team
URL:
Whiteboard:
: 1233229 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-31 18:20 UTC by Herton R. Krzesinski
Modified: 2019-04-16 14:15 UTC (History)
3 users (show)

Fixed In Version: grub2-2.02-0.17.el7
Doc Type: Bug Fix
Doc Text:
Cause: In order to support certain types of boot media, grub2 had been made to escape slashes in several different places. One of these was unnecessary, and prevented certain types of command line arguments from being passed to the kernel. Consequence: Kernel command line arguments which need to include escaped characters could not be passed to the kernel correctly. Fix: Remove one of the places we parsed escape characters. Result: Those command line options can work again.
Clone Of:
Environment:
Last Closed: 2015-11-19 12:23:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:2401 0 normal SHIPPED_LIVE Low: grub2 security, bug fix, and enhancement update 2015-11-19 11:00:33 UTC

Description Herton R. Krzesinski 2014-07-31 18:20:57 UTC
Description of problem:
This is a report of same issue which happened on Fedora and was reported on https://bugzilla.redhat.com/show_bug.cgi?id=923374 (RHEL 7 grub 2 package has the same problematic patch)

On RHEL 7, it's not possible to pass kernel command line parameters with spaces, grub 2 will wrongly escape the espaces with '\x20' and pass the string with it to kernel, the kernel then of course does not recognize it.

This is an annoying limitation, while the Fedora bug report talks about acpi_osi, I noticed this when I was trying to use dynamic debug option (dyndbg=...) of linux kernel (see Documentation/dynamic-debug-howto.txt at kernel sources, current grub2 makes it essentialy unusable). Also it limits Red Hat Support, which may want ask customers to use kernel options with spaces like dyndbg to get debug information on a given issue (I run into this while working on red hat support case 01133035, but luckily on that case debugging is during the installer using syslinux which isn't affected).

Version-Release number of selected component (if applicable):
grub2-2.02-0.2.10.el7

How reproducible:
Always

Steps to Reproduce:
Use any kernel option with spaces, eg.: dyndbg="module cpufreq +p"

Actual results:
Kernel doesn't recognize the kernel option due to extra \x20 in the string

Expected results:
No escaping done on command line options

Comment 1 Herton R. Krzesinski 2014-07-31 18:24:44 UTC
I did a test rebuilding grub2 on RHEL 7, replacing the patch on src.rpm with the fixed one proposed at bug 923374 (https://bugzilla.redhat.com/attachment.cgi?id=911363), and it fixed the issue.

Comment 5 Peter Jones 2015-06-30 20:54:44 UTC
*** Bug 1233229 has been marked as a duplicate of this bug. ***

Comment 7 Michal Kovarik 2015-08-27 08:07:10 UTC
Using grub2-2.02-0.25.el7 - added kernel option - test="abc 123"

[root@system1 ~]# cat /proc/cmdline
BOOT_IMAGE=/vmlinuz root=/dev/mapper/rhel_system1-root ro crashkernel=auto rd.lvm.lv=rhel_system1/root rd.lvm.lv=rhel_system1/swap LANG=en_US.UTF-8 "test=abc 123"

Based on [1]:
Double-quotes can be used to protect spaces in values, e.g.:
	param="spaces in here"

Moving back to Assigned.


Actual Result:
"test=abc 123"

Expected Result:
test="abc 123"

[1] https://www.kernel.org/doc/Documentation/kernel-parameters.txt

Comment 8 Peter Jones 2015-09-02 13:29:33 UTC
> Actual Result:
> "test=abc 123"
> 
> Expected Result:
> test="abc 123"

This is the same behavior as in RHEL 7.1 and is unrelated to this bug.  If you find some actual incorrect behavior due to this, please file that as a different bug - but there's a good chance any such problem you find will be a bug in something parsing the string later, since in terms of shell quoting, these two strings are still identical.

Comment 9 errata-xmlrpc 2015-11-19 12:23:29 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, 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://rhn.redhat.com/errata/RHSA-2015-2401.html


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