Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp274736lqp; Tue, 11 Jun 2024 04:22:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX8n9UuprUQyV4aEfG/KSk3KBH532aup1Ksdn1zgBEXCsPZFnTo0NqsC21widOyTPNNT+fLDlKMEKoDAp/QqpsTDqF5Hq093nWEbpoVDg== X-Google-Smtp-Source: AGHT+IFes72hi1OVGatQY08Q988zpqy0nWbiUVWeQArzUoBNBMKGUoPfAfYJ0Fig1PTjMMMAmvfm X-Received: by 2002:a17:902:db09:b0:1f6:e7a7:3033 with SMTP id d9443c01a7336-1f6e7a734cbmr126480755ad.0.1718104978061; Tue, 11 Jun 2024 04:22:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718104978; cv=pass; d=google.com; s=arc-20160816; b=xYVuC1m6g47EnUS9P81zD6knd53zz3ZwW2CwTAyn//MKPtXPxc7dKb3oHvbbJGHf9h srRfGUqf7wR96Xj5OgqJDAfJJWvy4PKdV4kZgLRSbWkfhNeAOaejLBfSlxgljtJ8x7/0 eVOH06O4yloFWfTfIbGj9nc1yojxFEeF6I1L0D1y97KhHImW+pgEwYyJEf6CGOZMgXfu mkQ6HqaQAIALD4BqKV9KA4hfASMWU5vCXN9GMqIhq5y8l4IhrYlvoaPzGd6e1IkzCGFJ JCxW7VVzHRT5QkqVivicNGhZQqoMDDrZE3vM8tzzlULKXIE93pXTYDBQde3oenojxbh7 8Yjw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Vc2g1UCr6zcQwUabVJeE81ILQVTe+5H2PNEdcsjC/hI=; fh=nmDo0evxWwTAvBlxNELHY/fYZbxD4K9pluaUjPt1MrQ=; b=JV8dKm+REDX/wX/GvCWXDaFUIDLzNKaALQHXNiBJsqnzHEfYr58MLtbDON4qINkL9U wSjP/NE3gpYSuGToQjW1RUBRBE9TBMvyf5v/VjnBE0qMOQRz5DEG7YnPLovTD7h2KfmO a1XrQ1FYFtOML3u1xQlpR86b2dST6hIYx0RnwRGftbgnRPEgXDGbaWe+vS6nRfiSyHjf B8E89GVZxi1LTLBBSvRRWxzT4ZSPot3wwr5zFCeDbLWonsFtMK/WbBRIqonnrsL+m/1N T2qspJH/zfME0m51d0lUzuwG1YEozVZRhBMGLUkw2Hp8gbnJblJDyD3F5P3WrmhkIFGb XPXA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hyu3zz8w; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-209718-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209718-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f712a408c1si36058325ad.220.2024.06.11.04.22.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 04:22:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209718-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hyu3zz8w; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-209718-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209718-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id AAAAA285589 for ; Tue, 11 Jun 2024 11:22:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A2F8D17B504; Tue, 11 Jun 2024 11:22:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hyu3zz8w" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 BD569171644; Tue, 11 Jun 2024 11:22:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718104950; cv=none; b=RiPl3IqQj8huyZ2LbsxuTG92YlBlz0BfgX04Y39p2y83hvdoV00KOLn6KjgIcGz1h+a6Ble5+0sqvwMA14255HFtslyyqoYMrgJtMZcCYuLSfC3i1+StEatvTKW0stndr1gruqWLKkxXb/On7t7RuBLWAzz6nxHXQ5Vt/IEz26Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718104950; c=relaxed/simple; bh=miTQKniStPWOLHCjonpZHPXe/BQEitRNyP42meyvNGU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aMqlMRoKIHI3hxzTMMLL4ocS3jXfz91OiseGZQXV9hsGCBPYxPBswvujpp4rdsjhwB9F8toKcIcAu5cmtnBYNstuC8K6BbpnvL+3u6TyVPhvrD+YimXmv5Ps+Khe5xueYAWa8akesHuPmw5xViNDQjQsp+XBeSrEhWNpOfOvtz8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hyu3zz8w; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1FF67C2BD10; Tue, 11 Jun 2024 11:22:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718104950; bh=miTQKniStPWOLHCjonpZHPXe/BQEitRNyP42meyvNGU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hyu3zz8w9AzukgR9e59gtFNxVI0sw+TuiiWPgYvOTQ9F7qN83rvOGEYn4/AAKVVyZ jSKoOIHxt35hzBYZwc5pVBsj7hSmlXqFhzranc+pKKo+n5KPybmFc2ZW4ZEFj9Eg9+ 0nEd8BHToi3x4ve5/sqS2pK04sqHQTVGK0d/Al98cYjMEewTi+Ep2xWLoduPzJL/JY Nz4ZOTIMsyoGRdry03VcPLAwIKP/ARjTg4A6F6eoLWzFJB+HHkngnb4NdfT7UGjYXq d09MFwf0Mu7IUI6lj8gZb1o5dKHIRZ4kVrPfjuAufDOAKc+4VgU4lkhybXlnKw8cBr 8Fopa8srj7GFg== From: Jiri Olsa To: Steven Rostedt , Masami Hiramatsu , Oleg Nesterov , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-api@vger.kernel.org, linux-man@vger.kernel.org, x86@kernel.org, bpf@vger.kernel.org, Song Liu , Yonghong Song , John Fastabend , Peter Zijlstra , Thomas Gleixner , "Borislav Petkov (AMD)" , Ingo Molnar , Andy Lutomirski , "Edgecombe, Rick P" , Deepak Gupta Subject: [PATCHv8 bpf-next 2/9] uprobe: Wire up uretprobe system call Date: Tue, 11 Jun 2024 13:21:51 +0200 Message-ID: <20240611112158.40795-3-jolsa@kernel.org> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240611112158.40795-1-jolsa@kernel.org> References: <20240611112158.40795-1-jolsa@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Wiring up uretprobe system call, which comes in following changes. We need to do the wiring before, because the uretprobe implementation needs the syscall number. Note at the moment uretprobe syscall is supported only for native 64-bit process. Reviewed-by: Oleg Nesterov Reviewed-by: Masami Hiramatsu (Google) Acked-by: Andrii Nakryiko Signed-off-by: Jiri Olsa --- arch/x86/entry/syscalls/syscall_64.tbl | 1 + include/linux/syscalls.h | 2 ++ include/uapi/asm-generic/unistd.h | 5 ++++- kernel/sys_ni.c | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/x86/entry/syscalls/syscall_64.tbl b/arch/x86/entry/syscalls/syscall_64.tbl index a396f6e6ab5b..6452c2ec469a 100644 --- a/arch/x86/entry/syscalls/syscall_64.tbl +++ b/arch/x86/entry/syscalls/syscall_64.tbl @@ -384,6 +384,7 @@ 460 common lsm_set_self_attr sys_lsm_set_self_attr 461 common lsm_list_modules sys_lsm_list_modules 462 common mseal sys_mseal +463 64 uretprobe sys_uretprobe # # Due to a historical design error, certain syscalls are numbered differently diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 9104952d323d..494f5e0f61f7 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -973,6 +973,8 @@ asmlinkage long sys_lsm_list_modules(u64 *ids, u32 *size, u32 flags); /* x86 */ asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int on); +asmlinkage long sys_uretprobe(void); + /* pciconfig: alpha, arm, arm64, ia64, sparc */ asmlinkage long sys_pciconfig_read(unsigned long bus, unsigned long dfn, unsigned long off, unsigned long len, diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h index d983c48a3b6a..2378f88d5ad4 100644 --- a/include/uapi/asm-generic/unistd.h +++ b/include/uapi/asm-generic/unistd.h @@ -845,8 +845,11 @@ __SYSCALL(__NR_lsm_list_modules, sys_lsm_list_modules) #define __NR_mseal 462 __SYSCALL(__NR_mseal, sys_mseal) +#define __NR_uretprobe 463 +__SYSCALL(__NR_uretprobe, sys_uretprobe) + #undef __NR_syscalls -#define __NR_syscalls 463 +#define __NR_syscalls 464 /* * 32 bit systems traditionally used different diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c index d7eee421d4bc..5ce9fa0dc195 100644 --- a/kernel/sys_ni.c +++ b/kernel/sys_ni.c @@ -392,3 +392,5 @@ COND_SYSCALL(setuid16); /* restartable sequence */ COND_SYSCALL(rseq); + +COND_SYSCALL(uretprobe); -- 2.45.1