From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41E04C77B75 for ; Wed, 17 May 2023 19:11:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229940AbjEQTL5 (ORCPT ); Wed, 17 May 2023 15:11:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229885AbjEQTLu (ORCPT ); Wed, 17 May 2023 15:11:50 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B4013AAF for ; Wed, 17 May 2023 12:11:48 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-64354231003so283525b3a.0 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=FjJjbXMLA8IzqrXKSD/mr5KdzDk+IueNdkOUnFT32/KhQwQkfHQfr0GqQek9bGPAAv 9dIJkLS6P9gQ4IwPqTKFK8F7W7OnbPIXK2YRe4cYjMNizGGqnOkJ5lZmZ0jHWszhP4xQ X15De891kHdOJL6t3YAVi2KfrECMGt6vgtVbd2W0f263Grmi51XEhw8Hok5tYH5+oksu no2LwKkrEFavq+xHzN+Esvk+mynrXIvrc3F41Y8tnrJGBSPnlupN7mzzHnpLDze5VehK E7R1e79azv2AGX/7P3A9cQ3JyCK+YeRdo+dY2bSPlXn40WNj3oDD/+NpSBv5TYfwjl/K wLCg== X-Gm-Message-State: AC+VfDzl7Ibh+u/SSxqcUd5miLaAI9A9Ve0z6FbtEjjj57kRc2RTmp6q Uz+eMC8FA6HBND+mJT2C376l+w== X-Google-Smtp-Source: ACHHUZ7wLjrqSTw1UhI0SssyHVt2MDqbCYAvBTTdRW0t5h6nvBmWStNbTIaFvH9ERQgSF8UUFI3Rjw== 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: Precedence: bulk List-ID: X-Mailing-List: linux-hardening@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