Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2228163rwr; Fri, 21 Apr 2023 06:16:13 -0700 (PDT) X-Google-Smtp-Source: AKy350ZRkirP0BGFYFIaQESmAx1cnbiWCLkrF1KyBE4/Jwhd5U84Lhwr7JocwDbwKyqzffHJDgY7 X-Received: by 2002:a17:903:2447:b0:1a6:b196:619d with SMTP id l7-20020a170903244700b001a6b196619dmr6055706pls.6.1682082972769; Fri, 21 Apr 2023 06:16:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682082972; cv=none; d=google.com; s=arc-20160816; b=a7PeG7hToCPA0DUIegkJwMM2EPqWB2P9QC8l2CUNkR42YoV02LYYmdt4hvfrxvY4hw h2fxC3ctGMX9/iYs4pF+egn8uPCjPq85Kol0EnYELcGRhrKWTh+R2USI7Dbwdnmo5pPV GhHDBzy9lgp1aaKKr1nybyMHbYWB+cj9Uhl7bvG24uthL0/ExvxMJ3cpJt8inhuI/Cec UkdQsvD1OIdKUGWg6vU6NVpvj71Wu2CYE5KjJgGwvd1oinr05tOGkOvx0wgwJxOwHBSz +7EoZ0BelkJDY1bS7HnRDHLBopW4e43zK69UX0pOAb7l7QuwUxECBVAo3rhcUyKmzKJU gXFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-transfer-encoding :mime-version:subject:cc:to:from:organization:dkim-signature; bh=eQnsBmjQDpvOsMgDQVzEiSuWLeqhHCBZpx3k6XC3WWA=; b=f3NhB1ss8FXOs+yu6TMKjthPWdLyrtjXRXUuPiVzUrAGXEYpbV9MQwxmVPm6O0R9wg mB5DuJCvGtRLSu0Vt7e+zNJYNRpvTUpo4nq9MbO/KsGSXj+lTg/aFSCaNMVHwHWCkU8w 34g1Yzlc/N/6B8QE7z47TIUdKpaPvZNuz7B8SS5DJLM+II9ACqxCA2mf4vW2zSxe9CMe h96kvzhDV9inOSucyuKExXjVI+HR7K+IwmRiGdkVQDJ0N6MVpehvCMhtac0EEGeuSxZU kooRBH+SPnuedmTF2LHIUlvQ2wFG+yHD526F92frrjZbCsZCKfmRATOR5Fbj45KyXx5u ZO1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=H+NLLf3L; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id km3-20020a17090327c300b001a1d5b745e3si4025566plb.557.2023.04.21.06.15.39; Fri, 21 Apr 2023 06:16:12 -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=@redhat.com header.s=mimecast20190719 header.b=H+NLLf3L; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232229AbjDUNJ4 (ORCPT + 99 others); Fri, 21 Apr 2023 09:09:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232288AbjDUNJr (ORCPT ); Fri, 21 Apr 2023 09:09:47 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D6419758 for ; Fri, 21 Apr 2023 06:09:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682082539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eQnsBmjQDpvOsMgDQVzEiSuWLeqhHCBZpx3k6XC3WWA=; b=H+NLLf3LHEgxeBvHDgJ6bey6GKryU6v4/qV/3LsFtmXGNKu8V2dAy4fZvjqnt96yZNmNxU lC2mandKPok8g3ArKHyu0iUf/lXnd3508L2Gbw8WL0KYD9Amg2g4Dxc9UGcCx2ixRrEuk8 6heTtPMa87yFjL99VvJLmvV+fQHF5fE= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-513-HzUmGbAsM_OAGhC59McdgQ-1; Fri, 21 Apr 2023 09:08:56 -0400 X-MC-Unique: HzUmGbAsM_OAGhC59McdgQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BFCF438123D2; Fri, 21 Apr 2023 13:08:55 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.158]) by smtp.corp.redhat.com (Postfix) with ESMTP id 45749492C3E; Fri, 21 Apr 2023 13:08:54 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells To: netdev@vger.kernel.org cc: dhowells@redhat.com, "Gustavo A. R. Silva" , Simon Horman , Kees Cook , Jeffrey Altman , Marc Dionne , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-afs@lists.infradead.org, linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next] rxrpc: Replace fake flex-array with flexible-array member MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 21 Apr 2023 14:08:53 +0100 Message-ID: <84871.1682082533@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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 From: Gustavo A. R. Silva Zero-length arrays as fake flexible arrays are deprecated and we are moving towards adopting C99 flexible-array members instead. Transform zero-length array into flexible-array member in struct rxrpc_ackpacket. Address the following warnings found with GCC-13 and -fstrict-flex-arrays=3D3 enabled: net/rxrpc/call_event.c:149:38: warning: array subscript i is outside array = bounds of =E2=80=98uint8_t[0]=E2=80=99 {aka =E2=80=98unsigned char[]=E2=80= =99} [-Warray-bounds=3D] 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=3D3 [1]. Link: https://github.com/KSPP/linux/issues/21 Link: https://github.com/KSPP/linux/issues/263 Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1] Signed-off-by: Gustavo A. R. Silva Signed-off-by: David Howells Reviewed-by: Simon Horman Reviewed-by: Kees Cook Reviewed-by: Jeffrey Altman cc: Marc Dionne cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: linux-afs@lists.infradead.org cc: netdev@vger.kernel.org cc: linux-hardening@vger.kernel.org Link: https://lore.kernel.org/r/ZAZT11n4q5bBttW0@work/ --- net/rxrpc/protocol.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/rxrpc/protocol.h b/net/rxrpc/protocol.h index 6760cb99c6d6..e8ee4af43ca8 100644 --- a/net/rxrpc/protocol.h +++ b/net/rxrpc/protocol.h @@ -126,7 +126,7 @@ struct rxrpc_ackpacket { uint8_t nAcks; /* number of ACKs */ #define RXRPC_MAXACKS 255 =20 - uint8_t acks[0]; /* list of ACK/NAKs */ + uint8_t acks[]; /* list of ACK/NAKs */ #define RXRPC_ACK_TYPE_NACK 0 #define RXRPC_ACK_TYPE_ACK 1 =20