Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1659189ybh; Tue, 14 Jul 2020 04:02:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfU74TVPjaEc2LwmWTSETo+atq1SgcyPjExKMIFKN7GzrQrqfyLOHSuNkSR8zyCSgUST+j X-Received: by 2002:a05:6402:1507:: with SMTP id f7mr4092620edw.37.1594724527643; Tue, 14 Jul 2020 04:02:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594724527; cv=none; d=google.com; s=arc-20160816; b=fU6ba0ltvJH0B45uMXHJJaAU6Y/wWeW+v1S9Km8ttMP6pfSZ5Ex9E1Vrgh/qvtGl8w 5NoDZGSKt6Rkw8kqyLX4j3yoG/e5I25+h3EgLid2ak8nLOsOzoophH8nX+j2v7KF6RdF HLa+cQwAar2R1KBSnY/gQfRdhWEKyGRR5Ap0wqUkwh51+fF53rNSCNIoZT5vAXTTauRG slbHo7X2hCE9ZExijkG8qeeGFmR399AhdXtZRI69Hxvhpd/4tEpjwaPa92wdamBec3vJ r6nZJOaJK5dFJQHQezeRh3gOr1Zh4fChUxOmEvNlUX9QVJBlbFDQ5Lrj5yMZS18gi4lX 4rMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8kIpdB7MOVPeE6Mtm6qS57nGC+Nbr8eHQGmiVAURoO0=; b=f6dytbjeNpohAut8uUDT/dI/kQo+cJ3Mcf3V9wJT2AbIUzoXG9tVOdIi+GqEny1AiC yUk9sVOfI78X3w9nsnORT0QCxgsNjPXeyU3S4ODIV9BXXDv2L1OZZu1pvKjWRoMTJNmQ nT3IGqn+x9EV5LH5/DR6NSyhmmHci4CfognanjzTIIYtrU/gh1aGAyBCbTX1Fhn1y8Ho WwqT4hSTSDl5Wq40RF85f28PDBfxSRCdPSAibXwNfv/yWozSXdRek5v4ArXXFn29wSj6 lFElFLaZWmkN1OPxW4nWB6kHXovjfR1hNrpRrQHxvrFfkDlvIDOKl6SAtyKwpWxLUYnQ nrJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=Y7Egjcf3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q26si10062026ejc.433.2020.07.14.04.01.41; Tue, 14 Jul 2020 04:02:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=Y7Egjcf3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726715AbgGNK7d (ORCPT + 99 others); Tue, 14 Jul 2020 06:59:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726041AbgGNK7c (ORCPT ); Tue, 14 Jul 2020 06:59:32 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8294AC061755; Tue, 14 Jul 2020 03:59:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=8kIpdB7MOVPeE6Mtm6qS57nGC+Nbr8eHQGmiVAURoO0=; b=Y7Egjcf3jjfOrfhxpS00WHCSu/ 7+sVXf5y3GzUV7zX3zJjYmm8deI9zyULqJUYesggLwFRaA+jOjsxongcjp8mxAoAG8K3HDdINJd6Y vpNJTkxpMrx1z7EoGeksBRSNefcuskiLd65m0OFcEBbp3J4vlBaubVusFTxRdWpP4YXOgd3ykjh13 0cY6HbeK+wpHET1t/nPFQv6pVsBgQwSTNwIFtZIdVXf2LPGrbKhTmqbBUOuafwzpQ57/9MR+JyPNQ 0TVBYyjEfWaK73wyPMWy2TfbXz1SCQ/fGAnTWWvXRC4QEQl48YTr2nCyTzsIvCCaXVmU2MEreblnJ eshrFJFQ==; Received: from 089144201169.atnat0010.highway.a1.net ([89.144.201.169] helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jvIem-0005up-87; Tue, 14 Jul 2020 10:59:28 +0000 From: Christoph Hellwig To: Nick Hu , Greentime Hu , Vincent Chen , Paul Walmsley , Palmer Dabbelt , Andrew Morton , Linus Torvalds Cc: linux-riscv@lists.infradead.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/6] syscalls: use uaccess_kernel in addr_limit_user_check Date: Tue, 14 Jul 2020 12:55:00 +0200 Message-Id: <20200714105505.935079-2-hch@lst.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200714105505.935079-1-hch@lst.de> References: <20200714105505.935079-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the uaccess_kernel helper instead of duplicating it. Signed-off-by: Christoph Hellwig --- include/linux/syscalls.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index b951a87da9877c..e933a43d4a69ac 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -263,7 +263,7 @@ static inline void addr_limit_user_check(void) return; #endif - if (CHECK_DATA_CORRUPTION(!segment_eq(get_fs(), USER_DS), + if (CHECK_DATA_CORRUPTION(uaccess_kernel(), "Invalid address limit on user-mode return")) force_sig(SIGKILL); -- 2.26.2