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 DE134C61DB3 for ; Thu, 12 Jan 2023 22:49:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234765AbjALWtF (ORCPT ); Thu, 12 Jan 2023 17:49:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232772AbjALWtD (ORCPT ); Thu, 12 Jan 2023 17:49:03 -0500 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB1741031 for ; Thu, 12 Jan 2023 14:49:01 -0800 (PST) Received: by mail-pl1-x62e.google.com with SMTP id d9so21653397pll.9 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=ncsGPXxEAFcjJYe3M54YnzkuufF6c95ao8kbKgqpCMkmznIgxyV9/afr7U9QSzEIPL vWGQg+9OTW10NY/w/EJstCr3xnfgjWLrhmtdWLaijf0MDtgKz1sTO5bXiypnCvvUCzHr y8LOmpkQXnqZTIrsHaQLSja7Ga+0DjHdwONo/Nis7kz7av/UU570nA35mYHMpAzj7g01 IdJVoJNnzT1m+Zgnn3EWFd2zmd9pDGsOX5w5ZqcXa/v4mZeKsuqk2B/mIYWquBZfgcRQ n/yqQE9qzQ2s6QZnLQhJi1jJYHKB4AwqlCFviM5O9fREDngXUsPXEHmWIc2EqbDKQ/b5 S8Kg== X-Gm-Message-State: AFqh2kom0HO+sfccnBRNzUd0b1/IH1HyFIbagFqnimaEIILN7ebLhyi/ pHGgaec7/HWzj9LF7TbyOFfyKQ== 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-bluetooth@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