Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2151122rwb; Mon, 7 Nov 2022 09:43:14 -0800 (PST) X-Google-Smtp-Source: AMsMyM7d4PN1HuKbOgaCj6weE2J+YaN9Q4qLgWUcSWpekoiLBMz22kpN+UNJVq29tD09wWkZtqQE X-Received: by 2002:a17:902:e313:b0:187:3c62:5825 with SMTP id q19-20020a170902e31300b001873c625825mr33448574plc.41.1667842994579; Mon, 07 Nov 2022 09:43:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667842994; cv=none; d=google.com; s=arc-20160816; b=a2EIHMBkjO2SCbJtsg6rpWtIQDNf0+dIePtBVB0FRcHtjEQ6vIVqkwFnw/a9MLk7xn Y7iq7oNJ0QoCa+TWMkA/JvVe2HAUo3LjM0PLl10+l0TxlXT2ewiQoW7Pz59kVxSgi3dy Rtd3z3/6X91aoH2/ue4g1GcklczitwSRT+ffdAKYxyRv04PcIcsIAfCXehIop8Srnnxe 0hgE/CRoNHEdGwOQX5uti2ZDyF9SxMOxUcF9k/cDs+xjWo6QzWdeycVE8qlT1Odbb9mX zXx7dU9T2FA67pUmAfMrskUDtawEucG5iSCC5nGpsKj/OhY36UATeUlZOFNyopJ9ntsx L7Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:dkim-signature; bh=T50w0nkUuy7T2kUqSnZIRriHtEbo2iSXTPmDVdxQoV8=; b=znEOZCxWHM90DwzGFGrnORQ0KP41EOJWpJJUdWjddD0R9fdSJI41R9VlwMPOwtzvjW uqaJaH7HUyORgK3hK7YftAqcS4lTkEd6m/dst+4Qz1xfkq9lebP3Ub2Q6KjHVmqEYKw2 C2/9/qErQyVBUM3BMFeoPBC2mGgzCZMplP6Bis2LITRCvMoAjn4GtO1iLj4SWHQiRjX0 jAbDFUBg35guEjfsmrnV7qlFkHhNFpmGmyII2ilnqa7l6S+m9nNWoeceCH+5/6TX7EE+ 67sB3rQlXoGe4e/3zD4uJGj9+biyATjS9mPF+Iplv5z5w7wHHU2Wljm4VrXgAk6lMGxA YkbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="DQrz2Ul/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e14-20020a63544e000000b004702c91d8f6si10974198pgm.116.2022.11.07.09.43.01; Mon, 07 Nov 2022 09:43:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="DQrz2Ul/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232892AbiKGQ5G (ORCPT + 92 others); Mon, 7 Nov 2022 11:57:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232901AbiKGQ45 (ORCPT ); Mon, 7 Nov 2022 11:56:57 -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 060E52229A 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 X-Spam-Status: No, score=-2.1 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_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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