[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200721052821.GS2786714@ZenIV.linux.org.uk>
Date: Tue, 21 Jul 2020 06:28:21 +0100
From: Al Viro <viro@...iv.linux.org.uk>
To: Christoph Hellwig <hch@....de>
Cc: Luc Van Oostenryck <luc.vanoostenryck@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Alexey Kuznetsov <kuznet@....inr.ac.ru>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
Eric Dumazet <edumazet@...gle.com>,
linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org, bpf@...r.kernel.org,
netfilter-devel@...r.kernel.org, coreteam@...filter.org,
linux-sctp@...r.kernel.org, linux-hams@...r.kernel.org,
linux-bluetooth@...r.kernel.org, bridge@...ts.linux-foundation.org,
linux-can@...r.kernel.org, dccp@...r.kernel.org,
linux-decnet-user@...ts.sourceforge.net,
linux-wpan@...r.kernel.org, linux-s390@...r.kernel.org,
mptcp@...ts.01.org, lvs-devel@...r.kernel.org,
rds-devel@....oracle.com, linux-afs@...ts.infradead.org,
tipc-discussion@...ts.sourceforge.net, linux-x25@...r.kernel.org
Subject: Re: [PATCH 02/24] bpfilter: fix up a sparse annotation
On Tue, Jul 21, 2020 at 07:23:26AM +0200, Christoph Hellwig wrote:
> On Tue, Jul 21, 2020 at 04:40:16AM +0200, Luc Van Oostenryck wrote:
> > > req.pid = current->pid;
> > > req.cmd = optname;
> > > - req.addr = (long __force __user)optval;
> > > + req.addr = (__force long)optval;
> >
> > For casts to integers, even '__force' is not needed (since integers
> > can't be dereferenced, the concept of address-space is meaningless
> > for them, so it's never useful to warn when it's dropped and
> > '__force' is thus not needed).
>
> That's what I thought. but if I remove it here I actually do get a
> warning:
>
> CHECK net/bpfilter/bpfilter_kern.c
> net/bpfilter/bpfilter_kern.c:52:21: warning: cast removes address space '__user' of expression
Cast to unsigned long. Or to uintptr_t if you want to be fancy.
Powered by blists - more mailing lists