Message ID | 49bb4560b2afb4174c7086e24b0fb7be9d73ab5d.1613390045.git.szabolcs.nagy@arm.com |
---|---|
State | Superseded |
Delegated to: | Adhemerval Zanella Netto |
Headers |
Return-Path: <libc-alpha-bounces@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 2CAC93950412; Mon, 15 Feb 2021 11:59:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2CAC93950412 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1613390388; bh=8cySlGeUogmQgceeYzLVaau8ovUXBGHCb7IiR18gIb4=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=UiT6npP/K2BlJGYOii3RPBBHQWelieekIqGCVkYePKaezLs4iNsEj/Z3i8yM4vkNQ p8SkRbXx16n1SFxSUIqDzD+g/mEBS9gYZbQXzTiLs9HkA1lx8a/SfuTM4tiZZ5pdc+ OQZPq6zJ9+4/F65jSVvgaCmWK5uM17ZzYli4jYM0= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60065.outbound.protection.outlook.com [40.107.6.65]) by sourceware.org (Postfix) with ESMTPS id EF753394EC1E for <libc-alpha@sourceware.org>; Mon, 15 Feb 2021 11:59:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EF753394EC1E Received: from AM6PR08CA0015.eurprd08.prod.outlook.com (2603:10a6:20b:b2::27) by PAXPR08MB6525.eurprd08.prod.outlook.com (2603:10a6:102:154::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.26; Mon, 15 Feb 2021 11:59:43 +0000 Received: from VE1EUR03FT053.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:b2:cafe::a6) by AM6PR08CA0015.outlook.office365.com (2603:10a6:20b:b2::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27 via Frontend Transport; Mon, 15 Feb 2021 11:59:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;sourceware.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT053.mail.protection.outlook.com (10.152.19.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25 via Frontend Transport; Mon, 15 Feb 2021 11:59:43 +0000 Received: ("Tessian outbound e989e14f9207:v71"); Mon, 15 Feb 2021 11:59:42 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: da235128422942ee X-CR-MTA-TID: 64aa7808 Received: from 74eede90ae10.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id A4FA2DF3-A293-4685-B19D-5320AA80AFD5.1; Mon, 15 Feb 2021 11:59:37 +0000 Received: from EUR03-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 74eede90ae10.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 15 Feb 2021 11:59:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oWT5K7BQ+ZNN6rX7pmCfwxPtnbGD3ofWLU9RsnKHRAREQwvpK1lJIiPB7d3aUIw4NIefnWjT7JXos5DmvpYIG/2HZe+SmxVoE8ODuBhvyAToVKNkG85ysR2bqPAv0/cqKuDBInM0lozeQXOw/+lke+qx6MJbAFqoHAJ5HNfDbLCMeWLBhdqxBrMPweYFQRVjsJ55v7uKqye+g8HOUJK18FT2ykNzKbFljJZd5G4Q7wP6ke3At+O58Y6f88ehKZ0/8PmQHsHXL/rmKwT2SXQEBrVfITc7azvwFpTnF0gR/Grrnzq+bBnJERiQqUNyqiAQCUUY0bbYNYntPgDt3qTKuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8cySlGeUogmQgceeYzLVaau8ovUXBGHCb7IiR18gIb4=; b=NcN5w2AQjIC2kWjUoU7OMoi2y4WcrdQoU8DnlQxSheXj2A0IaLrVqqEIrNYJWhiccjVc5cLHcA/brBgQJ46RODxFFLTppJcRYVm6J9nHbikZ/AfQ4MAV1IwVqMJgUhTljxLwiMuTJ5Yh4PP2uTUwPoR+3X3W7hlikjMPmb10Yb5gN1Ms/j2BcOtkse4prEM+/bSrmib/Ac950weIkO1ZPkGsC7KUfM0K+v0DfWF9FhwlWNG4JU+K7+Gc0ghkaDlnGtG8RT6a0gR71+JQOh0X3tltcDEVNSpgglhl4oPWWFOeVhUxuBiaqcM3lxRFwvnHhLF3Qkv6FipD6cHqc8Nt7g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Authentication-Results-Original: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=arm.com; Received: from PA4PR08MB6320.eurprd08.prod.outlook.com (2603:10a6:102:e5::9) by PAXPR08MB6558.eurprd08.prod.outlook.com (2603:10a6:102:151::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.28; Mon, 15 Feb 2021 11:59:36 +0000 Received: from PA4PR08MB6320.eurprd08.prod.outlook.com ([fe80::60f0:3773:69b8:e336]) by PA4PR08MB6320.eurprd08.prod.outlook.com ([fe80::60f0:3773:69b8:e336%2]) with mapi id 15.20.3846.042; Mon, 15 Feb 2021 11:59:36 +0000 To: libc-alpha@sourceware.org Subject: [PATCH 05/15] elf: Fix a DTV setup issue [BZ #27136] Date: Mon, 15 Feb 2021 11:59:29 +0000 Message-Id: <49bb4560b2afb4174c7086e24b0fb7be9d73ab5d.1613390045.git.szabolcs.nagy@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <cover.1613390045.git.szabolcs.nagy@arm.com> References: <cover.1613390045.git.szabolcs.nagy@arm.com> Content-Type: text/plain X-Originating-IP: [217.140.106.49] X-ClientProxiedBy: LO2P123CA0106.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:139::21) To PA4PR08MB6320.eurprd08.prod.outlook.com (2603:10a6:102:e5::9) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (217.140.106.49) by LO2P123CA0106.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:139::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.38 via Frontend Transport; Mon, 15 Feb 2021 11:59:35 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 784363bb-c512-404f-1cc3-08d8d1a92e89 X-MS-TrafficTypeDiagnostic: PAXPR08MB6558:|PAXPR08MB6525: X-Microsoft-Antispam-PRVS: <PAXPR08MB6525D44E07585BB20D1403F7ED889@PAXPR08MB6525.eurprd08.prod.outlook.com> x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:7219;OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: YjgbTX/w7/fczt/YxT87ApF7TFY7fGgt69pCmsq4JkMyiwllH3FUEnoVvga3tEi4GFQ94YUk1r8MESu3QCZ+FlPjdUQBmlDu+4iYsfGXZqiQIgbbhSA7q8ufgC3pv1Tho14cnwu792Qp/pBq1eY/Fn/qeHJE/zTtQl5TBsg7Y7alUcLfxYJOTVEcdTND3DoWPhXtO9lFZppaQfCCHUa+1nIZg1o8h+R7g6+3cPATc6e2NKrWIObmxN8KzBtx9W4xlNNOmkFrNBElcRKATOgDHbyWmJq86+NEnwLMkruBdOwc/ww+I60K834g0erLnrSikFvSIY/L5YqtokMfeCLXERLgYRx0mmiKmP0Lk9U1OQ5+GqoJa+ECAsPVwt8jBQGadh4Vw2yyE25QsStKal7cyP8JdOGeKF4R5tvmocO3mVGN30282szpqTXRQrHEeAGb9peBgtXryJIZcHyof6oYf+Qidwc9fT5UN/y/oVgyMoHW8BskzS2pHOrF8c4pbOCJNTg/fpQyQiI/p1pMI/aVo5cueUkJ+ASVb8cVU9H5KKaSkvP/dFC/CnzpyprH7D3KpZIAVv6R5X4G4QlO1U1aIA== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR08MB6320.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(376002)(39850400004)(396003)(346002)(366004)(956004)(2616005)(66556008)(44832011)(6916009)(66476007)(6486002)(16526019)(66946007)(478600001)(36756003)(186003)(2906002)(4744005)(5660300002)(26005)(6666004)(86362001)(6506007)(6512007)(69590400012)(83380400001)(8676002)(52116002)(316002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: w4fpcXmKFtIhFn6jZHS73OKpeicrfglcVmSJhzxMqNvYPPgC/gQT+2fPq+NhZI3MtggX/uE/mqxmh6TGy1rbpROhrnw6xV/6dc6VAWAo+JUWpJPuq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S+LuNbfM+JGU821qlBQ/okD7CbFMSmoMMZ55lNjChwyZueZaCCryHtZxacVODdwlhzJB7irdeGcpcgmxDH54dE8W5GAy0fhfEZK4AM5BFbc/JTpIxM8oTsOfcnrnGoHi1gi3IoWQtkzBRA4HYmMz X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6558 Original-Authentication-Results: sourceware.org; dkim=none (message not signed) header.d=none; sourceware.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT053.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: bf6d1d75-c175-43f5-b866-08d8d1a92a0a X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Qkef7qjX3K8mB1ICUbfZQnRWdBqeaGCP1mf9ZeF1XRUoMRTQAw99l6SsbspFWP2BP3v9oTPxCoZXTfcutZQAovoJvZRDOjnDhgk91Zrw/cueXVYfm86/3HtrPzGS+381wKSM5G6l/PBSE3Mr0MJ/bWD6CtHw8BWNJaZ1SOBd6QWnxeF/k6YPH3tolPeqBrXyXun4dVS4hTcc23vebILRqWLsYze04jueG2bI7fpi9aR9JPmBZsTAA4sn0IOacR1mb3Zb/VfzqeOytb+bw3efswc0MONJqp6gZ/HXT2g5QS9I7CDDvCRXWfXsAPMnYw1KsE1MhJMhyoF/eBeHwBi6Dv4AowRRvHtgVQJxInfGhd1VY0tsLZQhtlQfUCgCp7urhOQDXTAtYrghXpVmpS4CoSIAEh4yOeh2rlUkSwlMTjLd59XaY3ExsOUWm/7zN8XN7oqofl9ERF8mUuYGd28xaOe0colCMsugAkrUp63LBBdWj3QYfoy2KFkwnjp/utlNbvaKxIp+7MPX7Me6ub3APox+b4PlCuNNntn+30gSaItESWo4bXIxVmdnKoRaG9ugV4Eyik3qvMa+EPVH37JOP8QRD/nY5g3C4AT5tw6i10lZqaqrltFfIgEm9EEkxAEYyYwseZZQFnhjr56yvHsQnAiuL3umI/vWvkYQAPZI92w9jWSSjLdK9JbzmxgyDvF2 X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(4636009)(136003)(376002)(396003)(346002)(39850400004)(46966006)(36840700001)(70586007)(69590400012)(70206006)(81166007)(356005)(8936002)(336012)(83380400001)(186003)(36860700001)(478600001)(956004)(26005)(8676002)(2616005)(36756003)(2906002)(6506007)(82740400003)(16526019)(6512007)(82310400003)(44832011)(47076005)(6666004)(86362001)(4744005)(5660300002)(6916009)(6486002)(316002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2021 11:59:43.2071 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 784363bb-c512-404f-1cc3-08d8d1a92e89 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT053.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6525 X-Spam-Status: No, score=-14.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Szabolcs Nagy via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Szabolcs Nagy <szabolcs.nagy@arm.com> Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces@sourceware.org> |
Series |
Dynamic TLS related data race fixes
|
|
Commit Message
Szabolcs Nagy
Feb. 15, 2021, 11:59 a.m. UTC
The max modid is a valid index in the dtv, it should not be skipped. The bug is observable if the last module has modid == 64 and its generation is same or less than the max generation of the previous modules. Then dtv[0].counter implies dtv[64] is initialized but it isn't. Fixes bug 27136. --- elf/dl-tls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 15/02/2021 08:59, Szabolcs Nagy via Libc-alpha wrote: > The max modid is a valid index in the dtv, it should not be skipped. > > The bug is observable if the last module has modid == 64 and its > generation is same or less than the max generation of the previous > modules. Then dtv[0].counter implies dtv[64] is initialized but > it isn't. Fixes bug 27136. LGTM, thank. I think it would be better to either squash the testcase into this patch (which would require to rework the testcase make rules, since it uses the objects from B#19329) or move the test after this patch. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> > --- > elf/dl-tls.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/elf/dl-tls.c b/elf/dl-tls.c > index dd76829e74..79b93ad91b 100644 > --- a/elf/dl-tls.c > +++ b/elf/dl-tls.c > @@ -590,7 +590,7 @@ _dl_allocate_tls_init (void *result) > } > > total += cnt; > - if (total >= GL(dl_tls_max_dtv_idx)) > + if (total > GL(dl_tls_max_dtv_idx)) > break; > > listp = listp->next; > Ok, it align on how dl_tls_max_dtv_idx is used on this file (such as _dl_count_modids).
diff --git a/elf/dl-tls.c b/elf/dl-tls.c index dd76829e74..79b93ad91b 100644 --- a/elf/dl-tls.c +++ b/elf/dl-tls.c @@ -590,7 +590,7 @@ _dl_allocate_tls_init (void *result) } total += cnt; - if (total >= GL(dl_tls_max_dtv_idx)) + if (total > GL(dl_tls_max_dtv_idx)) break; listp = listp->next;