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=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 ADB9CC433DF for ; Fri, 10 Jul 2020 13:57:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 889DA207BB for ; Fri, 10 Jul 2020 13:57:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="TLw7FcKO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727061AbgGJN5P (ORCPT ); Fri, 10 Jul 2020 09:57:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726820AbgGJN5N (ORCPT ); Fri, 10 Jul 2020 09:57:13 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B434CC08C5DC; Fri, 10 Jul 2020 06:57:13 -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=TLw7FcKOx/J3rJJLHO1uwPsxbU qCr32vMX3YIHMLwj8rYB/m1Gr5BAGjsVbdVF0guFsdtHfoOOzRIN66UZEKN2aLGdXm+xW/Abx/qt/ 02CU7VJ4COqrSPT7WbNAhbEEshaYNNMsX0ooRRVoQLhamuZzb3t1Z3/MqFq7mBEqcs176+aRo8Xc+ UyyKU0TEmW1qfFRWR9msKPCHgVrFapZar9l/au56KaAT4I8YZEw94sZ2KmJfUOwlbmy8JUUJjOCqk q/yd9g6uGQljMMl9jMKackS9xAAS8OsfRAQ/8YTsES3sjxnZTjjyryLAn25I/DELDwHNP3SoieCH4 xiIckrAw==; Received: from [2001:4bb8:188:5f50:c70:4a89:bc61:2] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jttWW-0004gU-FH; Fri, 10 Jul 2020 13:57:08 +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: Fri, 10 Jul 2020 15:57:01 +0200 Message-Id: <20200710135706.537715-2-hch@lst.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200710135706.537715-1-hch@lst.de> References: <20200710135706.537715-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