Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp950921lqp; Thu, 23 May 2024 05:12:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVUojOVocXXDHm41/KseQKes2nJd0Ve7YRN6TGntpsPedVgUosClVdKNiJ/QibnagaIvzUjMpXKrL3YUjrnwHIzWNpMlWAqhZShmRNtUw== X-Google-Smtp-Source: AGHT+IEPiVtP1ssp1QYZpxecSPlppZgaf20Nz3wTkkCCHGGOllQm+xLPVLFxxb9Qo3PCcFsmJdBS X-Received: by 2002:a50:d6cd:0:b0:571:bb79:51aa with SMTP id 4fb4d7f45d1cf-57832c5df1dmr4396786a12.39.1716466378786; Thu, 23 May 2024 05:12:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716466378; cv=pass; d=google.com; s=arc-20160816; b=aRQKPraqJoAvJaGuxeKYN8Ii/3GZUcAEkqSjCj22PqeDczmofNfZRi2opdIiGfj8PK c5xTXzch+Aw3QenL0FgvLI6k+vSku6lY4PFWhG7dccDnWzymwCE2+CzRATkkDktYCvyY +wkU9hNTkBIZ8wNRkTB/08Ubc3VQyqAKIU266LR/NwTg8C6xnLzQpnWYkRsxnnfjF65O 7/E1a2Fb6YQnW0/alTDuP846+kOvXZsi72HcfoJX0rHI+IP9oZ3u3Vnj4AWpltzNDIzj I9gfHvLnqasuEM+dpN8VVZrBMpvSp25lT9tG6yEs3J5c13YBZlQepCHCeAmiEIHAIddS e2qQ== 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=daqpffeul9WaZfW5nfNfEYkjAah2acOAm1z4mcwcjX4=; fh=nmDo0evxWwTAvBlxNELHY/fYZbxD4K9pluaUjPt1MrQ=; b=yco+nrhgFc0kHwho9TeIRXiPuLK3ijcx9A9fE0A2HTNzDYd9EEURfGmkV470QtUnAT cG8tPpyUQKTqZ3cTuKGJinSOSFew+r3DFoeQ8MWIZ5dSmvbkLd7/hSH5NoaYA2KABbNs H+cHFRgEQiceIeK9nKMTA2ZSLj0G2mw0nWh7MtnE8RSvAR5aZf8/nlwhaGAWnYRCFsR+ PW/AkpOGxgZKdAK29NYwdxqZeth3jvP/NdKxsJPMeriLlvPopkWuq32gLwgSS+L4cj36 Ps3e+NvUsz365tJ2PxMpYisblGY/1PGcjNQF31Q+o8LxHkcy5PUZMROLXB7tOJm6mWZ5 kqhg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jFDWDy5k; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-187441-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187441-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733c2d458fsi16082142a12.342.2024.05.23.05.12.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 05:12:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187441-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jFDWDy5k; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-187441-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187441-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 812201F22A82 for ; Thu, 23 May 2024 12:12:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 42CF213F453; Thu, 23 May 2024 12:12:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jFDWDy5k" 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 50AD113F011; Thu, 23 May 2024 12:12:21 +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=1716466341; cv=none; b=WJspe5Dp3nESotAqSczp5nQGmOqEXQ7feTWnIy4Tw03JpvaG+mi7HsZDhRQ4/pls+YRO/DvFMBYWpJHTuqWpN7xGsokJS2btPU4zKQ0gPDrwTEbXhd1aoEsXhHiVhqJi6bkknlznRHVUSS+1YdnqWFZmaz+9qldpCuhbZu/F4yA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716466341; c=relaxed/simple; bh=ZDSJELyTIdB5FwzWbQzxwe1Z8TqU4qqh0Yde/wwiluc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gxiuZWJf+W1NhjGZjFAYui4jRhQixX6mNV8uwy/dgvAsu9sIxQCLpwtmy8tgL5W6ERZCuiLLJZelPdxNrZC2MQsgyX0PF2B2zU+xai/MyEX4IAi50sIDiTA4TQeOEUQqQCnbuGeTmlrXh4skTbGBkBDWME9eRaWP7JPp2ew1NB4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jFDWDy5k; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E2BB6C2BD10; Thu, 23 May 2024 12:12:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716466340; bh=ZDSJELyTIdB5FwzWbQzxwe1Z8TqU4qqh0Yde/wwiluc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jFDWDy5k4xiUj7sokMXWzmAuye1b9qzN4BEdIVNWsTkb3k0asLvmiKRlrhObojBx6 5fdK9aAHzXhIsR6AhZPofQtGyjkFtz0aEbYaobF7WH+mFUSHDDbIuQOjEkUQR0Qfn8 ZlffOsxXRC/TD+VDzwryRHYg2uzGX+w2vZBcwsq2Jnj6US1fQvYUfcxqdoZrYPvvoF Ru58r1zDLAB/HfP7jgrzl9+XOVHZ7Yms0zwv8zvOmqLKMl9Pmn5Uy3QlDR/dCAj6mW wko1iBapHaXWiNkTDeEVIGR/szKKAj8MX9An7tF9/n4DKW1clWGodhbLZb/pyG3iH6 y6OjBro8EWGdw== 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: [PATCHv7 bpf-next 2/9] uprobe: Wire up uretprobe system call Date: Thu, 23 May 2024 14:11:42 +0200 Message-ID: <20240523121149.575616-3-jolsa@kernel.org> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240523121149.575616-1-jolsa@kernel.org> References: <20240523121149.575616-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 cc78226ffc35..47dfea0a827c 100644 --- a/arch/x86/entry/syscalls/syscall_64.tbl +++ b/arch/x86/entry/syscalls/syscall_64.tbl @@ -383,6 +383,7 @@ 459 common lsm_get_self_attr sys_lsm_get_self_attr 460 common lsm_set_self_attr sys_lsm_set_self_attr 461 common lsm_list_modules sys_lsm_list_modules +462 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 e619ac10cd23..5318e0e76799 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -972,6 +972,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 75f00965ab15..8a747cd1d735 100644 --- a/include/uapi/asm-generic/unistd.h +++ b/include/uapi/asm-generic/unistd.h @@ -842,8 +842,11 @@ __SYSCALL(__NR_lsm_set_self_attr, sys_lsm_set_self_attr) #define __NR_lsm_list_modules 461 __SYSCALL(__NR_lsm_list_modules, sys_lsm_list_modules) +#define __NR_uretprobe 462 +__SYSCALL(__NR_uretprobe, sys_uretprobe) + #undef __NR_syscalls -#define __NR_syscalls 462 +#define __NR_syscalls 463 /* * 32 bit systems traditionally used different diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c index faad00cce269..be6195e0d078 100644 --- a/kernel/sys_ni.c +++ b/kernel/sys_ni.c @@ -391,3 +391,5 @@ COND_SYSCALL(setuid16); /* restartable sequence */ COND_SYSCALL(rseq); + +COND_SYSCALL(uretprobe); -- 2.45.1