Message ID | 20250314132142.49243-3-cupertino.miranda@oracle.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Adhemerval Zanella Netto |
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 D00B03857433 for <patchwork@sourceware.org>; Fri, 14 Mar 2025 13:24:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D00B03857433 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=oracle.com header.i=@oracle.com header.a=rsa-sha256 header.s=corp-2023-11-20 header.b=XW/Col/D; dkim=pass (1024-bit key, unprotected) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-oracle-onmicrosoft-com header.b=Pbr6MJRK X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id E31B93857BA9 for <libc-alpha@sourceware.org>; Fri, 14 Mar 2025 13:22:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E31B93857BA9 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E31B93857BA9 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1741958531; cv=pass; b=qb2B7OJHLvNLWpKbZABuITwriAteYzTsCeFpj+f0h9OowyTXQeVL24AsvDRlDl1WYrYOvpMtb/UyMt0vOcioj0yERCkTXz9f8vPTW/oa4QO6P7chBs+Dfzpcs2hSnuCenOUZMYFemJn9VZc2bsLoolaJEhQiJO9wTt+LQPoOzog= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1741958531; c=relaxed/simple; bh=taIcAAiPFPj6XPMW9U0vFImEATU3n18F2oqxshbqjfA=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=MTQeemTqnIDYowe8vPKY7QuWAFYNktN7W5yVbOPAsR8kKdWZLB94HrNNFA2uFEqb9QbCXIruHYHSHpEf4czvClXIiUtkzuFMzDM9R6PY61+RRUE8I5H3Fx0sZHyzPyK7Xr8PJHCx8zcFL4T4Yw0ufR0pst8eqW0u/MMhkWGOprc= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E31B93857BA9 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 52EBmCNV025531; Fri, 14 Mar 2025 13:22:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=G/IBcgOfJxSp+nJlhmHX83Zm9NglkHVRftwGKE+lIk8=; b= XW/Col/DmLv0HiYyIrOVA/pgqZFQJh+d7BjK4ltZvASA35QTZOyMA0+v9LAyD6Lf GsPQQc61yOtYXyRn2wxRkDrlJ05Pcwc+dBrxaeEDQk5ibgN3GugTsY/pm3RV3kHa wlTAXqM6y9i13ZcdMu3+Qnm9LIbCae/bHBDSIaNQO+N1Uc0/KIVShjn6Bk9nUBY7 LSv7mpkUdOR/anVso8KEGYioxZwEZLJR+l1amAKDCD5I2fbXenzDBQMOs+Vwxvkf lUMgU20WGIapBJpGsohhgdag1yoOrBBmVGEJUFvTAdmt2tPrTsCmGSioayy9Qmnz 796LRjj9mgivQcS2NuZfvg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 45au4heew4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 Mar 2025 13:22:07 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 52EBCa3C002391; Fri, 14 Mar 2025 13:22:07 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2041.outbound.protection.outlook.com [104.47.57.41]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 45atna3cn8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 Mar 2025 13:22:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cm5ANFp9Q115U71eXQw8GCrmldKXQFW6Q53Jo050ObKWfKLvhFPSijHz162AEPrAqu4ezZ2GyuPdNRuYi72ZuAySsPbTKs7JPRVcZ3TRu7Uq/KX4gusonwXK8ua4SItF3R+SLlLVg5rmafvgTLuSGps2PUSjuCPtyROOJe1deLNTMZvwc5u4zFeIgYIrjc4d4SoZKwYUS4JIxqb43LquDie6PHWoJy1mhLN7q8Lwn8HHsr0OMjLbzsfkM3UuHWAMTGik44BJs5KOeaYnHR6RZ6DR2zcBPQE4k4lsKejxPxjzilwiPptk4WJtLGSEyb2bL3BbRi2xlOfnugpzgPV3sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=G/IBcgOfJxSp+nJlhmHX83Zm9NglkHVRftwGKE+lIk8=; b=wiEpDa1CYTk2r8OMHTLZ/1RyPIHQXYWeg2QF005cJNCbLkoGbl4TiDRZbw2ZXsJbCUxTG7SGWWrBYIE1dziHzVTdFVBj5vkihhxE1DGDqvRONzwPE2rp6JmrTYqK/0EOnxn1NM/zpGWgodtdy2ytCFIEX15NcQkQ7aR/uyb18/bSqOiVXhwmt2yu65Gv19aXLvsGCIWKWLBY/M67D/PU8gQpuCpx5JMUM4f0KlPId3V6mkmp7VRzUctYoTzNhvAis1CuhurB0TtEq8yAKrPaMMsWB4kT5hzzdZ1MKJcvPez2qnVS1iW8FMCVbRXw//Qu/GdxrDgykeZzN46Jc7/Mrw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=G/IBcgOfJxSp+nJlhmHX83Zm9NglkHVRftwGKE+lIk8=; b=Pbr6MJRKTU1VnZ+y9DSpPce4G/krDsG5SXlLuPrZZN1SpBM4w0RUrAAsHRwL4N/ErVP5GBIObMuidWpzOhAV6Qm3psnBTfyLcrfmW3JnV66R0LQjiyP3vVovMEiBnWZpLVQUehEuo3wsREajoQx2pPdjuoUPyEsvNPTaZiK2Q4I= Received: from MN2PR10MB4382.namprd10.prod.outlook.com (2603:10b6:208:1d7::13) by CYYPR10MB7676.namprd10.prod.outlook.com (2603:10b6:930:bd::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8511.27; Fri, 14 Mar 2025 13:22:04 +0000 Received: from MN2PR10MB4382.namprd10.prod.outlook.com ([fe80::5033:84a3:f348:fefb]) by MN2PR10MB4382.namprd10.prod.outlook.com ([fe80::5033:84a3:f348:fefb%4]) with mapi id 15.20.8511.031; Fri, 14 Mar 2025 13:22:04 +0000 From: Cupertino Miranda <cupertino.miranda@oracle.com> To: libc-alpha@sourceware.org Cc: jose.marchesi@oracle.com, elena.zannoni@oracle.com, richard.sandiford@arm.com, Cupertino Miranda <cupertino.miranda@oracle.com> Subject: [PATCH 2/2] nptl: Enable MTE for stacks created for threads. Date: Fri, 14 Mar 2025 13:21:42 +0000 Message-Id: <20250314132142.49243-3-cupertino.miranda@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20250314132142.49243-1-cupertino.miranda@oracle.com> References: <20250314132142.49243-1-cupertino.miranda@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: LO4P123CA0532.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:2c5::14) To MN2PR10MB4382.namprd10.prod.outlook.com (2603:10b6:208:1d7::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN2PR10MB4382:EE_|CYYPR10MB7676:EE_ X-MS-Office365-Filtering-Correlation-Id: 9ab3305f-822e-433f-4682-08dd62fb35fc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: +AKUVA6tkgL/XAN1Py9FO28j0joLs2uoqzudEPgq49oj2YGaaUG3uUwih3hrNEITaydFENrfsp6CXMMzL3MaI/mPufCCtRUYton0JGfFGcQgkvmRZqNVxnvNMk/YqLoBqPo+++zD3nhU7KNl8tIPFN9S36NqwAMhUtSjvCrh1aOHYryUPN0u+8fGoYD6FZLgtVTu7vJ7EClolfOMDZPcpudj/k6C1EblySn8N8pj5F6BPuxyoRQUC9EHwAEg0DGq1RJk+fGv9bKe+DbLR3qrtg+X5zGXaAk2+Emmo98/3T7+6O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/GDVmvN6N6QCIesX2r14nJ861hKKZo X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR10MB4382.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zXwyRzZ1igKrVB3zhyHkkrcFHfq9H2zyKr8RSaUBxivPz82hEdBLNkQZlMsNFfl7GaRbc9/CEoZmL1+yCCaNuOtPYYR8G0YVrlQXsHmSNSPeZijgyE/PwxdDwCGLVxm+kAxP9tJHeAJFpyfFNwK64G/ArsPNVAiUrqWoahyCsT0+V9+c/EZWV1QfCpJB78NOkXUbJ4677XxXWD6f+3bfAVWmhjyqQDa1l14/2qXah7UiuTA9S3Smo1tXU966vtkeBIKdBeyUk0kXsltfPvRZJMYfP6f4GbFS8IcEKGrqy7OU1s0INKTumnoEpL8QRShwIc82i6KpgH97GJeoigMl7PGI8GvKZ2f561XyM7fEFyO5pqhTPHwy5kiHBzLOBs8gVczVFeNpLmyOzdFJ63i5HXJjDaTZw/S99E9o+ZyYN5Z3+NG2XLVOrg2Mrt6fRzmzkwk0hS5e1u+Ah0/URVT3apPVAiB60rlig9bNBTY5iUu7h3gOn1A11e0fxOkTNuY0rQU6kMa2VDgCMd06Wdn56m+hqoxcElOnF7MTHXboI9mTjFMFrhwCs5PSSUHyQ12Qyna8M7IqCebi6Gw31E3shLCQe1ZP7pWrUqkr+so0F9TkaDWZ8oEWQxT8ytkTir5TpRHvf1wnqLD5B1WQVlyzS3pEtoXk6Sd/0z830ev6IcXhFC8smAq02F4V8XAovkn6tIZipMro6jJqCndamOFdTGcYdQINwLTyR34yRZ9gUvvQSXy9yqGl4tB27OSZchXWlRKfPmXbz4cHSsvwUEc5qrs4bpcDbbVIS3T5oqTVE3jgd4QTK1KKOZnqjJya75iowGsVC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sZT5/EuNUn4DIIR1MiOibb7m+Je0w6GomoDlIRGhcUrWHg/qRvS6TSSAgfO172hXqLuRkJCGYt2UNvGsLGHz8vczQtLZE/8Xq/liTqgOko30gwSO8AafwHr6qYrhlquRMA8eyqfg+jA8LUJyURbvggFFLpdddNdqkzfuHfMM5nUyByNmV+cQhMu87A/YxcmYsWEz869iDGanZKRWl2kD4wVpYjr7rl5rk4zG+KDraLzyRBIlAiIN0V0UbANp6Cy7x/ucV1sYT83Ba/8xeWUAfzK5QMgMMjievrm/tLrFSnXBmbrR5IyM/Tyj46kTTsGeqlNxNtpVSGVvL43yXwbFS6g1PzV6pT0e06vZozhJA70SFPlCKnX30DWM5DSSvoi4luzRlBe2wnznpWVTwTqzdqthm6eC6C+K1I= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9ab3305f-822e-433f-4682-08dd62fb35fc X-MS-Exchange-CrossTenant-AuthSource: MN2PR10MB4382.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Mar 2025 13:22:04.0786 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: oiIfFYiP9cs43HFp3M3U11D/nb9r1wemWo0aw0iOH03QTVaRpK30+97T1yc507bN6r2sRrFXoylccok2XRS6OrOP54qJKfK8k0qvUSkH350= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR10MB7676 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1093,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-03-14_05,2025-03-13_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=920 phishscore=0 suspectscore=0 adultscore=0 spamscore=0 mlxscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2502280000 definitions=main-2503140105 X-Proofpoint-GUID: nF6sOAREHE2tcRJAGfIkfOzJC_WZk8H- X-Proofpoint-ORIG-GUID: nF6sOAREHE2tcRJAGfIkfOzJC_WZk8H- X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP 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 <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> Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org |
Series |
RFC: Support for MTE stack tagging.
|
|
Checks
Context | Check | Description |
---|---|---|
redhat-pt-bot/TryBot-apply_patch | fail | Patch failed to apply to master at the time it was sent |
Commit Message
Cupertino Miranda
March 14, 2025, 1:21 p.m. UTC
This patch adds MPROT_MTE flag to newly mapped stacks for threads, if DT_AARCH64_MEMTAG_STACK is present in the array of dynamic tags in the executable. --- elf/dl-mte-stack.c | 1 + nptl/allocatestack.c | 3 ++- nptl/nptl-stack.c | 7 +++++++ nptl/nptl-stack.h | 2 ++ sysdeps/unix/sysv/linux/aarch64/Makefile | 5 +++++ sysdeps/unix/sysv/linux/aarch64/dl-mte-stack.c | 11 ++++++++++- 6 files changed, 27 insertions(+), 2 deletions(-)
Comments
* Cupertino Miranda: > diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c > index 800ca89720..6155157063 100644 > --- a/nptl/allocatestack.c > +++ b/nptl/allocatestack.c > @@ -153,7 +153,8 @@ static int allocate_stack_mode = ALLOCATE_GUARD_MADV_GUARD; > static inline int stack_prot (void) > { > return (PROT_READ | PROT_WRITE > - | ((GL(dl_stack_flags) & PF_X) ? PROT_EXEC : 0)); > + | ((GL(dl_stack_flags) & PF_X) ? PROT_EXEC : 0) > + | stack_mem_tagging_prot ()); > } I think we should clean this up and arrange for the dynamic linker to determine the PROT_* flags for stacks created at run time, so that we can use that variable directly without further processing. Thanks, Florian
On 14/03/25 10:21, Cupertino Miranda wrote: > This patch adds MPROT_MTE flag to newly mapped stacks for threads, if > DT_AARCH64_MEMTAG_STACK is present in the array of dynamic tags in the > executable. > > --- > elf/dl-mte-stack.c | 1 + > nptl/allocatestack.c | 3 ++- > nptl/nptl-stack.c | 7 +++++++ > nptl/nptl-stack.h | 2 ++ > sysdeps/unix/sysv/linux/aarch64/Makefile | 5 +++++ > sysdeps/unix/sysv/linux/aarch64/dl-mte-stack.c | 11 ++++++++++- > 6 files changed, 27 insertions(+), 2 deletions(-) > > diff --git a/elf/dl-mte-stack.c b/elf/dl-mte-stack.c > index f0063b54a0..f5b8293c7a 100644 > --- a/elf/dl-mte-stack.c > +++ b/elf/dl-mte-stack.c > @@ -25,3 +25,4 @@ _dl_mte_stack_protect (void *stack_end) > return ENOSYS; > } > rtld_hidden_def (_dl_mte_stack_protect) > + > diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c > index 800ca89720..6155157063 100644 > --- a/nptl/allocatestack.c > +++ b/nptl/allocatestack.c > @@ -153,7 +153,8 @@ static int allocate_stack_mode = ALLOCATE_GUARD_MADV_GUARD; > static inline int stack_prot (void) > { > return (PROT_READ | PROT_WRITE > - | ((GL(dl_stack_flags) & PF_X) ? PROT_EXEC : 0)); > + | ((GL(dl_stack_flags) & PF_X) ? PROT_EXEC : 0) > + | stack_mem_tagging_prot ()); > } > > static void * > diff --git a/nptl/nptl-stack.c b/nptl/nptl-stack.c > index c049c5133c..34fbba1cd1 100644 > --- a/nptl/nptl-stack.c > +++ b/nptl/nptl-stack.c > @@ -145,3 +145,10 @@ __pthread_get_minstack (const pthread_attr_t *attr) > + PTHREAD_STACK_MIN); > } > libc_hidden_def (__pthread_get_minstack) > + > +int > +__stack_mem_tagging_prot (void) > +{ > + return 0; > +} > +weak_alias (__stack_mem_tagging_prot, stack_mem_tagging_prot) As indicated, this causas the linknamespace issues because stack_mem_tagging_prot is in the application namespace. > diff --git a/nptl/nptl-stack.h b/nptl/nptl-stack.h > index ac672e16cf..2bfcaf7252 100644 > --- a/nptl/nptl-stack.h > +++ b/nptl/nptl-stack.h > @@ -61,4 +61,6 @@ __nptl_tls_static_size_for_stack (void) > return roundup (GLRO (dl_tls_static_size), GLRO (dl_tls_static_align)); > } > > +int stack_mem_tagging_prot (void); > + > #endif /* _NPTL_STACK_H */ > diff --git a/sysdeps/unix/sysv/linux/aarch64/Makefile b/sysdeps/unix/sysv/linux/aarch64/Makefile > index 8fb0e65b2a..e91a756836 100644 > --- a/sysdeps/unix/sysv/linux/aarch64/Makefile > +++ b/sysdeps/unix/sysv/linux/aarch64/Makefile > @@ -10,6 +10,11 @@ sysdep-dl-routines += \ > dl-mte-stack > endif > > +ifeq ($(subdir),nptl) > +routines += \ > + dl-mte-stack > +endif > + This add a static linking issue (link-static-libc test) with multiple definition of _dl_mte_stack_protect and stack_mem_tagging_prot. And I don't think you need to set the MTE mode per thread, once the mode it sets either by the tunable of by DT_AARCH64_MEMTAG_MODE it should not be changed by glibc. I also think it should be done with Florian's suggestion, so there is no need to add teh __stack_mem_tagging_prot hook and override it on aarch64. Now that we don't change dl_stack_flags during process execution, we can more to the _rtld_global_ro and setup the mmap flags after loader setup instead of the ELF ones. > ifeq ($(subdir),stdlib) > gen-as-const-headers += ucontext_i.sym > endif > diff --git a/sysdeps/unix/sysv/linux/aarch64/dl-mte-stack.c b/sysdeps/unix/sysv/linux/aarch64/dl-mte-stack.c > index a4bc82c99b..7ed92855ae 100644 > --- a/sysdeps/unix/sysv/linux/aarch64/dl-mte-stack.c > +++ b/sysdeps/unix/sysv/linux/aarch64/dl-mte-stack.c > @@ -42,7 +42,7 @@ void > _dl_mte_stack_protect (void *stack_end) > { > if ((GLRO(dl_aarch64_cpu_features).mte_state & AARCH64_CPU_FEATURE_MTE_STATE_STACK) == 0 > - || !_dl_mte_mode ()) > + || !_dl_mte_mode ()) > return; > > int errval = 0; > @@ -72,3 +72,12 @@ cannot set stack with PROT_MTE"); > } > } > > +int > +stack_mem_tagging_prot (void) > +{ > + if ((GLRO(dl_aarch64_cpu_features).mte_state & AARCH64_CPU_FEATURE_MTE_STATE_STACK) == 8 > + && _dl_mte_mode ()) > + return PROT_MTE; > + else > + return 0; > +}
Hi Florian, Thanks for the review! On 14-03-2025 16:35, Florian Weimer wrote: > * Cupertino Miranda: > >> diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c >> index 800ca89720..6155157063 100644 >> --- a/nptl/allocatestack.c >> +++ b/nptl/allocatestack.c >> @@ -153,7 +153,8 @@ static int allocate_stack_mode = ALLOCATE_GUARD_MADV_GUARD; >> static inline int stack_prot (void) >> { >> return (PROT_READ | PROT_WRITE >> - | ((GL(dl_stack_flags) & PF_X) ? PROT_EXEC : 0)); >> + | ((GL(dl_stack_flags) & PF_X) ? PROT_EXEC : 0) >> + | stack_mem_tagging_prot ()); >> } > > I think we should clean this up and arrange for the dynamic linker to > determine the PROT_* flags for stacks created at run time, so that we > can use that variable directly without further processing. IMHO, we cannot escape from abstracting somehow the final flags as above with PF_X. The problem being that each OS would have each own flags and syscalls and dynamic linker is OS agnostic, AFAIK. Were you suggesting to create a PF_MTE and abstract it that way ? Or having dl_stack_flags to immediately be set to PROT_MTE, etc? Thanks, Cupertino > > Thanks, > Florian >
* Cupertino Miranda: > Hi Florian, > > Thanks for the review! > > On 14-03-2025 16:35, Florian Weimer wrote: >> * Cupertino Miranda: >> >>> diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c >>> index 800ca89720..6155157063 100644 >>> --- a/nptl/allocatestack.c >>> +++ b/nptl/allocatestack.c >>> @@ -153,7 +153,8 @@ static int allocate_stack_mode = ALLOCATE_GUARD_MADV_GUARD; >>> static inline int stack_prot (void) >>> { >>> return (PROT_READ | PROT_WRITE >>> - | ((GL(dl_stack_flags) & PF_X) ? PROT_EXEC : 0)); >>> + | ((GL(dl_stack_flags) & PF_X) ? PROT_EXEC : 0) >>> + | stack_mem_tagging_prot ()); >>> } >> I think we should clean this up and arrange for the dynamic linker to >> determine the PROT_* flags for stacks created at run time, so that we >> can use that variable directly without further processing. > IMHO, we cannot escape from abstracting somehow the final flags as > above with PF_X. The problem being that each OS would have each own > flags and syscalls and dynamic linker is OS agnostic, AFAIK. The dynamic linker has both Linux- and architecture-specific code. I would like to see GLRO (dl_stack_prot_flags) instead of: stack_prot () Then we can remove the GL(dl_stack_flags) variable. Thanks, Florian
diff --git a/elf/dl-mte-stack.c b/elf/dl-mte-stack.c index f0063b54a0..f5b8293c7a 100644 --- a/elf/dl-mte-stack.c +++ b/elf/dl-mte-stack.c @@ -25,3 +25,4 @@ _dl_mte_stack_protect (void *stack_end) return ENOSYS; } rtld_hidden_def (_dl_mte_stack_protect) + diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c index 800ca89720..6155157063 100644 --- a/nptl/allocatestack.c +++ b/nptl/allocatestack.c @@ -153,7 +153,8 @@ static int allocate_stack_mode = ALLOCATE_GUARD_MADV_GUARD; static inline int stack_prot (void) { return (PROT_READ | PROT_WRITE - | ((GL(dl_stack_flags) & PF_X) ? PROT_EXEC : 0)); + | ((GL(dl_stack_flags) & PF_X) ? PROT_EXEC : 0) + | stack_mem_tagging_prot ()); } static void * diff --git a/nptl/nptl-stack.c b/nptl/nptl-stack.c index c049c5133c..34fbba1cd1 100644 --- a/nptl/nptl-stack.c +++ b/nptl/nptl-stack.c @@ -145,3 +145,10 @@ __pthread_get_minstack (const pthread_attr_t *attr) + PTHREAD_STACK_MIN); } libc_hidden_def (__pthread_get_minstack) + +int +__stack_mem_tagging_prot (void) +{ + return 0; +} +weak_alias (__stack_mem_tagging_prot, stack_mem_tagging_prot) diff --git a/nptl/nptl-stack.h b/nptl/nptl-stack.h index ac672e16cf..2bfcaf7252 100644 --- a/nptl/nptl-stack.h +++ b/nptl/nptl-stack.h @@ -61,4 +61,6 @@ __nptl_tls_static_size_for_stack (void) return roundup (GLRO (dl_tls_static_size), GLRO (dl_tls_static_align)); } +int stack_mem_tagging_prot (void); + #endif /* _NPTL_STACK_H */ diff --git a/sysdeps/unix/sysv/linux/aarch64/Makefile b/sysdeps/unix/sysv/linux/aarch64/Makefile index 8fb0e65b2a..e91a756836 100644 --- a/sysdeps/unix/sysv/linux/aarch64/Makefile +++ b/sysdeps/unix/sysv/linux/aarch64/Makefile @@ -10,6 +10,11 @@ sysdep-dl-routines += \ dl-mte-stack endif +ifeq ($(subdir),nptl) +routines += \ + dl-mte-stack +endif + ifeq ($(subdir),stdlib) gen-as-const-headers += ucontext_i.sym endif diff --git a/sysdeps/unix/sysv/linux/aarch64/dl-mte-stack.c b/sysdeps/unix/sysv/linux/aarch64/dl-mte-stack.c index a4bc82c99b..7ed92855ae 100644 --- a/sysdeps/unix/sysv/linux/aarch64/dl-mte-stack.c +++ b/sysdeps/unix/sysv/linux/aarch64/dl-mte-stack.c @@ -42,7 +42,7 @@ void _dl_mte_stack_protect (void *stack_end) { if ((GLRO(dl_aarch64_cpu_features).mte_state & AARCH64_CPU_FEATURE_MTE_STATE_STACK) == 0 - || !_dl_mte_mode ()) + || !_dl_mte_mode ()) return; int errval = 0; @@ -72,3 +72,12 @@ cannot set stack with PROT_MTE"); } } +int +stack_mem_tagging_prot (void) +{ + if ((GLRO(dl_aarch64_cpu_features).mte_state & AARCH64_CPU_FEATURE_MTE_STATE_STACK) == 8 + && _dl_mte_mode ()) + return PROT_MTE; + else + return 0; +}