Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1685663imm; Mon, 3 Sep 2018 06:58:09 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYRdYVqoiVbBk+IYngWLR5pKU+Tl1RuiikAFFkYuPXeHW5pJ42+7qSUdfsKZ4SHRIv5piBk X-Received: by 2002:a17:902:850c:: with SMTP id bj12-v6mr29117380plb.330.1535983089570; Mon, 03 Sep 2018 06:58:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535983089; cv=none; d=google.com; s=arc-20160816; b=MjJWKgdiF40AaFUdKOCbyi5ufSZ6NFr1abESr+uXVgEKFLDpi5+zDfONr6udM5AYZ/ Rrfbdpk+X0eVwFBm0NT8FjaA5ZS7qm5PWD5H3FQ8snQgeUVw40rHvC6Ax+wYn3uD8Yse sBKMxeyvH/3Rr3NPmoyf4PvpIIF7yQ0harStq/MKfn2EdH8rkRiakkO6rlH0vsV8cqxC D2E4eLX7ikxWUss1kxWo/4pdfv7rYSGscT2PCtVQ+iy+Q2SUlNuvJdSqu3pYkdItlD6A yB4c/jhsjJCA7moDiNnqm+EW1rCHLmylNzDZZoFk/PLRVWCN+fwVN9kNRvzDJNxwCnZt XymQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=Za8SDsGdSI+e1kX6CyqW71fksxbIY4FK3vhpgeo12Uk=; b=oY9mPspFSLrWtJ68fsJ2ISQd+zZ3jWYZbq/VrKRQyJa7M2ML7+bgtm39wjNa3l2r6v UfvqxWwja4xDHRp6MLrCiulzoKaDgLBwsLIE1r0wlgkfIGGvEeDYO+SCdpjPjFQT69wS cwlzF67F7MPOqZoI6Ggg83ijuwOrs9rwCJuOfB4icv9ndyhz+1e7vyL0mUNbEvOFU0V2 Tw9KQ70Zxn8Io1UZZTaToNbvNum4iD+DR0R6w4SXK+EhwBRWw4RnyHF+axQzsBt5F5JC COYs3TDae2ZE536gBjLa3yPhnaIdUJ5ajAVAxkXavg91wSKLHc1Xsjw8UerYtkcbL8gy LS/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i5-v6si17586735pgk.200.2018.09.03.06.57.54; Mon, 03 Sep 2018 06:58:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727482AbeICSRG (ORCPT + 99 others); Mon, 3 Sep 2018 14:17:06 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:43324 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727049AbeICSRG (ORCPT ); Mon, 3 Sep 2018 14:17:06 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1fwpLI-0005Ai-Uk; Mon, 03 Sep 2018 13:56:37 +0000 Date: Mon, 3 Sep 2018 14:56:36 +0100 From: Al Viro To: Andrey Konovalov Cc: Luc Van Oostenryck , Catalin Marinas , Will Deacon , Mark Rutland , Robin Murphy , Kees Cook , Kate Stewart , Greg Kroah-Hartman , Andrew Morton , Ingo Molnar , "Kirill A . Shutemov" , Shuah Khan , Linux ARM , linux-doc@vger.kernel.org, Linux Memory Management List , linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org, LKML , Dmitry Vyukov , Kostya Serebryany , Evgeniy Stepanov , Lee Smith , Ramana Radhakrishnan , Jacob Bramley , Ruben Ayrapetyan , Chintan Pandya Subject: Re: [PATCH v6 11/11] arm64: annotate user pointers casts detected by sparse Message-ID: <20180903135636.GL19965@ZenIV.linux.org.uk> References: <5d54526e5ff2e5ad63d0dfdd9ab17cf359afa4f2.1535629099.git.andreyknvl@google.com> <20180831081123.6mo62xnk54pvlxmc@ltop.local> <20180831134244.GB19965@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 03, 2018 at 02:34:27PM +0200, Andrey Konovalov wrote: > > Al, very annoyed by that kind of information-hiding crap... > > This patch only adds __force to hide the reports I've looked at and > decided that the code does the right thing. The cases where this is > not the case are handled by the previous patches in the patchset. I'll > this to the patch description as well. Is that OK? I don't know about you, but personally I've run into "I've looked, I'm sure it's OK here" -> (a year or so later) "why is it OK, again? Oh, bugger..." quite a few times. Some, but not all, hadn't been OK all along, some used to be but got quietly broken by subsequent changes by people who had no idea that some property of implementation was critical for correctness in the place in question, some (even more embarrassingly) were broken by a patch of my own. It happens. "Looked in there, decided that the warning was bogus and quietly shut it up" has turned out to be a source of trouble down the road a lot of times. If you are forcibly removing a warning (not by reorganizing the logics and annotations, that is - by force-cast, or something similar to it), leave behind something more useful than "On $DATE I've decided it was OK" (and even that - only accessible via git blame/git show). As a hint for yourself, if nothing else - you might end up asking yourself the same question a year or two (or twenty, for that matter) later while looking for likely source of odd breakage and trying to narrow the search down. Force-cast conflates a *lot* of situations together - it's pretty much "fuck off, I know what's going on here, it's OK" and no more than that; hell, even the warning it removes would've carried more information... That kind of "these are false positives, let's turn them off to search for real problems" patches is fine when developing a branch like that; it's leaving them in for posterity that tends to cause PITA... I'm not attacking you, BTW - it's really a generic point re force-casts. There had been some really outrageous cases lately[1] and I think that this point does need to be made. Unexplained force-cast is worse than leaving a warning in. [1] with, if my reading of the situation is correct, newbie asking maintainers if dealing with endianness warnings in a certain driver would be useful newbie getting told (perhaps by maintainers, perhaps by somebody else) that those were all noise, the driver's correct and the most useful thing to be done with them would be to make them STFU force-cast-laden patch from said newbie doing just that picked by said maintainers, "cleaning up" the warnings. And committed with authorship pinned to the newbie ;-/ Not nice, seeing that the code in driver is *not* correct, despite the high-handed "shut that noise off, everything's fine there" commit - undoing that "cleanup" and trying to redo annotations properly starts to converge on absolutely real bugs on b-e hosts in about 10 minutes. In PCIe driver, with devices existing as separate cards, not just something always embedded into x86 or arm motherboard...