Skip to contentSkip to conversation

gcc: Fix CVE-2021-42574

PATCH Superseded Pgowda 3 participants 4 messages Dec 14, 2021 – Dec 15, 2021

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Pgowda

author
#0 lore raw

PATCH 1/1 gcc: Fix CVE-2021-42574

Upstream-Status: Backport [https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=bd5e882cf6e0def3dd1bc106075d59a303fe0d1e]
Upstream-Status: Backport [https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=51c500269bf53749b107807d84271385fad35628]
Upstream-Status: Backport [https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=1a7f2c0774129750fdf73e9f1b78f0ce983c9ab3]
Upstream-Status: Backport [https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=bef32d4a28595e933f24fef378cf052a30b674a7]

---
 meta/recipes-devtools/gcc/gcc-11.2.inc        |    4 +
 .../gcc/gcc/0001-CVE-2021-42574.patch         | 2282 +++++++++++++++++
 .../gcc/gcc/0002-CVE-2021-42574.patch         | 1765 +++++++++++++
 .../gcc/gcc/0003-CVE-2021-42574.patch         |  142 +
 .../gcc/gcc/0004-CVE-2021-42574.patch         |  573 +++++
 5 files changed, 4766 insertions(+)
 create mode 100644 meta/recipes-devtools/gcc/gcc/0001-CVE-2021-42574.patch
 create mode 100644 meta/recipes-devtools/gcc/gcc/0002-CVE-2021-42574.patch
 create mode 100644 meta/recipes-devtools/gcc/gcc/0003-CVE-2021-42574.patch
 create mode 100644 meta/recipes-devtools/gcc/gcc/0004-CVE-2021-42574.patch
meta/recipes-devtools/gcc/gcc-11.2.inc +4 -0
index c1293229b6..e352c958de 100644
@@ -63,6 +63,10 @@ SRC_URI = "\
            file://0002-CVE-2021-35465.patch \
            file://0003-CVE-2021-35465.patch \
            file://0004-CVE-2021-35465.patch \
+           file://0001-CVE-2021-42574.patch \
+           file://0002-CVE-2021-42574.patch \
+           file://0003-CVE-2021-42574.patch \
+           file://0004-CVE-2021-42574.patch \
 "
 SRC_URI[sha256sum] = "d08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b"
 
meta/recipes-devtools/gcc/gcc/0001-CVE-2021-42574.patch new file +2282 -0

2,282 lines not on this page · raw message

meta/recipes-devtools/gcc/gcc/0002-CVE-2021-42574.patch new file +1765 -0

708 lines not on this page · raw message

meta/recipes-devtools/gcc/gcc/0003-CVE-2021-42574.patch new file +142 -0

142 lines not on this page · raw message

meta/recipes-devtools/gcc/gcc/0004-CVE-2021-42574.patch new file +573 -0

573 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.31.1

Part of the diff is not shown here. View the raw message.

#1 lore raw
Quoted 4 lines · Pgowda

Upstream-Status: Backport [https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=bd5e882cf6e0def3dd1bc106075d59a303fe0d1e]
Upstream-Status: Backport [https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=51c500269bf53749b107807d84271385fad35628]
Upstream-Status: Backport [https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=1a7f2c0774129750fdf73e9f1b78f0ce983c9ab3]
Upstream-Status: Backport [https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=bef32d4a28595e933f24fef378cf052a30b674a7]

Ugh, that's quite a bit of patch to fix this bi-directional Unicode input attack. I'm fine with these changes though.

I do wonder about how or if we should fix the CVE in older releases.

For example, has or is there an indication that gcc upstream will, be backporting these patches to:

$ git branch -a | grep " releases/gcc-[10|11|9]"

releases/gcc-10

releases/gcc-11

releases/gcc-9

?

The current state of supported branches is:

Branch YP gcc ver Latest gcc ver Upgrade needed?
------ ---------- -------------- ---------------
master 11.2.0 11.2.0 No
honister 11.2.0 11.2.0 No
hardknott 10.2.0 10.3.0 Yes
dunfell 9.3.0 9.4.0 Yes

https://gcc.gnu.org/releases.html

so please check with upstream to see what the plan is for the 9-11 release branches and this CVE and report back here. Feel free to volunteer backport patches to gcc upstream if needed.

Are people CCed okay with upgrading gcc to the latest release or ideally the next dot releases that will include a fix for this CVE if it happens in the coming month or so?

--><-- snip --><--

Signature · 2 lines
# Randy MacLeod
# Wind River Linux
#2 lore raw
Quoted 7 lines · Randy MacLeod
Quoted 4 lines · Pgowda

Upstream-Status: Backport [https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=bd5e882cf6e0def3dd1bc106075d59a303fe0d1e]
Upstream-Status: Backport [https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=51c500269bf53749b107807d84271385fad35628]
Upstream-Status: Backport [https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=1a7f2c0774129750fdf73e9f1b78f0ce983c9ab3]
Upstream-Status: Backport [https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=bef32d4a28595e933f24fef378cf052a30b674a7]

Quoted 6 lines

Ugh, that's quite a bit of patch to fix this bi-directional Unicode input attack.
I'm fine with these changes though.

I do wonder about how or if we should fix the CVE in older releases.

this is adding a new warning to help mitigate the problem, this is not a gcc CVE per se.
so perhaps backporting to older branches makes sense, this looks ok for 11.x here

Quoted 27 lines

For example, has or is there an indication that gcc upstream will, be backporting these patches to:

$ git branch -a | grep " releases/gcc-[10|11|9]"
   releases/gcc-10

   releases/gcc-11

   releases/gcc-9

?

The current state of supported branches is:

Branch          YP gcc ver      Latest gcc ver          Upgrade needed?
------          ----------      --------------          ---------------
master          11.2.0          11.2.0                  No
honister        11.2.0          11.2.0                  No
hardknott       10.2.0          10.3.0                  Yes
dunfell         9.3.0            9.4.0                  Yes

https://gcc.gnu.org/releases.html

Quoted 7 lines

so please check with upstream to see what the plan is for the 9-11 release branches and this CVE and report back here. Feel free to volunteer backport patches to gcc upstream if needed.

Are people CCed okay with upgrading gcc to the latest release or ideally the next dot releases that will include a fix for this CVE if it happens in the coming month or so?

I think doing a bug fix dot release upgrade might be ok. Although we would have to do some good amount of testing. But I am in favor

Quoted 8 lines

--><-- snip --><--

--
# Randy MacLeod
# Wind River Linux

author
#3 lore raw

Hi,

Quoted 3 lines

this is adding a new warning to help mitigate the problem, this is not a gcc CVE per se.
so perhaps backporting to older branches makes sense, this looks ok

The patch "0001-CVE-2021-42574.patch" is a dependency patch required for these 3 CVE patches.
It adds 2 MACRO definitions that are present in the CVE patches. We can just implement those macros and drop the complete patch which is quite large.
Please let me know if we keep the patches as is or just implement the macros to make patch smaller?

Thanks,
pgowda