Bug 2233236 (CVE-2023-4039)
Summary: | CVE-2023-4039 gcc: -fstack-protector fails to guard dynamic stack allocations on ARM64 | ||
---|---|---|---|
Product: | [Other] Security Response | Reporter: | Guilherme de Almeida Suckevicz <gsuckevi> |
Component: | vulnerability | Assignee: | Product Security <prodsec-ir-bot> |
Status: | CLOSED NOTABUG | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | unspecified | CC: | aazores, ahajkova, ailan, amasferr, chazlett, dcadzow, dfreiber, dkenigsb, dmalcolm, dymurray, eaguilar, ebaron, fdeutsch, fweimer, gparvin, ibolton, jakub, jbastian, jburrell, jkang, jkoehler, jmatthew, jmontleo, jpallich, mcermak, michal.skrivanek, mkudlej, mperina, mpolacek, njean, ohudlick, oramraz, owatkins, pahickey, pjindal, rjones, rogbas, sbonazzo, sdawley, security-response-team, sfroberg, sipoyare, slucidi, smullick, sseago, stcannon, teagle, tjochec, trathi, vkumar |
Target Milestone: | --- | Keywords: | Security |
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: |
A vulnerability was found in GCC. The GCC's stack protection feature, enabled with the flag -fstack-protector, aims to detect buffer overflows in C/C++ function local variables that might allow an attacker to overwrite saved registers on the stack. If an attacker can modify saved register values, it may be possible for them to subvert program flow control. The feature operates by placing a canary value between local variables and saved registers on the stack on function entry and triggers an error handler on function exit if the canary value has been unexpectedly modified.
When targeting AArch64, this feature did not protect the saved registers from overflows in C99-style dynamically-sized local variables and alloca() objects. Other local variables, including statically-sized local arrays, are not affected because of their different placement on the stack relative to saved registers.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2023-11-17 13:46:59 UTC | Type: | --- |
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: | 2233240, 2233241, 2233242, 2233249, 2233250, 2233251, 2233252, 2233253, 2233254, 2233255, 2233256, 2233257, 2233258, 2233259, 2233260, 2233261, 2235333, 2235336, 2238670, 2238671 | ||
Bug Blocks: | 2233230 |
Description
Guilherme de Almeida Suckevicz
2023-08-21 18:52:36 UTC
Public via: [PATCH 00/19] aarch64: Fix -fstack-protector issue https://inbox.sourceware.org/gcc-patches/20230912152529.3322336-1-richard.sandiford@arm.com/ Quoting from that message: This series of patches fixes deficiencies in GCC's -fstack-protector implementation for AArch64 when using dynamically allocated stack space. This is CVE-2023-4039. See: https://developer.arm.com/Arm%20Security%20Center/GCC%20Stack%20Protector%20Vulnerability%20AArch64 https://github.com/metaredteam/external-disclosures/security/advisories/GHSA-x7ch-h5rf-w2mf for more details. The fix is to put the saved registers above the locals area when -fstack-protector is used. The series also fixes a stack-clash problem that I found while working on the CVE. In unpatched sources, the stack-clash problem would only trigger for unrealistic numbers of arguments (8K 64-bit arguments, or an equivalent). But it would be a more significant issue with the new -fstack-protector frame layout. It's therefore important that both problems are fixed together. Created gcc tracking bugs for this issue: Affects: fedora-all [bug 2238670] Created mingw-gcc tracking bugs for this issue: Affects: fedora-all [bug 2238671] |