Bug 2072762

Summary: gcc -Wbidirectional vs -Wbidi-chars discrepancy
Product: Red Hat Enterprise Linux 8 Reporter: Marek Polacek <mpolacek>
Component: gccAssignee: Marek Polacek <mpolacek>
gcc sub component: system-version QA Contact: Václav Kadlčík <vkadlcik>
Status: CLOSED NOTABUG Docs Contact: Petr Hybl <phybl>
Severity: unspecified    
Priority: unspecified CC: ahajkova, benh, bstinson, fweimer, jakub, jwboyer, ohudlick, phybl, qe-baseos-tools-bugs, sipoyare, tumeya
Version: 8.7Keywords: Bugfix, Triaged
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: Divergence between RHEL 9 gcc and upstream gcc. Consequence: Confusing for users. Fix: Make RHEL 9 gcc accept both -Wbidirectional and -Wbidi-chars Result: Less confusion
Story Points: ---
Clone Of: 2072758 Environment:
Last Closed: 2022-04-20 17:26:30 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:
Bug Depends On: 2072758    
Bug Blocks:    

Description Marek Polacek 2022-04-06 22:18:40 UTC
+++ This bug was initially created as a clone of Bug #2072758 +++

Description of problem:

To address CVE-2021-42574, RHEL8/CentOS8 implements a gcc patch which adds the -Wbidirectional option. This is also documented in various RH advisories.

This is unfortunately different from upstream gcc which named the option -Wbidi-chars instead.

From what I can see of the available source code, RHEL9/CentOS9 backported to gcc11 the "upstream" variant.

This can/will cause a discrepancy between RHEL8 and RHEL9 for customers and between RHEL and other distributions.

Would it be possible to amend the patches in the backports to support both variants ?

Version-Release number of selected component (if applicable):

I've verified the git repos of c8s and c9, but from the published advisories, this also affects the various devtoolsets.

I also noticed gcc has some followup fixes/updates for that code that weren't backported.

--- Additional comment from Marek Polacek on 2022-04-06 22:11:47 UTC ---

Thanks for the report.  As I mentioned in the email, I would like to add an alias so that RHEL9 gcc groks both -Wbidirectional and -Wbidi-chars.

I think we want a clone for RHEL 8 gcc too.  But I don't see how we'd fix this in DTS/GTS at this point.

Comment 1 Marek Polacek 2022-04-20 17:26:30 UTC
Turns out the current RHEL8 gcc *already* uses -Wbidi-chars!  Nothing to do here.