From patchwork Mon Feb 5 13:22:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 1895269 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=G5mbGugF; 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 4TT6Vv5160z23gT for ; Tue, 6 Feb 2024 00:22:31 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A9C90385828C for ; Mon, 5 Feb 2024 13:22:29 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 9F0003858439 for ; Mon, 5 Feb 2024 13:22:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9F0003858439 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 9F0003858439 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707139333; cv=none; b=fcvuzGwthTm6yCg89chz3zqtDhL1UhXafozZSobUuYXdHerxvw4AUYiacJ6AkPtsQSp5pjECwo6dHRpRYiWDOlfy3sbAkjbKfET9ptaXypFovzI8tsvCGEjPmjMJ5F4qPFPqmZwaC1qUeAQE3EEqPmDJ8CiwCWLGUK3cZps/zhA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707139333; c=relaxed/simple; bh=hn3U6SxcvgV0IIf0Es1SwQycVWdISbMdGzdKs7ohKJE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ds7w4ybQoy9ohjUawRTJduSHrw3bEkEevOfSaTKb1FxtYxk9te6FdbRdhwQ1tzB66cM7U4670jpeE/gdwLxjuqmkXSAkCDUCgt3OcjIsnRq4cFK49RMObPNhDc7yxtk5HS73h8sqIgE009g5ICDjlH6KXxT6splQxbZIz0mFHc8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 415CQnCQ012487 for ; Mon, 5 Feb 2024 13:22:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=t6OoEbT3BsGmWFC+7YQhiaGNIQPAi8Y5BiDXRxyAomk=; b=G5mbGugFtCmZiQFCUT8UoOozEee+Jkz5zrREHOlZrci9N2t7OWJCgRrXMSFn/EHzqrXI VTIwMgd1iXf/pX5+DQMNQzxwWlI4P5p3yHDChKN54kO/xWd433xLKJE/7phI47ZQCIku sCIQXMAj0TbSY/pSqZUpUadsIK51Pn9ZXMnm2Hi1iVK6Tne7MMFWnL43tdwlFGSLVPtI XyFa/OqyC9jxjMig8n+nzLzS3Td9QFgQju7yHLxJyjyIznumGgVHTCBUcdcz5beo2Mxa 3+A/dqYZMOzWOyZ9nd3BlRSY12s79Cm0IUARSeMbiVELIDjlx9RkQVUNULDPsHz5PQdG 6g== Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3w2y482b76-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 05 Feb 2024 13:22:11 +0000 Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 415DDCO4008758 for ; Mon, 5 Feb 2024 13:22:11 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3w206y8sxx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 05 Feb 2024 13:22:11 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 415DM8nY30736744 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 5 Feb 2024 13:22:08 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3E64120043; Mon, 5 Feb 2024 13:22:08 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1BE5020040; Mon, 5 Feb 2024 13:22:08 +0000 (GMT) Received: from a35lp69.lnxne.boe (unknown [9.152.108.100]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 5 Feb 2024 13:22:08 +0000 (GMT) From: Stefan Liebler To: libc-alpha@sourceware.org Cc: Stefan Liebler Subject: [PATCH] string: Add hidden builtin definition for __strcpy_chk. Date: Mon, 5 Feb 2024 14:22:06 +0100 Message-ID: <20240205132206.1603576-1-stli@linux.ibm.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: -uX_88ss3dBgNn64KIPpIv1U-KkA8sYJ X-Proofpoint-GUID: -uX_88ss3dBgNn64KIPpIv1U-KkA8sYJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-05_08,2024-01-31_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 adultscore=0 impostorscore=0 malwarescore=0 priorityscore=1501 bulkscore=0 clxscore=1015 mlxlogscore=551 spamscore=0 mlxscore=0 lowpriorityscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402050101 X-Spam-Status: No, score=-9.9 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, URIBL_BLACK 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 Otherwise on at least x86_64 and s390x there is an unwanted PLT entry in libc.so when configured with --enable-fortify-source and build with -Os. This is observed in elf/check-localplt Extra PLT reference: libc.so: __strcpy_chk The call to PLT entry is in inet/ruserpass.c. Reviewed-by: Adhemerval Zanella --- debug/strcpy_chk.c | 1 + include/string.h | 1 + 2 files changed, 2 insertions(+) diff --git a/debug/strcpy_chk.c b/debug/strcpy_chk.c index e54780ddde..dd2c453417 100644 --- a/debug/strcpy_chk.c +++ b/debug/strcpy_chk.c @@ -31,3 +31,4 @@ __strcpy_chk (char *dest, const char *src, size_t destlen) return memcpy (dest, src, len + 1); } +libc_hidden_builtin_def (__strcpy_chk) diff --git a/include/string.h b/include/string.h index 86d1fa4abe..3b4c6007d7 100644 --- a/include/string.h +++ b/include/string.h @@ -215,6 +215,7 @@ libc_hidden_builtin_proto (__mempcpy_chk) libc_hidden_builtin_proto (__memset_chk) libc_hidden_builtin_proto (__stpcpy_chk) libc_hidden_builtin_proto (__strncpy_chk) +libc_hidden_builtin_proto (__strcpy_chk) #endif