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 8F04FC54EBE for ; Thu, 12 Jan 2023 22:49:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231540AbjALWtI (ORCPT ); Thu, 12 Jan 2023 17:49:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233589AbjALWtE (ORCPT ); Thu, 12 Jan 2023 17:49:04 -0500 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7A53E0F for ; Thu, 12 Jan 2023 14:49:01 -0800 (PST) Received: by mail-pj1-x102b.google.com with SMTP id o13so17121328pjg.2 for ; Thu, 12 Jan 2023 14:49:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; 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=GZfksTuFjoscMgLpeLPqh4N8gEWgn0z0z3v4P62lrqg=; b=OOtO5L5MXolhyRP8x0LwCnc0Zt/IaTZHakf9JxR0SpiN+raNaxR6ZRgDfTexKXYfhP NWpHQdZVlRLY+lKBziKXeKvu/IPTgXErVWLJLjnSE8HilfmJ/mHGqRKDLUaEaEiovSdM 49FyiqBJZ/sWTzT9amSkx/BBvUxVoReJ7Dt5Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=GZfksTuFjoscMgLpeLPqh4N8gEWgn0z0z3v4P62lrqg=; b=NjoNmanZwa02DOJZ6I8e3uOcn9Ehs4oDZ1/SVMXxx33ZYuaFO36WJc9o1Rs9W8qNxh EMwvr23R5QydM529cTpego0K8aVVXtI2ApzIDtvCeghywmqJ7Qd6MQJHZXlZY+TbpN0d I1Ke8UZ/vMTDJhdNgZuZR2YwW06DZDtQMYrAti/Hj+LZRXrxr41xQrC8SC6WsP3faEkS HEsIdpJnFjnXbS9v8kNkWPb7jSe6orVw5IyzkLS0xodE5TrIn1NAGL0o9Ex04Lp8mCQj iVppHYbMGWKLt3SOGra0pu1eCkgnS5mkmhb78JGSIEn+q5y/DbtY+H4Z9P9WePv03J4G 421w== X-Gm-Message-State: AFqh2krhzBOV3ovoFpsUHUxjEdejAOrFP7LnTRhhEYiA9YlrritmfWUH QuFcrw37iHNgB7A7ACC7xTgusQ== X-Google-Smtp-Source: AMrXdXsAJrytZC7RA8wdAMnUFaWk6Tfi5iZGRjX61dCPmw3ckLM4sS+INxWrMpZmIVGV0Ep1UePjUA== X-Received: by 2002:a17:902:ebca:b0:191:117a:414f with SMTP id p10-20020a170902ebca00b00191117a414fmr90680365plg.27.1673563741418; Thu, 12 Jan 2023 14:49:01 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id d13-20020a170902f14d00b001873aa85e1fsm12613137plb.305.2023.01.12.14.49.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jan 2023 14:49:00 -0800 (PST) Date: Thu, 12 Jan 2023 14:49:00 -0800 From: Kees Cook To: "Gustavo A. R. Silva" Cc: Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH][next] Bluetooth: HCI: Replace zero-length arrays with flexible-array members Message-ID: <202301121448.59EDAA92FF@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-kernel@vger.kernel.org On Mon, Jan 09, 2023 at 07:37:52PM -0600, Gustavo A. R. Silva wrote: > Zero-length arrays are deprecated[1] and we are moving towards > adopting C99 flexible-array members instead. So, replace zero-length > arrays in a couple of structures with flex-array members. > > 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 [2]. > > Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays [1] > Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [2] > Link: https://github.com/KSPP/linux/issues/78 > Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook -- Kees Cook