From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8750E10978 for ; Mon, 24 Jul 2023 21:34:49 +0000 (UTC) Received: from smtp-fw-33001.amazon.com (smtp-fw-33001.amazon.com [207.171.190.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B52110D8 for ; Mon, 24 Jul 2023 14:34:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1690234489; x=1721770489; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=vaRxenrkUPEUABvAFjDdwimN8CPg98ngU5PWFLGC3Wk=; b=rTxsUc/tptgafY32Le/3vTYx7kxwmnYSHapToCqnW2BlcVsbuZoc5Ks5 oxp8H8NMIda40Siul3KgS5mRlaeYz7C20yUMakIC8T/VFrZ8raRtCFAc/ VMx+dBgtPDz5fnKqQ99+HpSTKYnY5nosGuBrOEfiMOLCtDL4U/CKFoC/i 8=; X-IronPort-AV: E=Sophos;i="6.01,228,1684800000"; d="scan'208";a="296967578" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-pdx-2a-m6i4x-d47337e0.us-west-2.amazon.com) ([10.43.8.6]) by smtp-border-fw-33001.sea14.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jul 2023 21:34:41 +0000 Received: from EX19MTAUWA002.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-pdx-2a-m6i4x-d47337e0.us-west-2.amazon.com (Postfix) with ESMTPS id 37C7E60A89; Mon, 24 Jul 2023 21:34:39 +0000 (UTC) Received: from EX19D004ANA001.ant.amazon.com (10.37.240.138) by EX19MTAUWA002.ant.amazon.com (10.250.64.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Mon, 24 Jul 2023 21:34:38 +0000 Received: from 88665a182662.ant.amazon.com (10.106.100.36) by EX19D004ANA001.ant.amazon.com (10.37.240.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Mon, 24 Jul 2023 21:34:35 +0000 From: Kuniyuki Iwashima To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: Willem de Bruijn , Kees Cook , "Gustavo A. R. Silva" , "Breno Leitao" , Kuniyuki Iwashima , "Kuniyuki Iwashima" , Subject: [PATCH v3 net 0/2] net: Fix error/warning by -fstrict-flex-arrays=3. Date: Mon, 24 Jul 2023 14:34:23 -0700 Message-ID: <20230724213425.22920-1-kuniyu@amazon.com> X-Mailer: git-send-email 2.30.2 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.106.100.36] X-ClientProxiedBy: EX19D041UWB001.ant.amazon.com (10.13.139.132) To EX19D004ANA001.ant.amazon.com (10.37.240.138) Precedence: Bulk X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE,T_SPF_PERMERROR autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3") started applying strict rules for standard string functions (strlen(), memcpy(), etc.) if CONFIG_FORTIFY_SOURCE=y. This series fixes two false positives caught by syzkaller. Changes: v3: * Drop Reviewed-by * Patch 1: Use strnlen() * Patch 2: Add a new flex array member v2: https://lore.kernel.org/netdev/20230720004410.87588-1-kuniyu@amazon.com/ * Patch 2: Fix offset calc. v1: https://lore.kernel.org/netdev/20230719185322.44255-1-kuniyu@amazon.com/ Kuniyuki Iwashima (2): af_unix: Fix fortify_panic() in unix_bind_bsd(). af_packet: Fix warning of fortified memcpy() in packet_getname(). include/uapi/linux/if_packet.h | 6 +++++- net/packet/af_packet.c | 2 +- net/unix/af_unix.c | 6 ++---- 3 files changed, 8 insertions(+), 6 deletions(-) -- 2.30.2