Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2633861rwd; Wed, 17 May 2023 12:13:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Jwn/aCXaPT4FKNPohicC2OIIDeUAE/pgGD/D8HU7NaLfD218ejM5nLLLLhj2w7TPw3g1y X-Received: by 2002:a17:903:228c:b0:1a9:7dc2:9427 with SMTP id b12-20020a170903228c00b001a97dc29427mr3952605plh.21.1684350822633; Wed, 17 May 2023 12:13:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684350822; cv=none; d=google.com; s=arc-20160816; b=gNKQMCzKFoN2Cdzc1d2bpSIb4T1kgq1KezGWXFTV2D0u+hc+m4QEUoHURM2EnI6vo7 KAhGPLyKQxtJv2ieGh8ylvCds6Cv0grQWqz9A+B9IC3VjdLR3m79O/J+CqjZZlVy2Thz Ae/MQrgQzIzXpzC+ORcCVQ1QJvqGBl54npAKyIjn+W0xTVAhFGRS596CJvYGp2RD0mi2 /FObNuAuVAiImYYOBMixEGlzdwk7oaJKpTR7FQy+hEC9j7I5YsuWtSS+6SZj1gIUna47 RTPAOGwkRAnyaK4o+GUnS1bigI5dbpid10M+sEpTTl08XsyxY8rgx+2Wi7dSxGYbn1Hm WFxg== 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=ZmRR+LDHi4vpUNfcU4UnpvuCDjrlHXKQ9miogAVxhUc=; b=CwevBKLF/8aXAVaM20Tk8nraFOBauRLmBlbMVF4ByuOPmmk8VV0fw8RSuhdJNwboiX jb4lm+Eam1Ve6ZecmGByGjPS7JoANLh38AC8X0bHWY1azkqC2gyGs6rPOFa4eoylvAAq nMgrAF/Uuq4eNxEhWOSa+GUbHs0a79AJf3pF8fOIJ++svkP/85HsbRFjMBA8WGQK8fzo Ls4HCpMlR5i93GzexqYC0d3P19ECkwVKwxzxuYfcA0cU7GWvjKy7m8DSD4Dg2YkfQZ/X TTsj67Hk9gGdpd3zYVRUiuB8kluqnWpzoxZYVkZFgMDL0weCVEuANKZUeP/PizEdHc77 C7mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=FDNiwE1w; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c11-20020a170903234b00b001a64e7b7026si23133766plh.438.2023.05.17.12.13.27; Wed, 17 May 2023 12:13:42 -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=@chromium.org header.s=google header.b=FDNiwE1w; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229582AbjEQTL6 (ORCPT + 99 others); Wed, 17 May 2023 15:11:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229519AbjEQTLu (ORCPT ); Wed, 17 May 2023 15:11:50 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68D393AAD for ; Wed, 17 May 2023 12:11:48 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-64390dc0a7fso283238b3a.1 for ; Wed, 17 May 2023 12:11:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1684350708; x=1686942708; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ZmRR+LDHi4vpUNfcU4UnpvuCDjrlHXKQ9miogAVxhUc=; b=FDNiwE1wBwNXmIbzPtvxKOeuyLv+uey9+OwW+wADK5iqWFO7m04+X+j+7fGCgiWNPq o1nMxEcxrUqnKmSqQ7/cx6sY3sunlH3JvM6/vE6FP03x8sb8khI2/boHqXI4JYeMpQJL jGNnTk3cf6CUNOTaJYjDV6pkpkZofERqfBMNQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684350708; x=1686942708; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ZmRR+LDHi4vpUNfcU4UnpvuCDjrlHXKQ9miogAVxhUc=; b=HI/i9wHt6/viDJIEEl+dHAUKWaxqGx9MAtlnzE5yk4Le7VeQZXG08aL5GHk8L3zaXl rHAoMFmvsWJdFTHSF/QTe+1OM6ifLpL/BPcmzGOglRTJod8hKeRnrXSFS44E9Sufg/v7 JDdWQVUlBbOIDNPvR5j5vQpwi7wgCWq741XKZVA7NhYvwcwh/J71Ll7DlUczAMOnDoad 6uQvjqpuwBOuQ+gMVGWPtscv+MGEi9ng3nJyhAZK2rP5Ocf1bOAh4BJ047vaErAqTdaP /blhHHTpWs+kIaZT0sN5HCcpk7Mmq/zUzoB0WegZry/y/fiw/gE8iudLwvTnnhLkbd1J GvjQ== X-Gm-Message-State: AC+VfDxKtB42qnhMg3ffhR5SssfpBjyxTJ6UL81Dvq1n0UzMUruVb4PJ iEsFAn0JVQAKChvnCFQmxjqavA== X-Received: by 2002:a05:6a00:1901:b0:647:157b:cb61 with SMTP id y1-20020a056a00190100b00647157bcb61mr380822pfi.7.1684350707893; Wed, 17 May 2023 12:11:47 -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 e12-20020a62aa0c000000b006439b7f755bsm15980446pff.98.2023.05.17.12.11.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 12:11:47 -0700 (PDT) Date: Wed, 17 May 2023 12:11:46 -0700 From: Kees Cook To: "Gustavo A. R. Silva" Cc: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Konrad Dybcio , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH 1/2][next] media: venus: hfi_cmds: Replace one-element array with flexible-array member Message-ID: <202305171211.F973001@keescook> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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 Tue, May 16, 2023 at 05:14:27PM -0600, Gustavo A. R. Silva wrote: > One-element arrays are deprecated, and we are replacing them with flexible > array members instead. So, replace one-element arrays with flexible-array > members in struct hfi_session_set_buffers_pkt, and refactor the rest of > the code, accordingly. > > This helps with the ongoing efforts to tighten the FORTIFY_SOURCE > routines on memcpy() and help us make progress towards globally > enabling -fstrict-flex-arrays=3 [1]. > > This results in no differences in binary output. > > Link: https://github.com/KSPP/linux/issues/79 > Link: https://github.com/KSPP/linux/issues/292 > Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1] > Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook -- Kees Cook