Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp620803ybz; Fri, 1 May 2020 05:37:50 -0700 (PDT) X-Google-Smtp-Source: APiQypLZNCM6z8UXGzs0NdaLWKSA9arZgz6fm53RDkd0M6t6yoxCxmOLMVkGEU3sCNBPNXNIfUIF X-Received: by 2002:a17:906:4eda:: with SMTP id i26mr3023222ejv.180.1588336669900; Fri, 01 May 2020 05:37:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588336669; cv=none; d=google.com; s=arc-20160816; b=rS6+rw9HQYiaGUQaUwddXXYFB6R9cxvGpHBiXscJXodY+bmh/qENdUM1LcH4HA9lZS 7VRd52bcA2ENxDj00kBbiTqxg/PHp9Zl+t5SQdQ5BYDjyBoJLTSGC0rJv4fH4IuYFfis pJqcMnSNxuMSFGAhpvBbhty0snNnRHfkxzrJ88+khLs9eWgcnvgWrBKrju20NCyM+VqU MsZ22HW2sgwf82SqfUYldUH6O4wbXBrW7i4ghW04jykIxN2HpBKJL/dXJ80Mmd7cmsJs iMPgmDVsiuvOIk0SbhQyGTIsE7U8habCLz1ZsMg/fwP4o7OOxbZB9yjI9SLMSQVL/spc BqWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=i0w1XvvvNEeQ8/SDOP5BmNxiGkiniSG4kmik5XFiNSA=; b=stifkGQdpmrxV1tlCg4fXz12CAYSUu31VWXWnHrWf3gFifD0fphhJH84SGzrYxtT6r i0u7DZrJ1aP2jcqgWr1j4gx8y1gduUwGyUhf8klMAoDDEcioYOd/pL/asnEd1P3WEuzt 3ur3rFPAKYEnGnY5ioSlpahmCZxp7t2cpX6vG0aIjJI9EfaJsx+yHOdjjx7EAK67WUnI tKw4kodEuDBNRuMwu54gjPFOF66kbwtvcls3Befjv6cGRM1w/Q77gDy/t1LJ52iBaP/z GFt4D15dbBJNiwAQMxQp/J+Ad4rbbdz58rH6JKndH256Qd8EXtesgPxTDV88d/V/7UjE ievg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=ArjHkPiB; 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 u2si1917605edp.153.2020.05.01.05.37.24; Fri, 01 May 2020 05:37:49 -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=merlin.20170209 header.b=ArjHkPiB; 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 S1728760AbgEAMdl (ORCPT + 99 others); Fri, 1 May 2020 08:33:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728682AbgEAMdk (ORCPT ); Fri, 1 May 2020 08:33:40 -0400 Received: from merlin.infradead.org (unknown [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B680DC061A0C for ; Fri, 1 May 2020 05:33:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=i0w1XvvvNEeQ8/SDOP5BmNxiGkiniSG4kmik5XFiNSA=; b=ArjHkPiBh+R+86CFTF3YO8VhCb /Rj5IeMU7/cY7LNzt8tGCkQ/CUDCB1isD4l6O4FAW0Nwxb3RkHsv4OrkE1f60p9yH+eaq5YQ8ARBX 66NwcSRBDog3O7vX1VqI1SNw3qjO16NMC/v5NHuJPJDF++ZMl5+pO0FGj7ZnmKOhRa+fA5Vq6emS0 TzFc2eZ+l+MMe5JyWoo9BtSfBzZappuBssO16SeWBy0XJz04j3W4YqmTPW0lwXgJzoTXq7ynt3HVE GAyjKvEzDgFzdJib1p13nzEX8gbiyYSfgqFP4ZamrPDh4XE9C0zjFfjfCVzXNUdbou106lwFwR5Rt Fz4SjJ6w==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jUUr2-0004TG-Gb; Fri, 01 May 2020 12:33:20 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 51CED300130; Fri, 1 May 2020 14:33:19 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 3C79829A7943C; Fri, 1 May 2020 14:33:19 +0200 (CEST) Date: Fri, 1 May 2020 14:33:19 +0200 From: Peter Zijlstra To: Josh Poimboeuf Cc: Arnd Bergmann , the arch/x86 maintainers , Linux Kernel Mailing List Subject: Re: Remaining randconfig objtool warnings, linux-next-20200428 Message-ID: <20200501123319.GC3762@hirez.programming.kicks-ass.net> References: <20200501010733.ptvgzl3nbxybo4rd@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200501010733.ptvgzl3nbxybo4rd@treble> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 30, 2020 at 08:07:33PM -0500, Josh Poimboeuf wrote: > On Thu, Apr 30, 2020 at 04:05:07PM +0200, Arnd Bergmann wrote: > > lib/strncpy_from_user.o: warning: objtool: strncpy_from_user()+0x133: call to do_strncpy_from_user() with UACCESS enabled > > lib/strnlen_user.o: warning: objtool: strnlen_user()+0x122: call to do_strnlen_user() with UACCESS enabled > > Does this fix it? > GCC is a moron, a static function with inline and a single callsite, let's out-of-line it, shees!, try this instead: diff --git a/lib/strncpy_from_user.c b/lib/strncpy_from_user.c index 706020b06617..be420c8c0fdd 100644 --- a/lib/strncpy_from_user.c +++ b/lib/strncpy_from_user.c @@ -24,7 +24,7 @@ * hit it), 'max' is the address space maximum (and we return * -EFAULT if we hit it). */ -static inline long do_strncpy_from_user(char *dst, const char __user *src, +static __always_inline long do_strncpy_from_user(char *dst, const char __user *src, unsigned long count, unsigned long max) { const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS; diff --git a/lib/strnlen_user.c b/lib/strnlen_user.c index 41670d4a5816..c996b745733e 100644 --- a/lib/strnlen_user.c +++ b/lib/strnlen_user.c @@ -20,7 +20,7 @@ * if it fits in a aligned 'long'. The caller needs to check * the return value against "> max". */ -static inline long do_strnlen_user(const char __user *src, unsigned long count, unsigned long max) +static __always_inline long do_strnlen_user(const char __user *src, unsigned long count, unsigned long max) { const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS; unsigned long align, res = 0;