Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1884472

Summary: Extra plus sign added by the [bootloader] plugin to TUNED_BOOT_CMDLINE and /proc/cmdline
Product: Red Hat Enterprise Linux 8 Reporter: Jiří Mencák <jmencak>
Component: tunedAssignee: Jaroslav Škarvada <jskarvad>
Status: CLOSED DUPLICATE QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.3CC: fromani, jeder, jskarvad, yquinn
Target Milestone: rcKeywords: Patch, Reopened, Upstream
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-23 12:12:25 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:

Description Jiří Mencák 2020-10-02 06:14:14 UTC
Description of problem:
When the right-hand-side of cmdline in the [bootloader] parameter is specified and '=+" used instead of '=', extra '+' is set in TUNED_BOOT_CMDLINE and passed as a kernel parameter.

Version-Release number of selected component (if applicable):
[root@b83 ]# rpm -q tuned
tuned-2.14.0-3.el8.noarch

How reproducible:
Always

Steps to Reproduce:
1. mkdir -p /etc/tuned/plus
2. cat >/etc/tuned/plus/tuned.conf<<EOF
#
# tuned configuration
#

[main]
summary=Trailing plus PoC

[bootloader]
cmdline_additionalArg=+
EOF
3. systemctl stop tuned
4. echo manual > /etc/tuned/profile_mode
5. echo plus > /etc/tuned/active_profile
6. systemctl start tuned

Actual results:
[root@b83 ~]# grep TUNED_BOOT_CMDLINE /etc/tuned/bootcmdline 
TUNED_BOOT_CMDLINE="+"

Expected results:
[root@b83 ~]# grep TUNED_BOOT_CMDLINE /etc/tuned/bootcmdline 
TUNED_BOOT_CMDLINE=""

Additional info:
Discovered when investigating
https://bugzilla.redhat.com/show_bug.cgi?id=1881422

Comment 1 Yanir Quinn 2020-10-04 09:39:54 UTC
Is this a "cosmetic" issue only ? is there a risk when additional arguments are added with '+'  ? 

For example, will "cmdline_realtime=+tsc=nowatchdog intel_iommu=on iommu=pt"  apply all the additional arguments and function properly although "+" is added to /proc/cmdline as well ?

Comment 2 Jiří Mencák 2020-10-04 13:44:43 UTC
(In reply to Yanir Quinn from comment #1)
> Is this a "cosmetic" issue only ? is there a risk when additional arguments
> are added with '+'  ? 
> 
> For example, will "cmdline_realtime=+tsc=nowatchdog intel_iommu=on iommu=pt"
> apply all the additional arguments and function properly although "+" is
> added to /proc/cmdline as well ?

The point is '+' is added when RHS is empty.  It should not be added.  The case
you mention above should work fine and no extra '+' will be added.

Comment 8 RHEL Program Management 2022-04-02 07:27:20 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.

Comment 9 Jaroslav Škarvada 2022-04-04 12:58:33 UTC
Yes, it's bug and it's worth fixing.

Comment 11 Jaroslav Škarvada 2022-04-04 13:11:28 UTC
Hmm, from the code the observed behavior is intended. The logic behind is that nobody would like to add empty line that's why the parser interprets it as:
cmdline_additionalArg = VAL

where the VAL is '+'.

But I agree that the behavior is not consistent and intuitive. It would be probably better to add support for escape character, e.g.:

cmdline_additionalArg =+ -> ''
cmdline_additionalArg =\+ -> '+'
cmdline_additionalArg =\\+ -> '\+'

Comment 12 Jaroslav Škarvada 2022-04-04 15:24:19 UTC
(In reply to Yanir Quinn from comment #1)
> Is this a "cosmetic" issue only ? is there a risk when additional arguments
> are added with '+'  ? 
> 
> For example, will "cmdline_realtime=+tsc=nowatchdog intel_iommu=on iommu=pt"
> apply all the additional arguments and function properly although "+" is
> added to /proc/cmdline as well ?

This should work correctly, the problem should manifest only if there is sole '+' without additional arguments (whitespaces not counted).

Comment 13 Jaroslav Škarvada 2022-04-04 16:03:53 UTC
Upstream PR:
https://github.com/redhat-performance/tuned/pull/432

Comment 15 Jaroslav Škarvada 2022-08-23 12:12:25 UTC
It's covered by TuneD rebase to version tuned-2.19.0, bug 2057602.

*** This bug has been marked as a duplicate of bug 2057602 ***