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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4415EC433F5 for ; Mon, 18 Apr 2022 22:01:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9743E8D0025; Mon, 18 Apr 2022 18:01:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 923D98D001A; Mon, 18 Apr 2022 18:01:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7C48B8D0025; Mon, 18 Apr 2022 18:01:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id 6A3B38D001A for ; Mon, 18 Apr 2022 18:01:38 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 3C9C881F0C for ; Mon, 18 Apr 2022 22:01:38 +0000 (UTC) X-FDA: 79371372276.12.7C4F0EF Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) by imf22.hostedemail.com (Postfix) with ESMTP id B1170C0007 for ; Mon, 18 Apr 2022 22:01:37 +0000 (UTC) Received: by mail-pg1-f174.google.com with SMTP id 203so2250825pgb.3 for ; Mon, 18 Apr 2022 15:01:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=P5IiPKnNcqLzyMGe36J+KRFeZwk+XdVfvsBemLoLfGA=; b=JGLGYT5P28WH10R7rDB8r7F+8ZGRQomASZQhepSICRbRvfj34Zf6nvCA/D1ExIkyCZ xr4k03YVJROfAWk/GeRxz2GUTh7fK/p4PH3b34w+9V6utFBQLbnr8WhTG4a2Hmp1v9V7 FjiXjiMaLenbmnkhxpW48XtCokpdkyI3MAeoU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=P5IiPKnNcqLzyMGe36J+KRFeZwk+XdVfvsBemLoLfGA=; b=Fm+raC3WCgB47TXN1qeQEDpO5TU70MPm2wZktoye4F0hBaIvRMt2IluBasLdmNOTm3 aRNoLeOD9vfXl88ZatJ4dPj12/ZWXunuWFWumgLtaBBaAvc7XVwF/ilDFE+eEvZCN05f 0HgWbjaTdUifQbGkgJnl4+Gk2DIaoEvluwu3oFi+oEKShYW92e6jyHcYHdt+Uh+a6xU8 30bQwQwWO0ogfRtPUXvEt73J9t4rhC8rf77tgPeIHFVlUcSxux85iJ6FOztmM/WFWM0X zNYPnlO6Edw5Hn6aL1k66QCDEHd4rBP9bsq8BjmjO8XKDtKIPEEownTJcC7fU1sb2gMl wcGA== X-Gm-Message-State: AOAM5324wT1NQ7O45D30ClTAL359ia297er4z/69o9KCc5PK1BIlQzu4 Q9N5/f4VeAU3wtNuiVlh/WeKtw== X-Google-Smtp-Source: ABdhPJwrNaWr3wngnD9TQeLYfooQkh8o7MVbDAYZ6Wn4GCGz6QHu+72pxysFdVDhltuC1iQZ6njgAg== X-Received: by 2002:a05:6a00:1695:b0:4f7:decc:506b with SMTP id k21-20020a056a00169500b004f7decc506bmr14646094pfc.7.1650319296279; Mon, 18 Apr 2022 15:01:36 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id j10-20020a17090a31ca00b001cb87502e32sm13809395pjf.23.2022.04.18.15.01.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Apr 2022 15:01:35 -0700 (PDT) Date: Mon, 18 Apr 2022 15:01:35 -0700 From: Kees Cook To: Niklas Cassel Cc: Alexander Viro , Eric Biederman , Greg Ungerer , Mike Frysinger , Damien Le Moal , kernel test robot , "stable@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-mm@kvack.org" Subject: Re: [PATCH] binfmt_flat: fix sparse annotation ordering Message-ID: <202204181501.D55C8D2A@keescook> References: <20220418200834.1501454-1-Niklas.Cassel@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220418200834.1501454-1-Niklas.Cassel@wdc.com> X-Rspam-User: X-Rspamd-Queue-Id: B1170C0007 X-Stat-Signature: nt3qytontreec491dxbx4k7cuw3oz7xz Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=JGLGYT5P; spf=pass (imf22.hostedemail.com: domain of keescook@chromium.org designates 209.85.215.174 as permitted sender) smtp.mailfrom=keescook@chromium.org; dmarc=pass (policy=none) header.from=chromium.org X-Rspamd-Server: rspam01 X-HE-Tag: 1650319297-6819 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000012, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Apr 18, 2022 at 08:09:12PM +0000, Niklas Cassel wrote: > From: Niklas Cassel > > The sparse annotation ordering inside the function call is swapped. > > Fix the ordering so that we silence the following sparse warnings: > fs/binfmt_flat.c:816:39: warning: incorrect type in argument 1 (different address spaces) > fs/binfmt_flat.c:816:39: expected unsigned int [noderef] [usertype] __user *rp > fs/binfmt_flat.c:816:39: got unsigned int [usertype] *[noderef] __user > > No functional change as sparse annotations are ignored by the compiler. > > Fixes: a767e6fd68d2 ("binfmt_flat: do not stop relocating GOT entries prematurely on riscv") > Reported-by: kernel test robot > Signed-off-by: Niklas Cassel > Cc: > --- > Hello Kees, > > Sorry about this. > Feel free to squash it with the existing patch if you so like. Ah-ha! Thanks; I was just looking at the sparse email. :) -Kees > > fs/binfmt_flat.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c > index e5e2a03b39c1..dca0b6875f9c 100644 > --- a/fs/binfmt_flat.c > +++ b/fs/binfmt_flat.c > @@ -813,7 +813,7 @@ static int load_flat_file(struct linux_binprm *bprm, > * image. > */ > if (flags & FLAT_FLAG_GOTPIC) { > - rp = skip_got_header((u32 * __user) datapos); > + rp = skip_got_header((u32 __user *) datapos); > for (; ; rp++) { > u32 addr, rp_val; > if (get_user(rp_val, rp)) > -- > 2.35.1 -- Kees Cook