From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 43AC13854828 for ; Fri, 1 Dec 2023 21:14:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 43AC13854828 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 43AC13854828 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701465280; cv=none; b=iqQcx9V2Ju+yztGW8rkZ1zUPioV+m4l+kNmXB42mpVYlDOlHJB85Kc7vCpIVKz4vQGE/SFReGIZ+ZTH96xgfEVvxlfFV0YwYD+e2vqBqjdqZjRpdwpT1AgvFxRZb4I+KetXJ3UXigqFveOernugpmcC3MosLp6AavzImt6nnSa8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701465280; c=relaxed/simple; bh=4bbugFgIoywm7sndronSkE3EaB56vXQGM2reVrXC0Jc=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=ZlDHlFH9PyzHD8h54G0cOlOvorWkAownhVJ/F4cTVbw1VgRG0mTC5oPzGGCGQLL4iqzOdIrf3NXo9YKx0nIdTdwkO3PqKZ6+CBHNlGnMWtaEYvdA4Jkq6BKpzFwhqJ3XambMidqKZJNdmWqxHpII2gb+ppNk3nuLbLncPsJdQvQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701465278; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=juZFI/dMzViVTNpIwA1kUpvN3NOvZ/B5aPPiMekBE5g=; b=BK9jhwup04oD7AdN+EirhQgk18n6B88e7RiMGyYCEdqvj0R/Z3xe8+J76eVL8vB3zPs76y v0jdYfvuqQsPT7OumCnuSPpD6WKUY9MlBkEBI4oAETOh5RRv0jFDg3DTzX4kWOiM4QfmqY y6uF2XhsBofxGA4bWA2fvzeyw1fk43c= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-94-rM6wzKfZNvOsJVi4j2uWzg-1; Fri, 01 Dec 2023 16:14:34 -0500 X-MC-Unique: rM6wzKfZNvOsJVi4j2uWzg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7870A811E7D; Fri, 1 Dec 2023 21:14:34 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.195.157]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3BA92492BFC; Fri, 1 Dec 2023 21:14:34 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 3B1LEVnw621565 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 1 Dec 2023 22:14:32 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 3B1LEVWd621564; Fri, 1 Dec 2023 22:14:31 +0100 Date: Fri, 1 Dec 2023 22:14:30 +0100 From: Jakub Jelinek To: Marek Polacek Cc: Andrew Pinski , GCC Patches Subject: Re: [PATCH] gcc: Disallow trampolines when -fhardened Message-ID: Reply-To: Jakub Jelinek References: <20231201193359.108618-1-polacek@redhat.com> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, Dec 01, 2023 at 03:53:14PM -0500, Marek Polacek wrote: > On Fri, Dec 01, 2023 at 11:44:28AM -0800, Andrew Pinski wrote: > > On Fri, Dec 1, 2023, 11:36 Marek Polacek wrote: > > > > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > > > -- >8 -- > > > It came up that a good hardening strategy is to disable trampolines > > > which may require executable stack. Therefore the following patch > > > adds -Werror=trampolines to -fhardened. > > > > > > > It might make sense to add a fortran testcase too. Especially when that and > > Ada are 2 biggest users of trampolines. > > I don't know either of these languages to write a test, and I don't see > anything that mentions the word trampoline in gfortran.dg/. Ada has program nesting integer :: i procedure(), pointer :: p p => foo i = 5 call p if (i.ne.6) stop 1 contains subroutine foo i = i + 1 end subroutine end program (obviously at -O0 only)? Jakub