From nobody Sun Feb 8 20:00:20 2026 Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8AE0A2F0C62; Tue, 17 Jun 2025 22:51:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.40.44.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750200685; cv=none; b=MrSt4TNYqPG0TfoFgt7QLl7N0dly2Cs0vi5Ojbt90O+Gb4WnoqInPG0ubEr6cFULtpcikzfoRKR9Jhf2l8pq3f8Cz5oFShboze24UDgD6qFC3OOO99Tg4GOP+bowh8plw8N6ZdaAL69/YXz4cJt52qK1EXf3fpBqw2xaQ3TyYzY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750200685; c=relaxed/simple; bh=9m5PXLzk+nB2noJJboTPg5LzSGgn7c11qCCeurwP7ac=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=b/KRMP1MRnkdBmundgmUfdukfu4qbxwKAW05fTF9QAOBHiOe66OiS3YeR1iHaPEUYy/raBiPAav3dp4FHXVgcq8GulFvb6Yxtpg7pAnYDIncoCIyE50ekqaSNYnIszr6kJEkXbaSM4Ehr1fKF/CH13gEBnU0lw+IAsa2RV4nU7E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org; spf=pass smtp.mailfrom=goodmis.org; arc=none smtp.client-ip=216.40.44.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=goodmis.org Received: from omf07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 4232914110A; Tue, 17 Jun 2025 22:51:14 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: nevets@goodmis.org) by omf07.hostedemail.com (Postfix) with ESMTPA id 3C0022002D; Tue, 17 Jun 2025 22:51:11 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98.2) (envelope-from ) id 1uRf9C-00000002L5u-0in3; Tue, 17 Jun 2025 18:51:18 -0400 Message-ID: <20250617225118.022317038@goodmis.org> User-Agent: quilt/0.68 Date: Tue, 17 Jun 2025 18:50:15 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, bpf@vger.kernel.org, x86@kernel.org Cc: Masami Hiramatsu , Mathieu Desnoyers , Josh Poimboeuf , Peter Zijlstra , Ingo Molnar , Jiri Olsa , Namhyung Kim , Thomas Gleixner , Andrii Nakryiko , Indu Bhagat , "Jose E. Marchesi" , Beau Belgrave , Jens Remus , Linus Torvalds , Andrew Morton Subject: [PATCH v6 06/12] unwind_user/sframe: Add prctl() interface for registering .sframe sections References: <20250617225009.233007152@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Rspamd-Server: rspamout01 X-Rspamd-Queue-Id: 3C0022002D X-Stat-Signature: i93xey3p7h4dbudkeisrppphk8p55ffa X-Session-Marker: 6E657665747340676F6F646D69732E6F7267 X-Session-ID: U2FsdGVkX19DlMrmPTiuSVbEqmTnPfSvV/ssVsV1utE= X-HE-Tag: 1750200671-734612 X-HE-Meta: U2FsdGVkX1/MLM5P8OFibyZCH1qipt+hpYgGdsjZzQfK3FOe/IpTyK6mAhiOeQOAnfjWrT8bnKb1H4BKGD6HkgBu+hVwdEoMBDgv24t4cDNPyEBpXTkE874TSsxeB1/qduio9lfszsNZSemGGQ+qbvIEa/YIm9PmxvoTQyeG9EX22knbm6uKvy74UIWRdGVHgU+C4nJd4UP/nGrBvib42izDFho/phU+r3SNapP4hzlG/zBixQJLRlGf2imRUQ0NBYZUc0+05upfyA8WSfH8WWRR/ipeQq0KWskshfGXq4QFQYgn6lCthNPiUMc/1KzO8mITmV9sn1bLMtLL+9DrJvHXrzcXqwIIB8AJseF5Z/g0ELzw5VPU47gJ36FADSKLI2fUrsgT6T96uMsB3MuYpbqhGigeVEPd1M8Oa2YTcds= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Josh Poimboeuf The kernel doesn't have direct visibility to the ELF contents of shared libraries. Add some prctl() interfaces which allow glibc to tell the kernel where to find .sframe sections. Signed-off-by: Josh Poimboeuf Signed-off-by: Steven Rostedt (Google) --- include/uapi/linux/prctl.h | 6 +++++- kernel/sys.c | 9 +++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/prctl.h b/include/uapi/linux/prctl.h index 43dec6eed559..c575cf7151b1 100644 --- a/include/uapi/linux/prctl.h +++ b/include/uapi/linux/prctl.h @@ -351,7 +351,7 @@ struct prctl_mm_map { * configuration. All bits may be locked via this call, including * undefined bits. */ -#define PR_LOCK_SHADOW_STACK_STATUS 76 +#define PR_LOCK_SHADOW_STACK_STATUS 76 =20 /* * Controls the mode of timer_create() for CRIU restore operations. @@ -371,4 +371,8 @@ struct prctl_mm_map { # define PR_FUTEX_HASH_GET_SLOTS 2 # define PR_FUTEX_HASH_GET_IMMUTABLE 3 =20 +/* SFRAME management */ +#define PR_ADD_SFRAME 79 +#define PR_REMOVE_SFRAME 80 + #endif /* _LINUX_PRCTL_H */ diff --git a/kernel/sys.c b/kernel/sys.c index adc0de0aa364..cf788e66dc86 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -65,6 +65,7 @@ #include #include #include +#include =20 #include =20 @@ -2824,6 +2825,14 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, a= rg2, unsigned long, arg3, case PR_FUTEX_HASH: error =3D futex_hash_prctl(arg2, arg3, arg4); break; + case PR_ADD_SFRAME: + error =3D sframe_add_section(arg2, arg3, arg4, arg5); + break; + case PR_REMOVE_SFRAME: + if (arg3 || arg4 || arg5) + return -EINVAL; + error =3D sframe_remove_section(arg2); + break; default: trace_task_prctl_unknown(option, arg2, arg3, arg4, arg5); error =3D -EINVAL; --=20 2.47.2