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 X-Spam-Level: X-Spam-Status: No, score=-6.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7DF8AC433B4 for ; Thu, 6 May 2021 13:48:31 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EE3D1610FB for ; Thu, 6 May 2021 13:48:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EE3D1610FB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; 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=Tav1SUgFMdXn4op4UM6W9bNt6M+Y/s/ZNFFD8r2Nhxw=; b=ee5MIxdhWbpSdL1ENP9IFM3IQ 11LSp4RtbkFrYN8q1RiK0nyK+Pbqewj8Td9Y7SK7gcZAwE3wSmOpMh/WBbq+RCzVmZAqqGQWkkl5w U6uEctIxXPAQZhESypJy76q35RR+gWRiA6Eyy9825t/4A96rnSVyAJVddk0fu/QwA8d0DvLYpOmG4 5fxBZSCo6GfFDDmRrGRCOu6aqcCtvsY667WTRD9YDeLq+m2VVel4iuumLDan3hI9oLJ37i6QYOtPD xb9uj1XlUdU0AtyDQ/O5n1xocWgZPijx6QgFnJ5quEHIWBg4e6EvnONsFZg+Qc6AkVb8umopmXa4v sMnbb3i+Q==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1leeKh-004MxE-4Z; Thu, 06 May 2021 13:46:27 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1leeKc-004Mwl-Ra for linux-arm-kernel@desiato.infradead.org; Thu, 06 May 2021 13:46:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=qdoQd7krsEUymeuQLhQCt1CjoNS05e0B2jZiFOnSCRo=; b=ilC/7+lSGzsH3hrImb1YDrPwuT O4Az/2uEA36ir5KOmdAqiLrUCGmX66i4T6W1KAWsrQmU0TqcCSzbXxs4Tgfuxpt7wmHjXSzocW1xz jOVJy6gNVFGsGMZsybwE7BBeB6NQokuwJiDk9nm5k0sw2CoOciwYCfjgBnQtTjWY7oT/0G4+/RcQA P73uiTYU5Bd0B9hxl4Egd38cz1kkJTKIuGgfx8Eg00myv6VKaA7SBf6zR82cK3OHAmnzrJsbFOKiJ jdbDVsrU8Pf/HxsUF9eAYeN/z3gtH7a/uPQ4ZWVj8JgkdgIDIAkIeZo2xXg8s7BnpYusPGj1mXDG4 I6QZEl1g==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1leeKa-0064J4-90 for linux-arm-kernel@lists.infradead.org; Thu, 06 May 2021 13:46:21 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0F48B61027; Thu, 6 May 2021 13:46:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620308779; bh=DIhfGeaxAF5Hk1en/OO3GvL7gcgjS1Hb4ylbBzg5nFg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BP76V0dtuhX8xo3/WhwVAhFBvwQw/u0q/Bm4dNSZ7G+jWlXSGETVAWYMiWpc5FLLR JjrJ/ZmrdDfvr1yhrf0ckiraPrWFWODcxxdZGfyhxMDDS285T8WE563w85ZMv8oLxQ nbema7O1knM88idtTdkEuQ+dvPt95isyfmZR5UTHGpMeZt9ViZmIN6RxdzbqGfumbQ UzVj0LqXPvK+hbOGLlIGcicWuKbxuU62UVD0K4U5lqnC9z/7ZEHphFreZGpS3a6osC lXhqEng1JWhFws3MTGbSY2ha2AMZGG84+LTtq4QlkIA/ezLpwiItqYgG0QumEUOIZV 8TuYmpLSNjF1g== Date: Thu, 6 May 2021 14:45:42 +0100 From: Mark Brown To: "Madhavan T. Venkataraman" Cc: jpoimboe@redhat.com, mark.rutland@arm.com, jthierry@redhat.com, catalin.marinas@arm.com, will@kernel.org, jmorris@namei.org, pasha.tatashin@soleen.com, linux-arm-kernel@lists.infradead.org, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v3 2/4] arm64: Check the return PC against unreliable code sections Message-ID: <20210506134542.GD4642@sirena.org.uk> References: <65cf4dfbc439b010b50a0c46ec500432acde86d6> <20210503173615.21576-1-madvenka@linux.microsoft.com> <20210503173615.21576-3-madvenka@linux.microsoft.com> <20210504160508.GC7094@sirena.org.uk> <1bd2b177-509a-21d9-e349-9b2388db45eb@linux.microsoft.com> <0f72c4cb-25ef-ee23-49e4-986542be8673@linux.microsoft.com> <20210505164648.GC4541@sirena.org.uk> <9781011e-2d99-7f46-592c-621c66ea66c3@linux.microsoft.com> MIME-Version: 1.0 In-Reply-To: <9781011e-2d99-7f46-592c-621c66ea66c3@linux.microsoft.com> X-Cookie: If it ain't baroque, don't phiques it. User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210506_064620_372592_829F0A05 X-CRM114-Status: GOOD ( 20.48 ) 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="===============4296817677758057330==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============4296817677758057330== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="OaZoDhBhXzo6bW1J" Content-Disposition: inline --OaZoDhBhXzo6bW1J Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 05, 2021 at 01:48:21PM -0500, Madhavan T. Venkataraman wrote: > On 5/5/21 11:46 AM, Mark Brown wrote: > > I think that works even if it's hard to love the goto, might want some > > defensiveness to ensure we can't somehow end up in an infinite loop with > > a sufficiently badly formed stack. > I could do something like this: > unwind_frame() > { > int i; > ... >=20 > for (i =3D 0; i < MAX_CHECKS; i++) { > if (!check_frame(tsk, frame)) > break; > } I think that could work, yes. Have to see the actual code (and other people's opinions!). > If this is acceptable, then the only question is - what should be the val= ue of > MAX_CHECKS (I will rename it to something more appropriate)? I'd expect something like 10 to be way more than we'd ever need, or we could define it down to the 2 checks we expect to be possible ATM to be conservative. I'm tempted to be permissive if we have sufficient other checks but I'm not 100% sure on that. --OaZoDhBhXzo6bW1J Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmCT8wYACgkQJNaLcl1U h9A5/Qf5AQzIK1iGk05+Ew7d4dR1Bd1YEuSiIlmDHZ+9WIWaZ0SR0GNG5mtqwX1B pJhBkSXH7XsChPi1INElGPgOomaF8H2V2Z7C/QUI/KW1PqyQHmlFOQahHNPaRn6/ kxuuG1prGKfuPZ2+wFCdJZXHk1FWm/VpjVpiweX/E0kzx+V8NHNbKFwMuBSNCEH6 Jo8VMKsTSMghThbfpVAuYxPCaJB/kCaYU1KQL2Ktzq+n0CXsOdyHXolOE9D/0N8A KgLCewUwIOpFXU+8gJspoxYXd1VIEzRG+lgKwCYuv6XBCZIOK2cXLvtPMU4xw9wj mVA3fT2D8o0uPAQF+2Zy24K/f6wbgA== =eeY2 -----END PGP SIGNATURE----- --OaZoDhBhXzo6bW1J-- --===============4296817677758057330== 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 --===============4296817677758057330==--