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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 43FB3C43334 for ; Thu, 14 Jul 2022 12:08:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=J5L5fZdggA5owjuVBfqbOaXvmjszyTM5OrzplKKCrjo=; b=i6t8553ZdAVAW7TiRFg2AD7qC+ z6BBa5vG/vbfWD2My75ELbp1nRKaiatcuGS4ZSzNqR9TqtHAOfJvURayeO2uIZRskE7zg4iO2Plz6 MxdDuglWLTHM/jh5q7nie1q3T9jfTF1z/oQOYaWQJ+J1pedvVSpWkn5wELlhd4s7ejnN+em7+gSI2 cu7tWx0Kyw5k0+J2iCmueyAlti7voF2se4pprKolxQLKe9jjl7nHtPqaw5jH7mKL8OlqsTFIpD2h7 WIHJ/h9IlpJhOxnxaxYNx7BASFHfAsnzrRnqanbkXWvDDPVre3WgEm/0LQ/RwkzPzsRTlq21jKM8C 5kxwIT9Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oBxcJ-00E3cM-K4; Thu, 14 Jul 2022 12:06:51 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oBxcC-00E3XD-5E for linux-arm-kernel@lists.infradead.org; Thu, 14 Jul 2022 12:06:48 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B038461E16; Thu, 14 Jul 2022 12:06:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC669C341C6; Thu, 14 Jul 2022 12:06:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657800403; bh=Hx7EerRWspqOHGQhu1Nyu8KtBaepz8d9zyknE3mK94U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SGn1Fryl60GNhiXiHxGknPX80PVIEE1YqHxRdSgS/mMZ4eSuyKgyOAp07GmOa/WLy d0xCI7cs730a0586zkVV5n+5TX7MzGcskiHpmKEIkZwJJaHdxew7feRSGAOV8bUnT4 E7uEi007P9nR82eIwtkUF43L8glDoL1PCVjReJ44/0FWsxt7DT78bNGR+fSfEg6LTe ffcGL3OU9HTH5hjJTWMay/kpD4udC1pWbTmVpHvMQubvymgwltVLl6BnvA7shMYqLK eENDLcqLQEwQYcQiFvhDXdP8vfsr1JdMEHNQ5nb1eDRu+JHTABU4zgUEQxVHqadC71 4NoK3R/PhcO9A== Date: Thu, 14 Jul 2022 13:06:38 +0100 From: Mark Brown To: Mark Rutland Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Kees Cook , peterz@infradead.org Subject: Re: [PATCH] lkdtm: cfi: add test for HW landing pad CFI Message-ID: References: <20220713151815.295520-1-mark.rutland@arm.com> MIME-Version: 1.0 In-Reply-To: X-Cookie: The devil finds work for idle glands. X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220714_050644_259179_92185BC6 X-CRM114-Status: GOOD ( 17.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============2502760252634110839==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============2502760252634110839== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="vUqi5N6saZo+b+5S" Content-Disposition: inline --vUqi5N6saZo+b+5S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jul 14, 2022 at 12:31:54PM +0100, Mark Rutland wrote: > On Wed, Jul 13, 2022 at 05:13:57PM +0100, Mark Brown wrote: > > Not sure that worrying about that at this point isn't making perfect the > > enemy of good though, it could be dealt with later. Perhaps just put > > the offset behind a #define to make it a tiny bit more discoverable? > How about I just add a comment for now? e.g. > /* > * Skip past a landing pad instruction. > * On arm64 all instructions are 4-byte aligned, and x86's ENDBR is 4 > * bytes. > */ I'd rather have something that will definitely either fail or skip the test so it can't silently pass, if people need to look at the source to discover this there's more chance they'll mistakenly think things are working. Something like #ifdef __aarch64__ #define LANDING_PAD_SKIP 4 #elif defined (__x86_64__) #define LANDING_PAD_SKIP 4 #endif then #ifdef LANDING_PAD_SKIP around the test perhaps? --vUqi5N6saZo+b+5S Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmLQBs0ACgkQJNaLcl1U h9D0fwf+LE6b2NeOigHSnJohAeum7jXyIHODkNDIDNZRs5B4vZve48iAYxGL0buI 6tCNF9HOBP4tloeq3Mnwo4kIk3A3kXDXPhzfBAXbyhJc/M4G2DQTJi6tNtonwZEW 64hkhk5mP9S4g881UDyoOmIEQLUHIYgo7dECOWIIbvUUs1oBMB+yiSSPHfjxYIp8 spULH1c4KaLnXpKq/CSDo4ZRxbzLPDvWVoGu5JscTvy5+VfcB9BvT08QeNbnLWSi 9t8uXmisRHS9MvlWy8YRmsTv6CticLzc/p0aZBMWC+fT/NFEds524C+XBqQxfwbq nxyCydp9+WZPuZIB60PA/v/FpdbBKg== =suLk -----END PGP SIGNATURE----- --vUqi5N6saZo+b+5S-- --===============2502760252634110839== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============2502760252634110839==--