Message ID | 20220407115948.1664232-1-stli@linux.ibm.com |
---|---|
State | Committed |
Commit | 5325233313c66aea13e86f5dd59618e9dd74b510 |
Headers |
Return-Path: <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B2DA8385780D for <patchwork@sourceware.org>; Thu, 7 Apr 2022 12:00:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B2DA8385780D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1649332818; bh=YupcYpZ1xy3sfsJdhpXSpoB1lB8GaXA5eOxK58pZnE8=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=sbOx5Z5DRX/key1jFVFpHRMXVw70otIBjb3jAU3KMCX2Fw3pNf+J+Ekw3jvqyxhlY FgzjBmLpnZ7EnU8VDtMxrRNTdPWfbHmxYaY/01xkVNPa5UfkQeRi02oRTSPke7q7f+ zptL9vPvcN1ZIAcnHq/MYtLRW9UHEa6UxWwyL72g= 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 8FCC93858C50 for <libc-alpha@sourceware.org>; Thu, 7 Apr 2022 11:59:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8FCC93858C50 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 237ALiNm011875 for <libc-alpha@sourceware.org>; Thu, 7 Apr 2022 11:59:55 GMT Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com with ESMTP id 3f9x4w1uj3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for <libc-alpha@sourceware.org>; Thu, 07 Apr 2022 11:59:55 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 237BvLTH008775 for <libc-alpha@sourceware.org>; Thu, 7 Apr 2022 11:59:53 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma06ams.nl.ibm.com with ESMTP id 3f6drhssft-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for <libc-alpha@sourceware.org>; Thu, 07 Apr 2022 11:59:52 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 237BxnvY54985154 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 7 Apr 2022 11:59:49 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B1F6DAE056; Thu, 7 Apr 2022 11:59:49 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 90560AE051; Thu, 7 Apr 2022 11:59:49 +0000 (GMT) Received: from t35lp56.lnxne.boe (unknown [9.152.108.100]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 7 Apr 2022 11:59:49 +0000 (GMT) To: libc-alpha@sourceware.org Subject: [PATCH] S390: Fix elf/tst-audit25[ab] Date: Thu, 7 Apr 2022 13:59:48 +0200 Message-Id: <20220407115948.1664232-1-stli@linux.ibm.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: dCbS-bJX2No0w-9VGTxAKFF6BjelRKq4 X-Proofpoint-GUID: dCbS-bJX2No0w-9VGTxAKFF6BjelRKq4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.850,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-04-07_01,2022-04-07_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 phishscore=0 mlxlogscore=886 priorityscore=1501 spamscore=0 suspectscore=0 mlxscore=0 adultscore=0 malwarescore=0 impostorscore=0 bulkscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204070057 X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_STOCKGEN, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: Stefan Liebler via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Stefan Liebler <stli@linux.ibm.com> Cc: Stefan Liebler <stli@linux.ibm.com> Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
S390: Fix elf/tst-audit25[ab]
|
|
Checks
Context | Check | Description |
---|---|---|
dj/TryBot-apply_patch | success | Patch applied to master at the time it was sent |
dj/TryBot-32bit | success | Build for i686 |
Commit Message
Stefan Liebler
April 7, 2022, 11:59 a.m. UTC
If glibc is configured with --disable-default-pie and build on s390 with -O3, the tests elf/tst-audit25a and elf/tst-audit25b are failing as there are additional la_symbind lines for free and malloc. It turns out that those belong to the executable. In fact those are the PLT-stubs. Furthermore la_symbind is also called for calloc and realloc symbols, but those belong to libc. Those functions are not called at all, but dlsym'ed in elf/dl-minimal.c: __rtld_malloc_init_real (struct link_map *main_map) { ... void *new_calloc = lookup_malloc_symbol (main_map, "calloc", &version); void *new_free = lookup_malloc_symbol (main_map, "free", &version); void *new_malloc = lookup_malloc_symbol (main_map, "malloc", &version); void *new_realloc = lookup_malloc_symbol (main_map, "realloc", &version); ... } Therefore, this commit just ignored symbols with LA_SYMB_DLSYM flag. --- elf/tst-auditmod25.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Comments
On 07/04/2022 08:59, Stefan Liebler via Libc-alpha wrote: > If glibc is configured with --disable-default-pie and build on > s390 with -O3, the tests elf/tst-audit25a and elf/tst-audit25b are > failing as there are additional la_symbind lines for free and malloc. > It turns out that those belong to the executable. In fact those are > the PLT-stubs. Furthermore la_symbind is also called for calloc and > realloc symbols, but those belong to libc. > > Those functions are not called at all, but dlsym'ed in > elf/dl-minimal.c: > __rtld_malloc_init_real (struct link_map *main_map) > { > ... > void *new_calloc = lookup_malloc_symbol (main_map, "calloc", &version); > void *new_free = lookup_malloc_symbol (main_map, "free", &version); > void *new_malloc = lookup_malloc_symbol (main_map, "malloc", &version); > void *new_realloc = lookup_malloc_symbol (main_map, "realloc", &version); > ... > } > > Therefore, this commit just ignored symbols with LA_SYMB_DLSYM flag. LGTM, thank. Why don't we see in other configuration and/or architecture? What s390 is doing different here? Reviewed-by: Adheemrval Zanella <adhemerval.zanella@linaro.org> > --- > elf/tst-auditmod25.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/elf/tst-auditmod25.c b/elf/tst-auditmod25.c > index 20640a8daf..0524c5aab1 100644 > --- a/elf/tst-auditmod25.c > +++ b/elf/tst-auditmod25.c > @@ -72,7 +72,8 @@ la_symbind32 (Elf32_Sym *sym, unsigned int ndx, > unsigned int *flags, const char *symname) > #endif > { > - if (*refcook != -1 && *defcook != -1 && symname[0] != '\0') > + if (*refcook != -1 && *defcook != -1 && symname[0] != '\0' > + && (*flags & LA_SYMB_DLSYM) == 0) > fprintf (stderr, "la_symbind: %s %u\n", symname, > *flags & (LA_SYMB_NOPLTENTER | LA_SYMB_NOPLTEXIT) ? 1 : 0); > return sym->st_value;
On 07/04/2022 15:36, Adhemerval Zanella via Libc-alpha wrote: > > > On 07/04/2022 08:59, Stefan Liebler via Libc-alpha wrote: >> If glibc is configured with --disable-default-pie and build on >> s390 with -O3, the tests elf/tst-audit25a and elf/tst-audit25b are >> failing as there are additional la_symbind lines for free and malloc. >> It turns out that those belong to the executable. In fact those are >> the PLT-stubs. Furthermore la_symbind is also called for calloc and >> realloc symbols, but those belong to libc. >> >> Those functions are not called at all, but dlsym'ed in >> elf/dl-minimal.c: >> __rtld_malloc_init_real (struct link_map *main_map) >> { >> ... >> void *new_calloc = lookup_malloc_symbol (main_map, "calloc", &version); >> void *new_free = lookup_malloc_symbol (main_map, "free", &version); >> void *new_malloc = lookup_malloc_symbol (main_map, "malloc", &version); >> void *new_realloc = lookup_malloc_symbol (main_map, "realloc", &version); >> ... >> } >> >> Therefore, this commit just ignored symbols with LA_SYMB_DLSYM flag. > > LGTM, thank. Why don't we see in other configuration and/or architecture? > What s390 is doing different here? > > Reviewed-by: Adheemrval Zanella <adhemerval.zanella@linaro.org> > Thanks. Then I'll commit the patch. You are right I have not seen it on x86_64. Perhaps it triggers something in s390x-code in ld regarding -Bsymbolic and pointer-equality-reasons. But this is only a guess. Thanks, Stefan
diff --git a/elf/tst-auditmod25.c b/elf/tst-auditmod25.c index 20640a8daf..0524c5aab1 100644 --- a/elf/tst-auditmod25.c +++ b/elf/tst-auditmod25.c @@ -72,7 +72,8 @@ la_symbind32 (Elf32_Sym *sym, unsigned int ndx, unsigned int *flags, const char *symname) #endif { - if (*refcook != -1 && *defcook != -1 && symname[0] != '\0') + if (*refcook != -1 && *defcook != -1 && symname[0] != '\0' + && (*flags & LA_SYMB_DLSYM) == 0) fprintf (stderr, "la_symbind: %s %u\n", symname, *flags & (LA_SYMB_NOPLTENTER | LA_SYMB_NOPLTEXIT) ? 1 : 0); return sym->st_value;