Received: by 2002:a05:6830:16d2:b0:61c:ac69:ca1b with SMTP id l18csp52309otr; Wed, 3 Aug 2022 16:49:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR6fyajQxJVHGLQMfrQFB8iSkUD02GsZkTTQ0KajCE6kO1IluMmOCp9IsA3teAnGBneC8SSW X-Received: by 2002:a17:902:70cc:b0:16c:60e0:50fb with SMTP id l12-20020a17090270cc00b0016c60e050fbmr28345846plt.156.1659570546142; Wed, 03 Aug 2022 16:49:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659570546; cv=none; d=google.com; s=arc-20160816; b=ydOeVqMUywB2sjxe6DOYg6H/2ZupciRWNVmala9o90u6Fi7kWshCRUa+0RZsvlAYrv 2mVEgf4csmSZaa7KgSMQyxqtTKuyjdTsodtdV9N0kEu4emuRXJRYAYDMFbIqLA/pvOGd 9X1xNss/xHEpO+FZOiUvxlLbeeMU2PsoxYjjG15dVlzKHV7Ro7qh1o81RHG6cOx6vCqm cngb6P3QoNPrso4HTw5ahBVDvluHgxso/eYCK0hEaBcPeo2tGlH1O9LQGkoT38nm+WJj t9k8/6mRw6nM4gTVpgKSnEH3i1vrkzVZJBZW/LghxFcGmt2BAUf1DY40yvXOZELE2D66 epVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=XMwxz3mctao86/tOVJnX+lr9oNAxjmTmU2XKIuTJvTs=; b=ZWbhwIvsIRrG+vqQ2NMGtmcFjHCfjR+pW8b5G99Y8onDMmDFyjBqgvCwAx5RbvEGFr 75Dw30DaHsCHST++fuWXPzIKc67psU07QmEOX8nnne8hcr7bS3Roe8aRvN1VgZCk/NK+ 5fesqLF2gb/JDeUJU3/66vgkLTl8wX9JP7qGVfGfS6CRy79+0auIPtazYSqBRMGpyY/+ 11o0tL0TglcuB9pr+2YdYCt6vbAkR3xWl/TncPm6DCbvdV3vs5MVi+WGrYI9h24WKMpY ftGg5XHGmS2mE9m0nNrxPzXhkMQgNPFYerEwK+duO68zGBfifePEDclWQndegxMKl/ha KXWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=cuI7HYbj; 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 j12-20020a056a00130c00b005252be33906si19999189pfu.224.2022.08.03.16.48.49; Wed, 03 Aug 2022 16:49:06 -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=cuI7HYbj; 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 S238261AbiHCXgS (ORCPT + 99 others); Wed, 3 Aug 2022 19:36:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237090AbiHCXgQ (ORCPT ); Wed, 3 Aug 2022 19:36:16 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEAD656BA3 for ; Wed, 3 Aug 2022 16:36:15 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id m4so12245309ejr.3 for ; Wed, 03 Aug 2022 16:36:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc; bh=XMwxz3mctao86/tOVJnX+lr9oNAxjmTmU2XKIuTJvTs=; b=cuI7HYbj9DxO6OtTMlxZc/FNkNFPenx0NQFsrPDz8WENrSphM4LqOkZvt6DNnQZmap CrWjdWQiJ+sciY3/mqTCW7cVJvpAkxqzWfkqeu8nhN0y0eb05OCoJWpo51F0INdKTU2q olHiz1ntdc+EM33zSE/MFNaFmd+T6r3RV/tQ4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc; bh=XMwxz3mctao86/tOVJnX+lr9oNAxjmTmU2XKIuTJvTs=; b=s89/9cSGi1wE2EhTUY4UyUjLldYjTmUvoho6fCyvS2ad8hcthw6Afiynmc9b801WZU WoM1ODeCcf71u4TqbpGSnlyotOlwPUZjzVfAocIoNCLxPJ79gWO2GIzN5mA+ioWkH0l/ 9i3CwZcvicyJY3XugDTMQcDVS5xf+o0C8ugCD5U/voGEdMmDUJXh/Rg9uYj48sYIX8YS CBJTi3YKRVP5CB32s69JeysZDzQOYC72HVRcGEBB9S6A2Yefix1wxrQSwnCf/B0UEj5/ FutP/drxulz1+b2n9kpVRvOryjTaa+97EXldiXq+fmsMPFFXePE42gXq08KwNeMtbIX/ 94og== X-Gm-Message-State: AJIora8Be+/IYsnvUhEcRw2sdf4J9myAWEn3Ozk2zBQgoG0FMKYi65JO wzB8bDlIJrLG1HBAekj9r6FbnrIdq/5MYh64 X-Received: by 2002:a17:907:6890:b0:72e:e404:46d2 with SMTP id qy16-20020a170907689000b0072ee40446d2mr20536991ejc.578.1659569773671; Wed, 03 Aug 2022 16:36:13 -0700 (PDT) Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com. [209.85.221.44]) by smtp.gmail.com with ESMTPSA id qc19-20020a170906d8b300b007305d408b3dsm4998582ejb.78.2022.08.03.16.36.12 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Aug 2022 16:36:12 -0700 (PDT) Received: by mail-wr1-f44.google.com with SMTP id j15so15220924wrr.2 for ; Wed, 03 Aug 2022 16:36:12 -0700 (PDT) X-Received: by 2002:adf:edcb:0:b0:21e:d043:d271 with SMTP id v11-20020adfedcb000000b0021ed043d271mr17545888wro.274.1659569772201; Wed, 03 Aug 2022 16:36:12 -0700 (PDT) MIME-Version: 1.0 References: <20220803101438.24327-1-pabeni@redhat.com> In-Reply-To: <20220803101438.24327-1-pabeni@redhat.com> From: Linus Torvalds Date: Wed, 3 Aug 2022 16:35:56 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [GIT PULL] Networking for 6.0 To: Paolo Abeni , "Gustavo A. R. Silva" , Wojciech Drewek , Tony Nguyen Cc: kuba@kernel.org, davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 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 Wed, Aug 3, 2022 at 3:15 AM Paolo Abeni wrote: > > At the time of writing we have two known conflicts, one with arm-soc: Hmm. There's actually a third one, this one semantic (but mostly harmless). I wonder how it was overlooked. It causes an odd gcc "note" report: net/core/flow_dissector.c: In function =E2=80=98is_pppoe_ses_hdr_valid=E2= =80=99: net/core/flow_dissector.c:898:13: note: the ABI of passing struct with a flexible array member has changed in GCC 4.4 898 | static bool is_pppoe_ses_hdr_valid(struct pppoe_hdr hdr) | ^~~~~~~~~~~~~~~~~~~~~~ and it looks like a semantic merge conflict between commits 94dfc73e7cf4 ("treewide: uapi: Replace zero-length arrays with flexible-array members") 46126db9c861 ("flow_dissector: Add PPPoE dissectors") where that first commit makes 'struct pppoe_hdr' have a flexible array member at the end, and the second second commit passes said pppoe_hdr by value as an argument. I don't think there is any reason to pass that 'struct pppoe_hdr' by value in the first place, and that is not a normal pattern for the kernel. Sure, we sometimes do use opaque types that may be structures (eg 'pte_t') by value as arguments, but that is not how that code is written. Any sane compiler will inline that thing anyway, so the end result ends up being the same, but passing a structure with an array at the end (whether zero-sized or flexible) by value is just cray-cray, to use the technical term. So I resolved this semantic conflict by simply making that function take a 'const struct pppoe_hdr *hdr' argument instead. That's the proper way. Why was this not noticed in linux-next? Is it because nobody actually *looks* at the output? Because it's a "note" and not a "warning", it ends up not aborting the build, but I do think the compiler is pointing out a very real issue. It would be perhaps worthwhile looking at code that passes structures by value as arguments (or as return values). It can generate truly horrendously bad code, and even when said structures are small, it's uisually not the right thing to do. And yes, as noted, we sometimes do have that pattern very much on purpose, sometimes because of abstraction reasons (pte_t) and sometimes because we explicitly want the magic "two words of result" ('struct fd' and fdget()). So it's not a strict no-no, but it's not generally a good idea unless you have a very good reason for it (and it's particularly not a good idea when there's an array at the end). I've fixed this up in my tree, and it's all fine (and while I'm not *happy* with the fact that apparently nobody looks at linux-next output, I guess it is what it is). Linus