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=-4.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,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 0F619C433E6 for ; Tue, 21 Jul 2020 05:29:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ED8D9207DD for ; Tue, 21 Jul 2020 05:29:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726981AbgGUF3K (ORCPT ); Tue, 21 Jul 2020 01:29:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725294AbgGUF3K (ORCPT ); Tue, 21 Jul 2020 01:29:10 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F002FC061794; Mon, 20 Jul 2020 22:29:09 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxkpB-00H0WY-9x; Tue, 21 Jul 2020 05:28:21 +0000 Date: Tue, 21 Jul 2020 06:28:21 +0100 From: Al Viro To: Christoph Hellwig Cc: Luc Van Oostenryck , "David S. Miller" , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann , Alexey Kuznetsov , Hideaki YOSHIFUJI , Eric Dumazet , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, linux-sctp@vger.kernel.org, linux-hams@vger.kernel.org, linux-bluetooth@vger.kernel.org, bridge@lists.linux-foundation.org, linux-can@vger.kernel.org, dccp@vger.kernel.org, linux-decnet-user@lists.sourceforge.net, linux-wpan@vger.kernel.org, linux-s390@vger.kernel.org, mptcp@lists.01.org, lvs-devel@vger.kernel.org, rds-devel@oss.oracle.com, linux-afs@lists.infradead.org, tipc-discussion@lists.sourceforge.net, linux-x25@vger.kernel.org Subject: Re: [PATCH 02/24] bpfilter: fix up a sparse annotation Message-ID: <20200721052821.GS2786714@ZenIV.linux.org.uk> References: <20200720124737.118617-1-hch@lst.de> <20200720124737.118617-3-hch@lst.de> <20200721024016.2talwdt5hjqvirr6@ltop.local> <20200721052326.GA10071@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200721052326.GA10071@lst.de> Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org 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.