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 117FEC433EF for ; Fri, 25 Feb 2022 17:57:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230456AbiBYR5o (ORCPT ); Fri, 25 Feb 2022 12:57:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229988AbiBYR5n (ORCPT ); Fri, 25 Feb 2022 12:57:43 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CB0323932E for ; Fri, 25 Feb 2022 09:57:10 -0800 (PST) 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 9D49761DF7 for ; Fri, 25 Feb 2022 17:57:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01C27C340E7; Fri, 25 Feb 2022 17:57:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645811829; bh=7EC7CurlJ2+rojCUecIh7IA54jOvEz9qPpBDG8aDah4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VfcHG60ZayCxwPSFPHvMx6XD59kwPvyIkg2o57eRI+ZzBlzhsEqj5qcr/J8I01n4v CZnJ2oj/OrP3l5UHBHzLFRJErZyRXQG3hO5Cd/twgzPjI68b9fzcwDTAeehmud6PNl HNLkTZ+e91/Rs37PZgCL0Wdh2kbbdnh8FuD95wChE+a9YhRsHD8iadegW2Ng/TIjwP gtpTu7k+iXYET2heYMHWFRCpwIAhykB4ByIkFPK/dvsrwmHb7qjOapXVNAbB7yWs3E R+AFraU4wu2MA/Wu7koQBJAJv2nmkzxccQfIc5pUmMsEQogv7oPki1xPoPv7SioaCq iF4a2af9JqVLA== Date: Fri, 25 Feb 2022 17:57:02 +0000 From: Mark Brown To: David Engraf Cc: suzuki.poulose@arm.com, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, elver@google.com, ebiederm@xmission.com, seanjc@google.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64: signal: nofpsimd: Do not allocate fp/simd context when not available Message-ID: References: <20220225104008.820289-1-david.engraf@sysgo.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="i/KIkU1c0QvDzdkK" Content-Disposition: inline In-Reply-To: <20220225104008.820289-1-david.engraf@sysgo.com> X-Cookie: I smell a wumpus. Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --i/KIkU1c0QvDzdkK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 25, 2022 at 11:40:08AM +0100, David Engraf wrote: > Commit 6d502b6ba1b2 ("arm64: signal: nofpsimd: Handle fp/simd context for > signal frames") introduced saving the fp/simd context for signal handling > only when support is available. But setup_sigframe_layout() always > reserves memory for fp/simd context. The additional memory is not touched > because preserve_fpsimd_context() is not called and thus the magic is > invalid. >=20 > This may lead to an error when parse_user_sigframe() checks the fp/simd > area and does not find a valid magic number. How did you spot this - do you have a system that can reproduce this? It'd be good to have coverage if there's testing but there's no easily obtainable userspace that I'm aware of. --i/KIkU1c0QvDzdkK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmIZGG0ACgkQJNaLcl1U h9C3ngf/QVQUvOqEqNwrKMCVGAAA4u6ED2XJUfxIepnQgMkG6105crKMXk+fX3fx 6OHCW611IHLqi1yCvP7oP5GHQJ4tJLIwfoWnLEMWnqglm6dJ8KFRzx4KtDJTlCAt dqLBEgPIVElQzsiQvk+Jn4GAAmje3hUSDBHya8QHpSjwKNHVr7WUWut9wsWefCTJ gJB/3OEzFRj22lxlxKeyacYS8eXric9+SzmrzEScwgIKh+Er1XxNVaeoqMilrS2G ivD5BseIx/kuh5X3nO+u1ugwD2WRBBIW425GY/UxWY3wuKQQDPjpbhnk3N8XwIhC SHOtOEflhbXPtFwbXSxfSAjeq83DBA== =fMPl -----END PGP SIGNATURE----- --i/KIkU1c0QvDzdkK-- 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 A4C3AC433F5 for ; Fri, 25 Feb 2022 18:21:11 +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=OuqenFOk90aYMFEg/qosoneuR6YgC02Aq/Y9RXI3KxU=; b=ImX/k1Jyq8h9zDgN84ImGFpdOg w9K0nptxjoybvsInN+U6NrSweCudrX/AqN0OJs/KVbFlaIpQfs/H1wOetZjImXpQXYmXOHkkW7E9/ BuRdyJaJOjTlWIu2EofvxjMgyuf1BTjNxBuMWylmy5zIaaPqkOTZMmNWgS3BZ/CwoWKPmM1SwV23r qCE8ruSHfYV62j6mkD6+2faQU3yzkP/KXuCK9eTRbQ/ZCzm1a3DjGiwslPs8TMnpY3jHZqGWh4fpF 0QqKEK2u/fYe8Q61MlxcONXkyGZO343PsX3cGRgbSIS38etvkDuee/Z0NNXWhJoQA3eoQLB4BQy5g AaZP/nNQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNfC0-006XzL-Rg; Fri, 25 Feb 2022 18:19:50 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNeq7-006Or0-4V for linux-arm-kernel@lists.infradead.org; Fri, 25 Feb 2022 17:57:13 +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 A046861DFF; Fri, 25 Feb 2022 17:57:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01C27C340E7; Fri, 25 Feb 2022 17:57:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645811829; bh=7EC7CurlJ2+rojCUecIh7IA54jOvEz9qPpBDG8aDah4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VfcHG60ZayCxwPSFPHvMx6XD59kwPvyIkg2o57eRI+ZzBlzhsEqj5qcr/J8I01n4v CZnJ2oj/OrP3l5UHBHzLFRJErZyRXQG3hO5Cd/twgzPjI68b9fzcwDTAeehmud6PNl HNLkTZ+e91/Rs37PZgCL0Wdh2kbbdnh8FuD95wChE+a9YhRsHD8iadegW2Ng/TIjwP gtpTu7k+iXYET2heYMHWFRCpwIAhykB4ByIkFPK/dvsrwmHb7qjOapXVNAbB7yWs3E R+AFraU4wu2MA/Wu7koQBJAJv2nmkzxccQfIc5pUmMsEQogv7oPki1xPoPv7SioaCq iF4a2af9JqVLA== Date: Fri, 25 Feb 2022 17:57:02 +0000 From: Mark Brown To: David Engraf Cc: suzuki.poulose@arm.com, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, elver@google.com, ebiederm@xmission.com, seanjc@google.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64: signal: nofpsimd: Do not allocate fp/simd context when not available Message-ID: References: <20220225104008.820289-1-david.engraf@sysgo.com> MIME-Version: 1.0 In-Reply-To: <20220225104008.820289-1-david.engraf@sysgo.com> X-Cookie: I smell a wumpus. X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220225_095711_250020_58FFAA05 X-CRM114-Status: GOOD ( 17.04 ) 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="===============9111048742110220101==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============9111048742110220101== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="i/KIkU1c0QvDzdkK" Content-Disposition: inline --i/KIkU1c0QvDzdkK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 25, 2022 at 11:40:08AM +0100, David Engraf wrote: > Commit 6d502b6ba1b2 ("arm64: signal: nofpsimd: Handle fp/simd context for > signal frames") introduced saving the fp/simd context for signal handling > only when support is available. But setup_sigframe_layout() always > reserves memory for fp/simd context. The additional memory is not touched > because preserve_fpsimd_context() is not called and thus the magic is > invalid. >=20 > This may lead to an error when parse_user_sigframe() checks the fp/simd > area and does not find a valid magic number. How did you spot this - do you have a system that can reproduce this? It'd be good to have coverage if there's testing but there's no easily obtainable userspace that I'm aware of. --i/KIkU1c0QvDzdkK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmIZGG0ACgkQJNaLcl1U h9C3ngf/QVQUvOqEqNwrKMCVGAAA4u6ED2XJUfxIepnQgMkG6105crKMXk+fX3fx 6OHCW611IHLqi1yCvP7oP5GHQJ4tJLIwfoWnLEMWnqglm6dJ8KFRzx4KtDJTlCAt dqLBEgPIVElQzsiQvk+Jn4GAAmje3hUSDBHya8QHpSjwKNHVr7WUWut9wsWefCTJ gJB/3OEzFRj22lxlxKeyacYS8eXric9+SzmrzEScwgIKh+Er1XxNVaeoqMilrS2G ivD5BseIx/kuh5X3nO+u1ugwD2WRBBIW425GY/UxWY3wuKQQDPjpbhnk3N8XwIhC SHOtOEflhbXPtFwbXSxfSAjeq83DBA== =fMPl -----END PGP SIGNATURE----- --i/KIkU1c0QvDzdkK-- --===============9111048742110220101== 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 --===============9111048742110220101==--