From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by sourceware.org (Postfix) with ESMTPS id 1D6483858418 for ; Wed, 12 Apr 2023 18:46:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1D6483858418 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-517bd9b1589so822404a12.1 for ; Wed, 12 Apr 2023 11:46:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1681325196; x=1683917196; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:subject:cc:to:from:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=znK8iEugww6+QPXID93BdfwtP9jhqFIhJ5sXPwuF8Yk=; b=Jepue7HnJdTCvdHN3lFQShIh9zUGvK3DLLEvXwJIbScRHRL/aYu2wR575hPcp6Io0E K2jE+f3MRYD/SYBkkbQrM/BeDRrGzXY9/U4l0BSY5oMQjX9G9h7J4OWMgh54QfzK6An3 rJ/h/JxWjwvd9ro/De4G4AQ94MQffwXHwsY+U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681325196; x=1683917196; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:subject:cc:to:from:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=znK8iEugww6+QPXID93BdfwtP9jhqFIhJ5sXPwuF8Yk=; b=DrPtJqNlJDKxai0nE3UUR5AU6g+28W0vzgbB/GjbAD0VzEyFP4sx/y3nAWjABDTSpt fDZFADgd2u458khBenInn/lmmqDsjPed/lEQmRUIaNj/R7S5VlWgzNFBVWBe59dQ6/Rl uEDJJYKJ67PCfWrhJL9ou79WZ1Z0bRRhrWoFipuuMmQLxqa6L6s8JhrUvoa/YMqe5UVY 0yGYjMdl01V3/uhbDCVpEG5Juu/5VBk5sj24lZv5a9pDMjZi9yQyJfynih9Lvu8TkrxZ isgL4jH3Lf1jmxDPXsd/jcL8GuIWognsS6sbtL1fQg3t/uMZVlzQBbqMmQ8ek4oKGMrn 4X+Q== X-Gm-Message-State: AAQBX9cj9/RTAXxi7ytEL0l67wpr7BLwiLBkLDVoMuDj+cf+O+nrKc4w 1ICbr3S658Eh2i2QRJu1Wrh1xw== X-Google-Smtp-Source: AKy350Zq/Ae5zCCVFNyRk6ZFQ9u0VpePUInn8pHWy04d/OZ6lCW1jRKo0SM+FHEPFYtl28Es/E38Iw== X-Received: by 2002:aa7:88c9:0:b0:627:f9ac:8a33 with SMTP id k9-20020aa788c9000000b00627f9ac8a33mr47773pff.13.1681325195927; Wed, 12 Apr 2023 11:46:35 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id 22-20020aa79216000000b005ac419804d5sm12354020pfo.98.2023.04.12.11.46.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 11:46:35 -0700 (PDT) Message-ID: <6436fc8b.a70a0220.2d124.8193@mx.google.com> X-Google-Original-Message-ID: <202304121145.@keescook> Date: Wed, 12 Apr 2023 11:46:34 -0700 From: Kees Cook To: Qing Zhao Cc: jakub@redhat.com, joseph@codesourcery.com, richard.guenther@gmail.com, siddhesh@gotplt.org, gcc-patches@gcc.gnu.org Subject: Re: [V6][PATCH 1/2] Handle component_ref to a structre/union field including flexible array member [PR101832] References: <20230328154944.3946619-1-qing.zhao@oracle.com> <20230328154944.3946619-2-qing.zhao@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230328154944.3946619-2-qing.zhao@oracle.com> X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,JMQ_SPF_NEUTRAL,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Tue, Mar 28, 2023 at 03:49:43PM +0000, Qing Zhao wrote: > the C front-end has been approved by Joseph. > > Jacub, could you please eview the middle end part of the changes of this patch? > > The major change is in tree-object-size.cc (addr_object_size). > (To use the new TYPE_INCLUDE_FLEXARRAY info). > > This patch is to fix PR101832(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101832), > and is needed for Linux Kernel security. It’s better to be put into GCC13. > > Thanks a lot! Just to confirm, I've done build testing with the Linux kernel, and this is behaving as I'd expect. This makes my life MUCH easier -- many fewer false positives for our bounds checking. :) -Kees -- Kees Cook