Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp903592pxb; Fri, 22 Apr 2022 13:55:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOtC3YYAcuc05QwTg9z5N0XSsCeQo4w+JeMZAY9kvt2pKqdgPsHcpRsV5WQ2pGCH1XRhli X-Received: by 2002:a17:902:7e0d:b0:156:47a4:a7c4 with SMTP id b13-20020a1709027e0d00b0015647a4a7c4mr6568761plm.141.1650660933983; Fri, 22 Apr 2022 13:55:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650660933; cv=none; d=google.com; s=arc-20160816; b=i0RwF+MvITAaLfKnaTNI175CkPPnj5Uhh9w6VAwicINJcC6kg8/vW7zaI6vNGRZBfl LFCAR1PqT+vPSZglA2XVBK0+QVM+z2aqdyqanLlK13UjaMotsrTcnK8QrVau0EfVWxTM lBV8NKSHh3iKJmcJgQoxx/2ev8AkSWejLLuAaCLazSqiu8bgiy24m/qTqZ6v4hQp8ZVD /Iu4JAp4l9pCO94hbIy8x88Vt1CNw7YczQgVuzxIrPoZd3p2mILR87urw4Q9TqjDCdt8 xd4U24Ix+k5nFtvJFW9Uc+OUa36G3EjadlAUTPL7CluF32nArv8Kke7c4HUeQWIEdaqI PljQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=nWKrOVONxRO0WSObJee+zFs6W4ugiC3GFnYlyVVnV4Y=; b=yX52tv9XMPTrtufa3XUwTLiYX/HtsbSL7JZb/w+MdwrPQJFbb831ycBJap7SgZAKdZ aKxJ/ENQ6F7ba6s3awgQKGVhIUHRCBlkscxSKCPQz0SRjJuW11+s4+erP5nUpxnTA8UO QwGVKiTLd2tWjGOBKSZZ4qQF6Cxfpm/IuqIvQow2iTPtgMnO0VdewlgCr0JJeXHjjEo7 Lcs6ZOHreQN73qPUgXt4z18g0VPZbUGxRs5Pz/6Aekt+tKZQc2iMkwvXTjk4rJlehWzf +XZnnBY9Wh8RIOeRYGxyPAPUNxMw3aRxE1WlDYFxtSmvR//Q/sMZLJgUaznY39DAC8yG /jpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=IMvNMRuK; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id ng8-20020a17090b1a8800b001d5394f18dfsi8265896pjb.35.2022.04.22.13.55.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 13:55:33 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=IMvNMRuK; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 72B982D2EA5; Fri, 22 Apr 2022 12:50:59 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1385784AbiDUHfa (ORCPT + 99 others); Thu, 21 Apr 2022 03:35:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343901AbiDUHf2 (ORCPT ); Thu, 21 Apr 2022 03:35:28 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD38D11A21 for ; Thu, 21 Apr 2022 00:32:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=nWKrOVONxRO0WSObJee+zFs6W4ugiC3GFnYlyVVnV4Y=; b=IMvNMRuK6bK24C75DGnVR8yDTe L1C3xGGpNCkk7cE9PZWy0E9MJ468LszeOST4RZIzmVQiRG3vb5N08oD1KLttCoXCIXiJmZfPd6RK0 4eFy8+l5CZCx+LWEbzPX6IYMnVvdi7GEh49y9u+gONsNulmf+DX4g4HRo6i7edF0DgyTcYt8bssNM nt85+OS3Z897K8z7ZreZpPMldBppnlxsauvrSUzlrVMv6/d1xDVaoc3iFMGmOxprkPxCbRb7nOnJa kjZYOdLFIb2OgHx/DrNIakRIYy6je3kWwb2+nNu+WLbbr/s5r7F576CBFgh9pT4qaygybEW3yWFdv 84UU8Jzw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhRIS-004rlh-2H; Thu, 21 Apr 2022 07:32:12 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 98EC59861A4; Thu, 21 Apr 2022 09:32:11 +0200 (CEST) Date: Thu, 21 Apr 2022 09:32:11 +0200 From: Peter Zijlstra To: Kees Cook Cc: Andrew Morton , Christophe de Dinechin , trivial@kernel.org, Ben Segall , "Michael S. Tsirkin" , Steven Rostedt , Ingo Molnar , Mel Gorman , Dietmar Eggemann , Vincent Guittot , Paolo Bonzini , Daniel Bristot de Oliveira , Jason Wang , virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Zhen Lei , Juri Lelli Subject: Re: [PATCH 1/3] sched/headers: Fix compilation error with GCC 12 Message-ID: <20220421073211.GJ2731@worktop.programming.kicks-ass.net> References: <20220414150855.2407137-1-dinechin@redhat.com> <20220414150855.2407137-2-dinechin@redhat.com> <20220414133050.b820fa45d42de4cfc24db82b@linux-foundation.org> <20220417155205.GI2731@worktop.programming.kicks-ass.net> <202204201117.F44DCF9@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202204201117.F44DCF9@keescook> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE 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, Apr 20, 2022 at 11:45:05AM -0700, Kees Cook wrote: > > -Wno-array-bounds > > Please no; we just spent two years fixing all the old non-flexible array > definitions and so many other things fixed for this to be enable because > it finds actual flaws (but we turned it off when it was introduced > because of how much sloppy old code we had). > > > Is the obvious fix-all cure. The thing is, I want to hear if this new > > warning has any actual use or is just crack induced madness like many of > > the warnings we turn off. > > Yes, it finds real flaws. And also yes, it is rather opinionated about > some "tricks" that have worked in C, but frankly, most of those tricks > end up being weird/accidentally-correct and aren't great for long-term > readability or robustness. Though I'm not speaking specifically to this > proposed patch; I haven't looked closely at it yet. So the whole access outside object is UB thing in C is complete rubbish from an OS perspective. The memory is there and there are geniune uses for it. And so far, the patches I've seen for it make the code actively worse. So we need a sane annotation to tell the compiler to shut up already without making the code an unreadable mess.