From patchwork Thu Apr 6 14:28:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 13203407 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 E3D01C761A6 for ; Thu, 6 Apr 2023 14:28:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238963AbjDFO2M (ORCPT ); Thu, 6 Apr 2023 10:28:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238965AbjDFO2K (ORCPT ); Thu, 6 Apr 2023 10:28:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 926408A51; Thu, 6 Apr 2023 07:28:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2F23B6450C; Thu, 6 Apr 2023 14:28:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B733C4339B; Thu, 6 Apr 2023 14:28:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680791288; bh=jhxfiG+JEN/B7SPCpeaq7cxeMMnz6qoyQOvS5SSFFt0=; h=Date:From:To:Cc:Subject:From; b=Zz13cmWj82aEGrHXBsUl6d2i6L41xOIQlyFWVqKmFZgKD6M904c1r218ROElrMQ9e zFaFbH958fBz/SaFcIwTI83FUGr8lFbeRg8emfKkWGRKE6uB/VH5w7FFUyaBzH/Oyg LBEL0vghIj5G5axIRSasIhhO99Vz25g0l/hYW2Lbzfc/DRcQSv+uHMIhAVcNCItb6x js09de36T1/ugJkwXO/LOwudjUuzWWWZrWSwKQzJXpXlEzP5a+tI7YbjsEg1OZ07pw 3EY8sNNdLZEN+/MrUTpXavu0ePj+aNWo/5sToRYMtvT7MDhnzF6t5QPDnPVHB+01tO JA46rB1hJyiiQ== Date: Thu, 6 Apr 2023 08:28:42 -0600 From: "Gustavo A. R. Silva" To: Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" , linux-hardening@vger.kernel.org Subject: [PATCH][next] s390/diag: Replace zero-length array with flexible-array member Message-ID: MIME-Version: 1.0 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-hardening@vger.kernel.org Zero-length arrays are deprecated [1] and have to be replaced by C99 flexible-array members. This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy() and help to make progress towards globally enabling -fstrict-flex-arrays=3 [2] Link: https://github.com/KSPP/linux/issues/78 [1] Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [2] Signed-off-by: Gustavo A. R. Silva --- arch/s390/include/asm/diag.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/s390/include/asm/diag.h b/arch/s390/include/asm/diag.h index 674a939f16ee..902e0330dd91 100644 --- a/arch/s390/include/asm/diag.h +++ b/arch/s390/include/asm/diag.h @@ -90,7 +90,7 @@ struct diag8c { u8 num_partitions; u16 width; u16 height; - u8 data[0]; + u8 data[]; } __packed __aligned(4); extern int diag8c(struct diag8c *out, struct ccw_dev_id *devno);