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=-3.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 85F69C433DF for ; Tue, 30 Jun 2020 09:59:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2839C20675 for ; Tue, 30 Jun 2020 09:59:32 +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="fhdlz+Xa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2839C20675 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5D6188D000A; Tue, 30 Jun 2020 05:59:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 537F48D0007; Tue, 30 Jun 2020 05:59:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 400738D000A; Tue, 30 Jun 2020 05:59:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0144.hostedemail.com [216.40.44.144]) by kanga.kvack.org (Postfix) with ESMTP id 263718D0007 for ; Tue, 30 Jun 2020 05:59:32 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id BE808181ABE86 for ; Tue, 30 Jun 2020 09:59:31 +0000 (UTC) X-FDA: 76985430942.19.tax66_400c67d26e77 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id 92C7F1AD1B3 for ; Tue, 30 Jun 2020 09:59:31 +0000 (UTC) X-HE-Tag: tax66_400c67d26e77 X-Filterd-Recvd-Size: 3588 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Tue, 30 Jun 2020 09:59:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=Za5Hzb5OyUUVNW5GfXZ3A73U/lLcFexOctNrPwh6ICc=; b=fhdlz+XaNzQGh/692amZWsNd5J dqUN0J8wiuIvx1p3/nSlYUwmZkWW75cTrTEtQRES+MZkJkkJx0RT4XYT2iWjZdwNogcFQG4URUjRW osID6+Eybu9JbD+uhy9Inn7fYX/J92hBJ5EMbdCrneaHtv3q7uiN7yKFlINgwCWxrT2wPxYletSrb w5I5s/31dNR4WCbNJ4vekrDOFAet/drCGl6MMSrAgbHQNsRxoZ5Cl7d3jl7ArWR1+V6gtM8EW+JWH ywMHcyMpQxJiiXQOtIaPHuXqhRE7trw5jJ2UCZQGXFOU5vbhUhypWVU4usk4y1GmvKZSi1czwxvta pneVCrkw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jqD2x-0005Cw-84; Tue, 30 Jun 2020 09:59:23 +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 ACA7A3013E5; Tue, 30 Jun 2020 11:59:20 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 219B4203A617B; Tue, 30 Jun 2020 11:59:20 +0200 (CEST) Date: Tue, 30 Jun 2020 11:59:20 +0200 From: Peter Zijlstra To: Randy Dunlap Cc: akpm@linux-foundation.org, broonie@kernel.org, mhocko@suse.cz, sfr@canb.auug.org.au, linux-next@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, mm-commits@vger.kernel.org, Josh Poimboeuf , viro@zeniv.linux.org.uk Subject: Re: mmotm 2020-06-25-20-36 uploaded (objtool warning) Message-ID: <20200630095920.GU4817@hirez.programming.kicks-ass.net> References: <20200626033744.URfGO%akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 92C7F1AD1B3 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Jun 26, 2020 at 04:35:08PM -0700, Randy Dunlap wrote: > arch/x86/kernel/sys_ia32.o: warning: objtool: cp_stat64()+0x57: call to new_encode_dev() with UACCESS enabled That's c120f3b81ede ("x86: switch cp_stat64() to unsafe_put_user()"). Where __put_user() made sure evaluate 'x' before doing __uaccess_begin(), the new code has no such choice. The simplest fix is probably something like this. --- include/linux/kdev_t.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/kdev_t.h b/include/linux/kdev_t.h index 85b5151911cf..a840ffef7c19 100644 --- a/include/linux/kdev_t.h +++ b/include/linux/kdev_t.h @@ -36,7 +36,7 @@ static inline dev_t old_decode_dev(u16 val) return MKDEV((val >> 8) & 255, val & 255); } -static inline u32 new_encode_dev(dev_t dev) +static __always_inline u32 new_encode_dev(dev_t dev) { unsigned major = MAJOR(dev); unsigned minor = MINOR(dev); @@ -50,7 +50,7 @@ static inline dev_t new_decode_dev(u32 dev) return MKDEV(major, minor); } -static inline u64 huge_encode_dev(dev_t dev) +static __always_inline u64 huge_encode_dev(dev_t dev) { return new_encode_dev(dev); }