Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2993827lqo; Tue, 21 May 2024 03:49:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXlaCaaHUZLISzhzyAxKzgm8f/0uuryzPUp2NRlKc6jzvJEddsafN5bQrjNL/MET7thWrDnCZQmSfbnnc6v/+M3ub521KeMG4+obdqkug== X-Google-Smtp-Source: AGHT+IF0ZzajLVAuHxQ/6OWWL8clSCDxuMpTHj+0RVP2eNY1brkNDhdiuWNVQEfbSWSoHmvuhbyx X-Received: by 2002:a05:620a:2951:b0:792:eac7:7bf4 with SMTP id af79cd13be357-792eac77cc5mr2566782785a.26.1716288555757; Tue, 21 May 2024 03:49:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716288555; cv=pass; d=google.com; s=arc-20160816; b=gXRlZA7OJgaqsEwo9FPICinM2S653fqmQe1wbfetb7yESVUbTektAj4o6jfE5tfH3O 6FLkst4RybF8CjBClkdd8i4m/SgSZ8MjmNMfOvjg/u56QoW3DFjfd2osTeYEJGYYNDJY Ls7zo0Uj9WFMtHj1egrojjZITXx2kOusKJqCGdj8P9qWNGjSFOWN6ST86LDi6i4lzfbx iucZcJ7d/2Rm+rQCGFbkqGTDL0G0YHgLrraUnvtDtEbZhR/6h/rq6FcL3daBQXS4IoLA vmEBFHosr7k0KrFSKxYWaDpz0x7LYLlIwFIh7iYa3MM6QRVKm5gx1Bz/6LULzvl9SWMq OLew== 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=QFiOSzezDacPTyxZN/KITvsa05c7ejQoSMWvSVwcQ9A=; fh=nmDo0evxWwTAvBlxNELHY/fYZbxD4K9pluaUjPt1MrQ=; b=Qh2uQkSZaUr4GAX0rcEKEghb3pH9v1SaQrjRH9SpF9So54zCi2P5iMci+/eyov7bne a2yNvSY/e5H3fDJJ9sahC5WFgTARHviW930MhGsXc6GdOwtl/BJkDMa7W1K1P1ULexiv RMI+S1J/0IF7NzOjV3XFPD+MNzH8DLDX7Yo17vhDG2Y5fzqOEtSZmLsAuKVugOOV/+Mr adNrjzTLjb896dtGUoSv1QD22V9PSAuKkJHxBWzGElLmEyi5/jHO2rsZGz5fQZdpgnNT ulraeZ913C0+DfJaGwUJzWXSli8Uf54FgjOzKH8W1gLR7ORRMgzTBskgUKD8pp/P0GOR MONQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="LpYM/Nqi"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-184821-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184821-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43e47a4cb32si102028151cf.39.2024.05.21.03.49.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 03:49:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184821-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="LpYM/Nqi"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-184821-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184821-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 7B4591C2143A for ; Tue, 21 May 2024 10:49:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 26E88745E7; Tue, 21 May 2024 10:48:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LpYM/Nqi" 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 37AE56D1BC; Tue, 21 May 2024 10:48:57 +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=1716288538; cv=none; b=qLPPxka34DfHPmYYYGiSd/sx8rPRiMQitEEndRM22fSjIqT7pqBfZabAgXx66By7XonfDTCfr+ijPNkJWfLU31u1XBZVS9CllvIHjA4om+u3NMAX52iCnID0Ccu5OyImBt4wCVe5NjGkcZmZQWeJgu2Vvokes28tpCLS9mYn8o8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716288538; c=relaxed/simple; bh=Rwhd1hPDiyj5tuZNx5+dYKU/Rm8mY6QrTxHfDT/vTy8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ggtMBEdvMTET6Oskv7618ngFsh9VLwOn91I6YFEOIYEurk4cfwmL+t/h+J9/FejtbSqM6hE9EYRkkprtCXwKo5F5gM0VC19Xd7Q+QcmrvAyVNN4qIa3J3DhuMcoAk99qkrl7qa5MEesLy136cNreNBH9WmLX1X9dD0r5vs8Ioos= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LpYM/Nqi; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 952D2C2BD11; Tue, 21 May 2024 10:48:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716288537; bh=Rwhd1hPDiyj5tuZNx5+dYKU/Rm8mY6QrTxHfDT/vTy8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LpYM/NqiAFq/Ct+bnB0THT8cngkofO3MegOsNCqz5hAJLM3mK6wxV1c9gg+lZ6gQF pUIdn/rKrr2+5UsuTt8WFUkpodFo1t1bQU6OScojqMCVHL9vlmaJvp6bWrD9HfrMEE Z2yfnucBB/UU/uxyug0vZm7FvtAqvLJ9ShG8WbNos+401TmpCpyw9mjDDTV9Ei4MYb SyW/+r48nRWfV23Qy28WohLayFOaPW1fUuoIAzLbbwfk7cUOch6jxPZv+1wTWKTkcF djVmfk8BBpRQ9RtTOAJ5PEa9Szlb2d5p/kuZ+NPw9yxH7JYQ2OUH7tVv9lkK9LrVR3 rikASh35bP0XA== 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: [PATCHv6 bpf-next 2/9] uprobe: Wire up uretprobe system call Date: Tue, 21 May 2024 12:48:18 +0200 Message-ID: <20240521104825.1060966-3-jolsa@kernel.org> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240521104825.1060966-1-jolsa@kernel.org> References: <20240521104825.1060966-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.0