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=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 927B3C433ED for ; Wed, 21 Apr 2021 19:06:38 +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 EE9CA6140D for ; Wed, 21 Apr 2021 19:06:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EE9CA6140D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=gJRAfiS0aKjIuKmxDyknn118Ah0uW92koRuIPXAFZkI=; b=FbHbHcjDMJ5q+7BoUsxZ8hpwk kmQgR8jRv6ocj9nLN8Cc412DZmaweJ56eqoRwfsHcW/+RYfWETTCm0kdTegzwjwnuMqqRCALf1/MO vEcg1Ewt2un3cKRy0uk40BP/yXQU6fqFjIst4QJtNJxrzqUnvyDvaugw2vrCRqhqg6qgif94mmtn0 zztMOpKAEatOL1jMznS1Ior+L28O7xY4k7F270cojwpYq42G2RdUvrYfwbftKVnPWhOTQUe3bsjkR eSm9WJzd4EsNnGUM2nICyzjS51CBSfjcBoKq8l+Sv+7HHRtQtKT8E2wuBYpTBnChJCsfJGcZXt1Cj EZOwUgkuA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lZI9A-00EzWt-39; Wed, 21 Apr 2021 19:04:24 +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 1lZI7S-00EzJg-7N for linux-arm-kernel@desiato.infradead.org; Wed, 21 Apr 2021 19:02:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=5gtHRujbA++rmZKVlVKXeDrh5bnEaeS8o439txwjvSA=; b=qX/VU2JaxIlJGO5ocpdeBAVQ2V LOQ7XME2djqabfamKOFTeO+4I9+UjRkzXoRSFj+4mQrOJiY0TN1HrVRHEfhD6fs+4VIxcG1JtCpVn 84/WYFPnH12k4fsiVjgu50XYkgcv2Sx+jT8DHi5PLWG5tidXOtgF3Kdl1laARwN4seNqaInL7yFvH MVHZQWcoX19Bbln6aChtc0LhoaWT4Rglj2iW/DOmSeqfxYF51aK6vJfxMELxjCKgai7iZqx+ZHV9i wxdtM3W+ftXvyTsaQUjOgXheFtm1S9Tr+v/kuw5yw7rv3MEOTtIVeFD9/7XEJTMgCESCT6jD0PKbW aLQnHMBA==; Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lZI7P-00D7U2-Qi for linux-arm-kernel@lists.infradead.org; Wed, 21 Apr 2021 19:02:37 +0000 Received: by mail-wm1-x32c.google.com with SMTP id p10-20020a1c544a0000b02901387e17700fso1781537wmi.2 for ; Wed, 21 Apr 2021 12:02:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5gtHRujbA++rmZKVlVKXeDrh5bnEaeS8o439txwjvSA=; b=sx0dJlyll3Ak1gdIDN36PNhnkQPIsM9aH6oda1ACWLS+6hySaNomwDDRcb/XNUswan CXPeWXj31qPp0EdPvs8ijfe2myLn8tBx5wABsYCzM+4+YItns809fbqF8bvdtmfFZMxc iT3YWny3zL10SyZwb9LpHqoa5rlKosxff7vNrVFabB/sNZPz2ZT8KHM7RbgSPlT6OwWV HQ2RFByDRG+vWB7XcqFJ5TBf9LPvnJ3Ict1w7fuHO+9eCGBwQ7cBFyjUSuOOtbwd/H6s bk5bCx/PdFeRETzSuomp4zt1S8oMQC5PZjWe3eA8MeY4s9azL9ONQkVsLyQq4xESTQZQ VtrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5gtHRujbA++rmZKVlVKXeDrh5bnEaeS8o439txwjvSA=; b=RAYh6DR05UoFOHdV0YznL3XObhAo93iQR0QpKrTYCiauOfhcsFyHEwYEQIlsuf9r+5 RdqpAnCF0Rup4XSprEj23dhkp5i1v5KED3pc5hzYKILW1zdD+au7qOoCbcK9II20xEmS HKeNmuRsDKJOG8psPNEXIO1A/AVhzfjm4qC4HtFTSnwuIScouXAeIePFVFggrIZKmRJC bqKoAXXNNB3ePBCTLsRxIjTFLZ7npyLux+Z5F7UrIGmdgaWB0WFWK7VwInr2J3aMoMzR bvOJlYukQ1XhMhsRkW/hL+vRJ7Zrp6WN5qAaUcSPrcTALoQkvOr0jIPluL3v4pJaYEGX tWsQ== X-Gm-Message-State: AOAM530RsDJAX6jbBlohxLUmf4/hbLtBzKQqbImVevU2I6dhWNFr3/gf k9dEWLHWonOxOHVKT75+lPy+3dcrL4+Guzzk X-Google-Smtp-Source: ABdhPJwVt7KdAimqP6Cmp01IiPC9rAolIjb7tKdmjFcJt7yuZLvs5XHYdpeYmzkKFIbw8SaRPEcuPw== X-Received: by 2002:a1c:f313:: with SMTP id q19mr11176181wmq.142.1619031754469; Wed, 21 Apr 2021 12:02:34 -0700 (PDT) Received: from amanieu-desktop.home ([2a00:23c6:f081:f801:93ef:94e:9f8:1f0]) by smtp.gmail.com with ESMTPSA id d10sm310829wri.41.2021.04.21.12.02.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Apr 2021 12:02:34 -0700 (PDT) From: Amanieu d'Antras To: linux-arm-kernel@lists.infradead.org Cc: Amanieu d'Antras , Ryan Houdek , Catalin Marinas , Will Deacon , Mark Rutland , Steven Price , Arnd Bergmann , David Laight , Mark Brown Subject: [RFC PATCH v3 7/8] arm64: Forbid calling compat sigreturn from 64-bit tasks Date: Wed, 21 Apr 2021 20:02:06 +0100 Message-Id: <20210421190207.1803139-8-amanieu@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210421190207.1803139-1-amanieu@gmail.com> References: <20210421190207.1803139-1-amanieu@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210421_120235_887658_DE78773F X-CRM114-Status: GOOD ( 12.49 ) 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: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org It's impossible for this syscall to do anything sensible in this context. Signed-off-by: Amanieu d'Antras Co-developed-by: Ryan Houdek Signed-off-by: Ryan Houdek --- arch/arm64/kernel/signal32.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm64/kernel/signal32.c b/arch/arm64/kernel/signal32.c index 2f507f565c48..e2bdd1eaefd8 100644 --- a/arch/arm64/kernel/signal32.c +++ b/arch/arm64/kernel/signal32.c @@ -237,6 +237,10 @@ COMPAT_SYSCALL_DEFINE0(sigreturn) /* Always make any pending restarted system calls return -EINTR */ current->restart_block.fn = do_no_restart_syscall; + /* Reject attempts to call this from a 64-bit process. */ + if (!is_compat_task()) + goto badframe; + /* * Since we stacked the signal on a 64-bit boundary, * then 'sp' should be word aligned here. If it's @@ -268,6 +272,10 @@ COMPAT_SYSCALL_DEFINE0(rt_sigreturn) /* Always make any pending restarted system calls return -EINTR */ current->restart_block.fn = do_no_restart_syscall; + /* Reject attempts to call this from a 64-bit process. */ + if (!is_compat_task()) + goto badframe; + /* * Since we stacked the signal on a 64-bit boundary, * then 'sp' should be word aligned here. If it's -- 2.31.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel