From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60391C43217 for ; Mon, 7 Nov 2022 16:57:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232944AbiKGQ5G (ORCPT ); Mon, 7 Nov 2022 11:57:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232854AbiKGQ5E (ORCPT ); Mon, 7 Nov 2022 11:57:04 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0613122528 for ; Mon, 7 Nov 2022 08:56:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667840166; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=T50w0nkUuy7T2kUqSnZIRriHtEbo2iSXTPmDVdxQoV8=; b=DQrz2Ul/SSr1QRgx1t8Xpy/8qjlbtJDH0+P/OKwidmzSvVopZLlT++TspUdb5imjxagTPV RpIxByRAVtOoH0jokR2GxcMnGEZKHiCyjQRsL8A5BZl3Pq/i93tBDZDC8HYj0lSlJecgnz lipyB4w7CckoOnZzpeD9GLy+5/dZs84= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-642-vUiqRtnoNq-2EW1fMouqkA-1; Mon, 07 Nov 2022 11:56:02 -0500 X-MC-Unique: vUiqRtnoNq-2EW1fMouqkA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 61A36101E14D; Mon, 7 Nov 2022 16:56:01 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.86]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A58641121314; Mon, 7 Nov 2022 16:55:55 +0000 (UTC) From: Florian Weimer To: "Edgecombe, Rick P" Cc: "hjl.tools@gmail.com" , "bsingharora@gmail.com" , "hpa@zytor.com" , "Syromiatnikov, Eugene" , "peterz@infradead.org" , "rdunlap@infradead.org" , "keescook@chromium.org" , "Yu, Yu-cheng" , "dave.hansen@linux.intel.com" , "Eranian, Stephane" , "kirill.shutemov@linux.intel.com" , "linux-mm@kvack.org" , "nadav.amit@gmail.com" , "jannh@google.com" , "dethoma@microsoft.com" , "kcc@google.com" , "linux-arch@vger.kernel.org" , "bp@alien8.de" , "oleg@redhat.com" , "Yang, Weijiang" , "Lutomirski, Andy" , "pavel@ucw.cz" , "arnd@arndb.de" , "tglx@linutronix.de" , "mike.kravetz@oracle.com" , "x86@kernel.org" , "linux-doc@vger.kernel.org" , "jamorris@linux.microsoft.com" , "john.allen@amd.com" , "rppt@kernel.org" , "mingo@redhat.com" , "Shankar, Ravi V" , "corbet@lwn.net" , "linux-kernel@vger.kernel.org" , "linux-api@vger.kernel.org" , "gorcunov@gmail.com" , "akpm@linux-foundation.org" Subject: Re: [RFC 37/37] fs/binfmt_elf: Block old shstk elf bit References: <20221104223604.29615-1-rick.p.edgecombe@intel.com> <20221104223604.29615-38-rick.p.edgecombe@intel.com> <87iljs4ecp.fsf@oldenburg.str.redhat.com> Date: Mon, 07 Nov 2022 17:55:54 +0100 In-Reply-To: (Rick P. Edgecombe's message of "Mon, 7 Nov 2022 16:49:58 +0000") Message-ID: <87h6zaiu05.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Precedence: bulk List-ID: X-Mailing-List: linux-api@vger.kernel.org * Rick P. Edgecombe: > On Sun, 2022-11-06 at 10:33 +0100, Florian Weimer wrote: >> * H. J. Lu: >>=20 >> > This change doesn't make a binary CET compatible. It just requires >> > that the toolchain must be updated and all binaries have to be >> > recompiled with the new toolchain to enable CET. It doesn't solve >> > any >> > issue which can't be solved by not updating glibc. >>=20 >> Right, and it doesn't even address the library case (the kernel would >> have to hook into mmap for that). The kernel shouldn't do this. > > Shadow stack shouldn't enable as a result of loading a library, if > that's what you mean. It's the opposite=E2=80=94loading incompatible libraries needs to disable s= hadow stack (or ideally, not enable it in the first place). Technically, I think most incompatible code resides in libraries, so this kernel change achieves nothing besides punishing early implementations of the published-as-finalized x86-64 ABI. Thanks, Florian