From patchwork Tue Jan 16 08:44:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 1886989 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=AZBWwx1k; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TDjMf3cQLz1yPV for ; Tue, 16 Jan 2024 19:48:14 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0620438582A1 for ; Tue, 16 Jan 2024 08:48:10 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id DE345385841D for ; Tue, 16 Jan 2024 08:44:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DE345385841D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DE345385841D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705394683; cv=none; b=UGMjj9JAS9NJxTB0+3Db+Id43U4Ab8pLQcbmrWGtithqBsG8b7TyrO61YJJrr/K7EFcsghSaIrALbQqudCoChS437D/gGXrQYqsnHsjqXqEVspWpqwV3sNwGuge0uQYRQSISdrNNAhEeqVqb9ll5tcp99l2pN82Dxf0t1lLiFFI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705394683; c=relaxed/simple; bh=PuuWeNasd+YsgA/XDbLkir1Ttec1PdfAJk7hdE77kcI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Zj/ks4lal6Z2gTvR2BGAfP1plXncukFDoISlN+uSUUnFeq6mmHykWQ+HKZG2v5cZOH7kn6B9z9oCQRcM3CdyjtAmXL3648XGENyjDlXDnMgtLbd9UPc/qiH5Gnu3mH8EPnUZSI78ev+KoN73dbfCRUDZFILf8b9J5tF6TBfH0PM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353728.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 40G8RIxl031016 for ; Tue, 16 Jan 2024 08:44:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : content-type : content-transfer-encoding : mime-version; s=pp1; bh=wjtFJEC+VdT6wTv558FSbfdzK8dSBujkR1QxnpEKUc8=; b=AZBWwx1kcMcbMmg2G+aBtT8gLCAMD4AG5JczBuM2GGUaNluOFAzNDoT56f4lF/suV0Xp adfNkDodP5Fa66Ow/jJDLHgQy0hMPqu+vlS30Lab2n9itE8Yptn/BrMzZft+ljQvtUgf BC75LkRZnHZb7JOl/UY4b+aZtanbO+zxZeqsbk9PP4yYX0QmpsfX7hyv+bX1elFT69Ww 8HszO9RgvB6VFglHUn6q53Z7dU96OhVVBNEBJa2hytCT1f7w6ACNAPE42YGLMch+hBsW r33bZ0y7OIDzyAttAb0gG1Z0dCktDZl2bdGMMiu2+tDWknDTJJpd3VP5h+dQmVObDPCI YQ== Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3vnpa2rdxk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 16 Jan 2024 08:44:36 +0000 Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 40G6xBxa014845 for ; Tue, 16 Jan 2024 08:44:35 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3vm4usnqkx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 16 Jan 2024 08:44:35 +0000 Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 40G8iWxg15532622 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 16 Jan 2024 08:44:33 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C68BB2004D; Tue, 16 Jan 2024 08:44:32 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9DEC12004B; Tue, 16 Jan 2024 08:44:32 +0000 (GMT) Received: from a35lp69.lnxne.boe (unknown [9.152.108.100]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 16 Jan 2024 08:44:32 +0000 (GMT) From: Stefan Liebler To: libc-alpha@sourceware.org Cc: Stefan Liebler Subject: [PATCH] Fix stringop-overflow warning in tst-strlcat2. Date: Tue, 16 Jan 2024 09:44:30 +0100 Message-ID: <20240116084430.1082389-1-stli@linux.ibm.com> X-Mailer: git-send-email 2.43.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: -EFu6CsoNwWfS-74ilJAv-voyWyfFRxk X-Proofpoint-GUID: -EFu6CsoNwWfS-74ilJAv-voyWyfFRxk X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-16_04,2024-01-15_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 clxscore=1015 malwarescore=0 priorityscore=1501 spamscore=0 mlxscore=0 bulkscore=0 lowpriorityscore=0 suspectscore=0 mlxlogscore=815 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2401160068 X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org On s390x, I get warnings like this when do_one_test is inlined with SIZE_MAX: In function ‘do_one_test’, inlined from ‘do_overflow_tests’ at tst-strlcat2.c:184:2: tst-strlcat2.c:49:18: error: ‘strnlen’ specified bound [18446744073709550866, 18446744073709551615] exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=] 49 | # define STRNLEN strnlen | ^ tst-strlcat2.c:89:23: note: in expansion of macro ‘STRNLEN’ 89 | size_t dst_length = STRNLEN (dst, n); | ^~~~~~~ This patch just marks the do_one_test function as noinline as also done in test-strncat.c: Fix stringop-overflow warning in test-strncat. https://sourceware.org/git/?p=glibc.git;a=commit;h=51aeab9a363a0d000d0912aa3d6490463a26fba2 --- string/tst-strlcat2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/string/tst-strlcat2.c b/string/tst-strlcat2.c index 225520a46b..1ec26a2432 100644 --- a/string/tst-strlcat2.c +++ b/string/tst-strlcat2.c @@ -81,6 +81,7 @@ IMPL (STRLCAT, 1) typedef size_t (*proto_t) (CHAR *, const CHAR *, size_t); static void +__attribute__((noinline)) do_one_test (impl_t *impl, CHAR *dst, const CHAR *src, size_t n) {