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=-5.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 F06AAC433E1 for ; Tue, 30 Jun 2020 15:29:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B613F20663 for ; Tue, 30 Jun 2020 15:29:25 +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="Fcu53Yrf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B613F20663 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 421E36B000C; Tue, 30 Jun 2020 11:29:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3D2F46B0023; Tue, 30 Jun 2020 11:29:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2E7986B0025; Tue, 30 Jun 2020 11:29:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0027.hostedemail.com [216.40.44.27]) by kanga.kvack.org (Postfix) with ESMTP id 195766B000C for ; Tue, 30 Jun 2020 11:29:25 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id BC823824556B for ; Tue, 30 Jun 2020 15:29:24 +0000 (UTC) X-FDA: 76986262248.09.meal78_571682126e79 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin09.hostedemail.com (Postfix) with ESMTP id 93F8D180AD801 for ; Tue, 30 Jun 2020 15:29:24 +0000 (UTC) X-HE-Tag: meal78_571682126e79 X-Filterd-Recvd-Size: 3462 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Tue, 30 Jun 2020 15:29:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description; bh=9buXox3enmJCMZeUtLja7eQwSxRejj91pcuCW8qu+hs=; b=Fcu53YrfMI0lQDRjFxd3Ji0bPY 53asY+ahsbPRyOQruFE/MYn3DY1yzYodFpWHAlCFI3PET3DtHU3DfJUp+BCZaJqu/WeRdpDfUMNYI TricySoyQVzeFxlCmZQRyG9/xw0Gcuy7RSmUm1OOf4LNqq268Tsq9WHwNpeCGwtq5O+bYpMOjry3n 4fHkCrLqPHihyu1EYS+rBIAwt5SlyHrLx8zKA2ncGKZobi/BkJVh7hpM/cxFcA1pj33/HJ0/zS492 b/unNNwhaGnL25JAukyT8v2Jb0ugGRExZ1ZVGFSRIq4NwGg46QzDbHGhEQzLz7zioEda0L3SMle0q j77Z92Jg==; Received: from [2601:1c0:6280:3f0::19c2] by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jqICC-0006Wy-4v; Tue, 30 Jun 2020 15:29:16 +0000 Subject: Re: mmotm 2020-06-25-20-36 uploaded (objtool warning) To: Peter Zijlstra 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 References: <20200626033744.URfGO%akpm@linux-foundation.org> <20200630095920.GU4817@hirez.programming.kicks-ass.net> From: Randy Dunlap Message-ID: Date: Tue, 30 Jun 2020 08:29:11 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200630095920.GU4817@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 93F8D180AD801 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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 6/30/20 2:59 AM, Peter Zijlstra wrote: > 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. > Acked-by: Randy Dunlap # build-tested Thanks. > --- > 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); > } > -- ~Randy