Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1630328imm; Mon, 3 Sep 2018 05:35:51 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbkARiRNMuoMocvjjE7KElY6KmFEUwlzOKy0DNA+Abg6UtY4HySeGKYkRWwPBG37GMvjFuK X-Received: by 2002:a17:902:1683:: with SMTP id h3-v6mr28245487plh.201.1535978151075; Mon, 03 Sep 2018 05:35:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535978151; cv=none; d=google.com; s=arc-20160816; b=zHA3T6Hf5GgT9zMFN0xT9Um6kIYI12mAy8sej34w9O7snJNi6XoXtEd/OfAsGtxg/O YUfHagFY6f1+jon4o+Oe9rtP9EbRhabLd6OGjjrznV+UuKO29KKCszG5yzI/312CPwdD iLDab7YE5kuapNeQDKA1R7z/X6tuYS3FZRl+whyMX+mK4sWy6xueNiSbrsoOb05ydies TX9WiIB+6mVAD/Izf+vaNytZymI/faQ+tHy/7PxZkmxsBLIhBw40JwrZ3TyCCFDooDmv m0xZXVPzGJy1mMl7X40cejhAv0PWlFKWfn9f0oUwqDcG3y10XQ4gAxCSyJNxHHu87cf4 DjFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=Op5rprZXqxsDaY0yzNUnJilPlVxPCIJ7drovmWT86dQ=; b=BGOvHWRDLIBTaGkQ/WBsy0wFzxH85tS1iP+n5lPHgy7uhnBSrnrdPYIt9Cw4MD/u6t 11UMWdia/OCSRLlu9hO2G64f5r0lM9LZSrFul4oWdjHpoIWuHBbJT5rTFpETTkbIz0+H e2k012DNZ0JnaQE+UuaAwRuP/ZJfUcmxrfpRsLmza+xfnIHVcNp6/nChIlMBsdcc2DHS 6Wz58UdKEHjpqdDbVXARjThvNPIbiGZqJYAdXYSfbM5nIYynhYgAplGeFNWZcO/2vfpe 5blrzbzrPCBI/JLUedwoAyekjL14udFG0ub02bLeUrzLfBCTxnHFYv82Bv2JsKxH4w43 ubQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=vApzQ0RZ; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d66-v6si20525330pfa.186.2018.09.03.05.35.35; Mon, 03 Sep 2018 05:35:51 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=vApzQ0RZ; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726951AbeICQyZ (ORCPT + 99 others); Mon, 3 Sep 2018 12:54:25 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:44075 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725920AbeICQyZ (ORCPT ); Mon, 3 Sep 2018 12:54:25 -0400 Received: by mail-io0-f194.google.com with SMTP id 75-v6so278947iou.11 for ; Mon, 03 Sep 2018 05:34:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Op5rprZXqxsDaY0yzNUnJilPlVxPCIJ7drovmWT86dQ=; b=vApzQ0RZdg/YQ9Yyjr02onu1NyHkuDllZiAcnOpsvtd5pg6j+c0M+vPZgJsrkvd+gc JFNf96JoPMdDNrqUdsbAmQ245rxM4Sul4PsD42hshb3u2NY/G0UCR7+hfsmmpHdfp+Ab x4vFVG61XZurnusb1TWXs0Vn4waZi3gIT9p9GerW8kJhGB1Wbo6QyIyc9rQhkW3rcc2Y EbpF1HQudQPtiiDIfqUltCPBdt8ZcEFjeWy2ohys0Sug2Ss99UJSLC4CQBBDHNVkXas7 2aEpAlbbRieBq+aIi5P+akSrD33iYpRxoa2jSsUdJMDawsUa+OJtagTssHDBM3NnqtaO LJOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Op5rprZXqxsDaY0yzNUnJilPlVxPCIJ7drovmWT86dQ=; b=Qf/XlKeCuxLRLAIgCnK4zfIz8+7hStq3a1RzowZ7ID8SMy84/cbEDBOLIn4+9ng1OC pQ5NeKtB1OQSgBTwiQQZWdGcoo3AOTfsI4kFYN70JrDR2Rjx34vkh0f/YEFhqCdf6nYx 38W/rt37cNDnBF8MF41cLIYkaJ8O0zq85RQBFSrZzTsSQZ5M24oErqDk0I19kOIR0xxF DoBxd9NNJr0BpW9SAvHqnaxLEcmTG0cjI92TpnKirsSZutYypU9pVmFkJ+CuKG+vJur+ nvcOeFTrw61QzAkpJHOyesKegB3SfAuBP5FPm42iHDlPZoItsANjvEZNDxaGNdMq48D5 NaVQ== X-Gm-Message-State: APzg51AXtCnNU/pEtSOVH6GHQ3OwEL/Urf18gzfQ83he/tyvELViYi46 Zu9rghWi2zrQQSVswEMZi7yo0Imvnz13FiFMChuanw== X-Received: by 2002:a6b:2147:: with SMTP id h68-v6mr18964210ioh.192.1535978068101; Mon, 03 Sep 2018 05:34:28 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:8482:0:0:0:0:0 with HTTP; Mon, 3 Sep 2018 05:34:27 -0700 (PDT) In-Reply-To: <20180831134244.GB19965@ZenIV.linux.org.uk> References: <5d54526e5ff2e5ad63d0dfdd9ab17cf359afa4f2.1535629099.git.andreyknvl@google.com> <20180831081123.6mo62xnk54pvlxmc@ltop.local> <20180831134244.GB19965@ZenIV.linux.org.uk> From: Andrey Konovalov Date: Mon, 3 Sep 2018 14:34:27 +0200 Message-ID: Subject: Re: [PATCH v6 11/11] arm64: annotate user pointers casts detected by sparse To: Al Viro 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 31, 2018 at 3:42 PM, Al Viro wrote: > On Fri, Aug 31, 2018 at 10:11:24AM +0200, Luc Van Oostenryck wrote: >> On Thu, Aug 30, 2018 at 01:41:16PM +0200, Andrey Konovalov wrote: >> > This patch adds __force annotations for __user pointers casts detected by >> > sparse with the -Wcast-from-as flag enabled (added in [1]). >> > >> > [1] https://github.com/lucvoo/sparse-dev/commit/5f960cb10f56ec2017c128ef9d16060e0145f292 >> >> Hi, >> >> It would be nice to have some explanation for why these added __force >> are useful. I'll add this in the next version, thanks! > It would be even more useful if that series would either deal with > the noise for real ("that's what we intend here, that's what we intend there, > here's a primitive for such-and-such kind of cases, here we actually > ought to pass __user pointer instead of unsigned long", etc.) or left it > unmasked. > > As it is, __force says only one thing: "I know the code is doing > the right thing here". That belongs in primitives, and I do *not* mean the > #define cast_to_ulong(x) ((__force unsigned long)(x)) > kind. > > Folks, if you don't want to deal with that - leave the warnings be. > They do carry more information than "someone has slapped __force in that place". > > 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?