Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp21879042rwd; Fri, 30 Jun 2023 00:33:59 -0700 (PDT) X-Google-Smtp-Source: APBJJlFO7VbTyRpUyIfHMa89wyNbfJEfcgcNBDiIO0vBIR1lliDWZFOSjJ5PtdUuv5Q/uqPadPIH X-Received: by 2002:a17:90a:1ce:b0:25b:f764:580a with SMTP id 14-20020a17090a01ce00b0025bf764580amr1552410pjd.12.1688110438702; Fri, 30 Jun 2023 00:33:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688110438; cv=none; d=google.com; s=arc-20160816; b=mnHD+tBhjldjun8sGAp9FQC29+iB1DJgPpu0xQaPxyznQldvk3pEUlPWFbjRmCqqyv 6V6jVlsQd9nJPz5s7UPwLDEZrK3fLB5LPAkySgLb1nQwuCMIMnv2HNtQNG9svfDF1gJL 06MZ2bpNB30XYiT5eTt4fqiixPc6WMY2191ct+RD2+hkkxCd115x0P9W7C23Et6ClisH /XNbxrkUkbi1YxHc8UnRceTDD+TjtznMV6wAxo2wMv/wyA7A/5hPm+L77+xEJ+vU60DN Qbb92QUaJm12ROwJK8F/A1yJ/Bo+VUUa0321VavFL6h7r47YreZaghZtV0FyVaUii0sN rTbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=5xT0h1VwJXuRJVl6b4ZcUHqCtxF2ZZq6HpEiCot5j2I=; fh=wAfwrEgoC6A5JF6M75FrLdIBAu+mkCVZLy6+P5sQkQU=; b=fL8f+PNLPQcXnHa1pFUA/JxP3u8E5hQ5oKLtQoqBIOSk19Z0mz3taWq2BG28eVQzon b9n2I+UrMU4xZ0ob+pLQHU50rzSjrfgoY3Y1O+ykx+Q8C8eBUupHFdZNE1I70XsmU9qU R/mBeNH6cDF+Y51goLqpegA2Eq+/M4B7nWNamK8Vmhx4qxdzkCqdCA4PKDyqo5xKnwAV 9pVdt7YakaSFr2mp4BLU2rs71esKbyDPPThn1GbtZVsQVXmwo3hcuRuZepY/IKo8xfbo SHNceP5VNEZu1e3DcHNTmcvGuxRE1HyznhWFhyAgUfmWJaf1R3e029aLXTJkLg/zD1bG KWiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=hczRlo9G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pg7-20020a17090b1e0700b002476baf6b4bsi13306319pjb.149.2023.06.30.00.33.42; Fri, 30 Jun 2023 00:33:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=hczRlo9G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232113AbjF3HMz (ORCPT + 99 others); Fri, 30 Jun 2023 03:12:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230364AbjF3HMs (ORCPT ); Fri, 30 Jun 2023 03:12:48 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1B6FE61 for ; Fri, 30 Jun 2023 00:12:42 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4fb863edcb6so2546304e87.0 for ; Fri, 30 Jun 2023 00:12:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1688109161; x=1690701161; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=5xT0h1VwJXuRJVl6b4ZcUHqCtxF2ZZq6HpEiCot5j2I=; b=hczRlo9GF1y8OYQx4hiNe3TCqWYA1xB9FDBv1rUBx3KymykGTZGCNdaZ93kQdIORmd Tic2z0GgJrmum/Q56ZUsu/zSe4hdDqfNl+4DJ3vApHdd20hXW+3HSzY1jWgPpGndVELI c/6JJoMQ+AAy2wjVuXJf95y1+unsB1BUC2xqs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688109161; x=1690701161; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5xT0h1VwJXuRJVl6b4ZcUHqCtxF2ZZq6HpEiCot5j2I=; b=O9e2Z7HE+rWfaEDsjFHLikYZ0dnEzXztNNVI/L9BVOwRh4pdy0KrH3Q/DwfgRkbHoy 37+XcD3gomT4JIj9VobZrUN6Fo1MGDVU7dEbJh3vtt2lzc4jUKNtjftxsmEGRtt6D/ty v/7DDRRFKYMOhSOfiDlQrCTCoXl8za3+UgyHiuWeRfb98Y6jJMpZIMf4P/QZ2CQp1M7j COT3rIpsYi6ppwPJx4+E0TnY6r+ijBvVUMRKYB8lIQujuDIgLFCfvlaLjdcwoInXfwO2 b7IN9VkeIxqNxiO8aEmOFo/CfwZR8837Fn3hI21hZBnp4/g76xZ8CWh4mUT6b9a84gIw Lasg== X-Gm-Message-State: ABy/qLZP1MLkTzlIrQO/EcIEtCkLheuQR5d4mq0BjqekchtfPsaakx/F V5b5++UiL+teg94BvaRSEoUKd/nCwEmTme1gAiirb6a5 X-Received: by 2002:ac2:4bca:0:b0:4f9:ec5e:d624 with SMTP id o10-20020ac24bca000000b004f9ec5ed624mr1453929lfq.38.1688109160706; Fri, 30 Jun 2023 00:12:40 -0700 (PDT) Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com. [209.85.208.174]) by smtp.gmail.com with ESMTPSA id c23-20020a197617000000b004f13cd61ebbsm2426699lff.175.2023.06.30.00.12.40 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 30 Jun 2023 00:12:40 -0700 (PDT) Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-2b69f216c73so23441351fa.3 for ; Fri, 30 Jun 2023 00:12:40 -0700 (PDT) X-Received: by 2002:a2e:b6d0:0:b0:2b5:8a3f:4f5 with SMTP id m16-20020a2eb6d0000000b002b58a3f04f5mr1288895ljo.50.1688109159752; Fri, 30 Jun 2023 00:12:39 -0700 (PDT) MIME-Version: 1.0 References: <20230628-pokal-puzzeln-5199c679b051@brauner> <20230630-testphasen-orangen-0e54486a267d@brauner> In-Reply-To: <20230630-testphasen-orangen-0e54486a267d@brauner> From: Linus Torvalds Date: Fri, 30 Jun 2023 00:12:22 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [GIT PULL] pid: use flex array To: Christian Brauner Cc: Kees Cook , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 29 Jun 2023 at 23:51, Christian Brauner wrote: > > I have no preference for either syntax. Both work. But this is probably > more an objection to this being mixed in with the flex array change in > the first place. Yes. I looked at it, and tried to figure out if it was related somehow, and decided that no, it can't possibly be, and must be just an unrelated change. > I did react to that in the original review here: > https://lore.kernel.org/all/20230518-zuneigen-brombeeren-0a57cd32b1a7@brauner > but then I grepped for it and saw it done in a few other places already Yeah, we do end up growing new uses of 'use 0 as a pointer' almost as quickly as we get rid of them. We got rid of a couple just recently in commit dadeeffbe525 ("fbdev: hitfb: Use NULL for pointers"), but yes, a quick git grep '\*)0\>' shows many more. And some of them are even ok. I don't think it's always wrong, particularly if you then abstract it out. So doing something like that #define PCI_IOBASE ((void __iomem *)0) makes perfect sense. It's literally abstracting out something real (in this case yes, it looks like a NULL pointer, but it's actually a pointer with a strict type that just happens to have the value zero. So that "NULL pointer with a type" concept makes sense, but it really should be abstracted out, not be in the middle of some random code. And that's *particularly* true when we already have the exact abstraction for the situation that the code then uses (ie in this case that "struct_size_t()" thing). Writing it out - in an ugly form - using the disgusting traditional "constant integer zero can be cast to any pointer" thing - just makes me go "Eugghhh!". I mean, if this ugly part was just a small detail in a l;arger patch, I probably would just have let it slide. It works. It is what it is. But when three quarters of the patch was stuff I found questionable, I just couldn't stomach it. I'm looking at some of the grep hits, and I'm going "ok, that's a C++ programmer". I think there's a very real reason why so many of them are in bpf code and in the bpf tests. C++ made a *huge* fundamental design mistake early on wrt NULL, and a generation of C++ programmers were poisoned by it and you had people who swore until they were blue that 0 and NULL had to be the same thing. They were horribly and utterly wrong. But sometimes when it takes you three decades to admit that you were wrong all that time, it's just too painful to admit. There are literally people who still can't admit to their mistake, and refuse to use NULL, and use either 0 or 'nullptr'. Linus