Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1504730ybk; Thu, 21 May 2020 08:25:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqvlAEk2nqME5nZXb1Dx5O/bOYDqSlXi/GBG38T/zFoqmV7iZ699saoAyoVWk71YwcDMCJ X-Received: by 2002:a17:906:b4e:: with SMTP id v14mr4006927ejg.302.1590074745873; Thu, 21 May 2020 08:25:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590074745; cv=none; d=google.com; s=arc-20160816; b=IEcKL5Nn3F7WHS+AXH9Xh1GCrIsWBy84xVBsEDompbZe02+5OSvQE2DigNdRMJ9NIk xSi7eaVU/p3NQMcGHq98fAujdAzYKs7q+349neDj0TG1zMXxMeFGlbLmSJds8fPBrlMQ qxW/5VQqBqvFfGC8PuI74QXyt3ygs8YQGaC/WhZZ1eMAIKakRbqP2ZfQiNY7OlA707N9 WA02V4isHdun+vGxZ+Tifyulba73Uth+g9WOgLrlnblnR+HT8syO35kYw/MyrTi0/gUG VjeCNWpM5FrRSfnBWa2YfEfJU4l+Nw/4NmAEzahob9nIACu6vW5clqExS9hdwca1DbQy uCsg== 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=VuuC8gyhNLA98gHlF+iVYdqtkGo70vYEfnfHJViFpYs=; b=DBqGiSte1zGG6K2ksds4KXrVL57FkG6zGHPOzYIHj1VXckBIyg446g6f66TRodUtF2 NyhkHQfhfkSW9nkslRT42N3tw7+sA5ckkloYQx9+zDkNOMJk29MlVIG1Ho05qXytU8aP stzypuAjUT3Q/fQ0suz9uaOdlVhU+WjOt/VKjaT5cPFVVNTUPgEx7wW56K7++5rq8Dr6 NbuONzfNZaGxPnaNZXr3YxYGdhyTZWUbG7WhPqlhRZ7dTvq2M0XlUAl73zZm4MvVQORf dhl/uJ2e4tJhWkY7cIrV9JxCtcwlKnDpncprhFVyKC5mTh2SCt7xmQZl90PDQz5QzAiQ UuvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=iVZS+pnv; 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 h10si3191422ejf.487.2020.05.21.08.25.22; Thu, 21 May 2020 08:25:45 -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=bombadil.20170209 header.b=iVZS+pnv; 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 S1730138AbgEUPXg (ORCPT + 99 others); Thu, 21 May 2020 11:23:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730109AbgEUPXc (ORCPT ); Thu, 21 May 2020 11:23:32 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EBB4C061A0F; Thu, 21 May 2020 08:23:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=VuuC8gyhNLA98gHlF+iVYdqtkGo70vYEfnfHJViFpYs=; b=iVZS+pnvwRY99YET9+TtOjM1Mc Ad74dTvgf4tvHq1OTbOcq9fzBq20e1k5jiuPmWJVCREB/mZTB7Jk40ZlxXCP9i2v4lY+vga0NWCNB zJj+zdsIlDaTwxnPAbfzegn5PFCHFPRduB68HSNyeUP2Cn0wfdFRwInPxSKkt5mBpQn+jldA/u866 KhCvoefEy03GvbVMZodkSypE++hOmezIy6M/+KsAahoNYxjBvtha8sH4JFHLd5MWpzOFGah43QK8l X4lrlr13S3GiidEpQ+Kw0b90SrWTuAApTaaIpODGY4j+XtKqEBUQ6uYbL0C9MFCC2PCozSaKJkYU3 JMk3r1mg==; Received: from [2001:4bb8:18c:5da7:c70:4a89:bc61:2] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jbn2e-0004Jj-1M; Thu, 21 May 2020 15:23:28 +0000 From: Christoph Hellwig To: x86@kernel.org, Alexei Starovoitov , Daniel Borkmann , Masami Hiramatsu , Linus Torvalds , Andrew Morton Cc: linux-parisc@vger.kernel.org, linux-um@lists.infradead.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/23] maccess: rename strnlen_unsafe_user to strnlen_user_nofault Date: Thu, 21 May 2020 17:22:46 +0200 Message-Id: <20200521152301.2587579-9-hch@lst.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200521152301.2587579-1-hch@lst.de> References: <20200521152301.2587579-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.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 This matches the naming of strnlen_user, and also makes it more clear what the function is supposed to do. Signed-off-by: Christoph Hellwig --- include/linux/uaccess.h | 2 +- kernel/trace/trace_kprobe.c | 2 +- mm/maccess.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h index 134ff9c1c151b..d8366f8468664 100644 --- a/include/linux/uaccess.h +++ b/include/linux/uaccess.h @@ -315,7 +315,7 @@ long strncpy_from_kernel_nofault(char *dst, const void *unsafe_addr, extern long __strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count); long strncpy_from_user_nofault(char *dst, const void __user *unsafe_addr, long count); -extern long strnlen_unsafe_user(const void __user *unsafe_addr, long count); +long strnlen_user_nofault(const void __user *unsafe_addr, long count); /** * probe_kernel_address(): safely attempt to read from a location diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c index d600f41fda1ca..4325f9e7fadaa 100644 --- a/kernel/trace/trace_kprobe.c +++ b/kernel/trace/trace_kprobe.c @@ -1221,7 +1221,7 @@ fetch_store_strlen_user(unsigned long addr) { const void __user *uaddr = (__force const void __user *)addr; - return strnlen_unsafe_user(uaddr, MAX_STRING_SIZE); + return strnlen_user_nofault(uaddr, MAX_STRING_SIZE); } /* diff --git a/mm/maccess.c b/mm/maccess.c index c8748c2809096..e783ebfccd542 100644 --- a/mm/maccess.c +++ b/mm/maccess.c @@ -258,7 +258,7 @@ long strncpy_from_user_nofault(char *dst, const void __user *unsafe_addr, } /** - * strnlen_unsafe_user: - Get the size of a user string INCLUDING final NUL. + * strnlen_user_nofault: - Get the size of a user string INCLUDING final NUL. * @unsafe_addr: The string to measure. * @count: Maximum count (including NUL) * @@ -273,7 +273,7 @@ long strncpy_from_user_nofault(char *dst, const void __user *unsafe_addr, * Unlike strnlen_user, this can be used from IRQ handler etc. because * it disables pagefaults. */ -long strnlen_unsafe_user(const void __user *unsafe_addr, long count) +long strnlen_user_nofault(const void __user *unsafe_addr, long count) { mm_segment_t old_fs = get_fs(); int ret; -- 2.26.2