From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 443C63858410; Mon, 25 Oct 2021 12:03:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 443C63858410 From: "ardb at kernel dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/102926] TLS register value is spilled to the stack instead of reloaded from the system register Date: Mon, 25 Oct 2021 12:03:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: ardb at kernel dot org 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: Message-ID: In-Reply-To: References: 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: Mon, 25 Oct 2021 12:03:58 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102926 --- Comment #3 from Ard Biesheuvel --- (In reply to Andrew Pinski from comment #1) > I don't think it is a security risk really because all spills then can be > considered security risks. I would argue that there is no consensus on that. In fact, there is elabora= te handling of the stack canary in the ARM backend, not only to prevent spilli= ng of the stack canary address or value, but even to ensure that the value is cleared from all registers that carried it while performing the test or the set. In any case, regardless of whether this is a security issue or not (when/if= my TLS stack protector changes get accepted), spilling the TLS register value = is definitely unnecessary.=