Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp1863214lqt; Sun, 21 Apr 2024 12:42:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXDEn/BigHJi88lCDWaCZKHe4FJW9HdKtTqAvZ5SH5yexier1sB1jv48qJ1n0OWgmccAG3Nbj+MdGtwsUV8Bo9dZMdVGnLbGlZj9K0rQQ== X-Google-Smtp-Source: AGHT+IFqRw/YmdDPfzFF5V0928FyeNAr1MdFUSWv0YmSzcqml8n23L9t+YOmW8c1vRlqmbDUAkOI X-Received: by 2002:a05:6a21:2d87:b0:1a9:d27c:3151 with SMTP id ty7-20020a056a212d8700b001a9d27c3151mr17207517pzb.23.1713728561639; Sun, 21 Apr 2024 12:42:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713728561; cv=pass; d=google.com; s=arc-20160816; b=UUCahKgFmWhbAxO7hqBwwuLXQ+P8H+HcTabxQlMpSLb4zxFb7UmwO13hPj7XzKbGqp i45XZekf24jAmF7z6j0796AXol5uA3AQFtx1StfhcK40LYA9B/WN7V1SSVhYdKYm+EkG 0/xEmRUty3bQsWLCPaPEyDTMurf84Qh8lEI0zs61RecPxkwaYEj4oPAcnw9cHUGMsd19 HUY6qtBnJJwiOJS4iJEZgPB79fb9uuIa1/ofUatsOiLv/PsA6jODZGEvo7bpjSLC2hPD K7XDDg38zHNYlre9MWS8YAOQY6xFtbc8zx6anZC82EtXlmglEHmZcCl8Wju1nsAD2k6A K/xw== 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=Pn+d8J2Gvq7bMD5sRVUThFFk6ZqxDnJvenrlD9zFPY8=; fh=BGjS9EmzIs1KVwcaqROnfMbpy2e6oo3cY1daNsDmauE=; b=Exu2TyKwD0cR7SV22QGtUmwrFnIko9wqX7iCFlIONI6qzVTLuzScCk7zLUTemnQeNo 6LwyISi3F/rEyTtz+7U1yICwb5rWwhxx2dbqDorbnkWa3vXUkOnrX7YmfwLK2DpUsfwJ uHWwn0aNATD5jhPCuXM7G1mOJAKEoiLPyD8lpveNQKmBrN60SbKiMDp61e1xVNCNJ+Vl E6qVD8KeZlj+InIHQYO5sGaOzJHai47dA4D997gjxv/+yt5GSuox+uKpIS9EiRUccMIw zHKIXn9iv4ZFRjMB78BXK3u0n5r/ofTa5E5t1ohnso2OWznp8uGE/VyKClo9hLyH7TLz O7ww==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mQm8lrPM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-152597-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152597-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 m8-20020a637108000000b005dbe2220330si6917481pgc.171.2024.04.21.12.42.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Apr 2024 12:42:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-152597-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=mQm8lrPM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-152597-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152597-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 0E66728136D for ; Sun, 21 Apr 2024 19:42:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D521642064; Sun, 21 Apr 2024 19:42:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mQm8lrPM" 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 F22033FB14; Sun, 21 Apr 2024 19:42:26 +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=1713728547; cv=none; b=Tefcbbj9DcbfDX3CUm1ZH6wKcU4PIS+JC5jljIg9Kze0ztVjhK+TXU0eMDQ/iPHwXjGyxZjq94G6Q07d4Motf+OHneoj5lH4KjbUgsQhvpT2/2Vmp3hR1gj5Hy5cDgk6VL4u9aBY9UxSsq6dOmzKL+/JdXcSnk7xm/wkwr+en+0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713728547; c=relaxed/simple; bh=WN9IWTdTK5TSpbOfDXO0WV3z3MUbFSE4i1zq1kirIpw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OUuXCq39S403SA4MYtgPF8/N4WYmEoAwuNM2q5lPVL5xWd/UuvGFyThzgZ7JU7oKJTNp12Se75yKwMp5lRuxBKsJfYhXyRzTR7dWtmku7FpNR4N77twvMVB38phY7WmZfMJG2hx4J4CgH4yg8zjHpWeXfsN9z2njhclSM9aPhgU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mQm8lrPM; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1ED84C113CE; Sun, 21 Apr 2024 19:42:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713728546; bh=WN9IWTdTK5TSpbOfDXO0WV3z3MUbFSE4i1zq1kirIpw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mQm8lrPM+Jog/b41kpEzCz2NNZlfVKPNNkXBcctQwfNZIVmVd53iDJGrx5OG/a7GJ jBiU6MTPWD5kqys3uRFOpx0LQ2+diSVm+EG82908oOEDwW04pgsgGFUDtJUGa/Yd4T P1CFxGZAFpwpaQdtsTabHRU80cIdXFruxYqVIwMqxl3PpoSfbv0lhDQy7JE1nQWfoY +eUQiibhxHZPl66/bTKESMN/VMsRLi/1Bcm/1YOO4UZRzYdAQQmaMjBOJApqmUPW/k MWSDz/WZLksMWq3wyTgtrtficU5iQ9Duef4Z3JyFBDk0dFCtDxz0yvT/ZNk/5FpJH0 M0Fz7RHUEt8lQ== 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, x86@kernel.org, bpf@vger.kernel.org, Song Liu , Yonghong Song , John Fastabend , Peter Zijlstra , Thomas Gleixner , "Borislav Petkov (AMD)" , Ingo Molnar , Andy Lutomirski Subject: [PATCHv3 bpf-next 1/7] uprobe: Wire up uretprobe system call Date: Sun, 21 Apr 2024 21:42:00 +0200 Message-ID: <20240421194206.1010934-2-jolsa@kernel.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240421194206.1010934-1-jolsa@kernel.org> References: <20240421194206.1010934-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. 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 7e8d46f4147f..af0a33ab06ee 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.44.0