From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E8749385800A; Thu, 30 Dec 2021 01:59:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E8749385800A From: "noloader at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/103863] New: We need a warning for loss of no-exec stacks Date: Thu, 30 Dec 2021 01:59:55 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: noloader at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Dec 2021 01:59:56 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103863 Bug ID: 103863 Summary: We need a warning for loss of no-exec stacks Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: noloader at gmail dot com Target Milestone: --- Hello, This is a feature request. For targets that support no-exec stacks, we need a warning when GCC generat= es code or drives the linker with loss of no-exec stacks. The warning would be beneficial for most builds nowadays since no-exec stac= ks are part of most distro hardening. For example, Debian and Fedora both incorporate it into their build system; and special steps must be taken to avoid no-exec stacks out of the box. The warning would also be beneficial in cases like https://bugzilla.redhat.com/show_bug.cgi?id=3D2035802. In the 2035802 bug, = an ARM machine failed to boot because libz contained executable stacks even though they were not needed. A specific warning for no-exec stacks is slightly different than -Wtrampoli= nes. While trampolines resulted in executable stacks in the past, that may not h= old in the future as lambdas are added to the language. And trampolines are not= a necessary precondition to get in an insecure state like the 2035802 bug sho= ws. It is most unfortunate that ASM files need special handling because the obj= ect files are marked with executable stacks by default. Maybe that should be another bug report to change default behavior since the strategy nowadays i= s: no-exec stacks by default, do something special for executable stacks. Thanks in advance.=