Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp433352lqh; Tue, 7 May 2024 03:54:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXBQIOmS57kKBJ+DvoTeAf6qymFgC0MTTkHO6Vx5HbW1/+vxO5v3YhNDXCGcC2hiFs4qmXUNC5vv5MF3lvXOmkhM+LkZTj1OZJ6cOqUgQ== X-Google-Smtp-Source: AGHT+IEtAenYFL24YZofealJENV6GWipSWZ9mltP4Gtgo1dzos0gdLqk9HkIRiAx6doV71m59Y64 X-Received: by 2002:a81:b650:0:b0:61a:d0f6:3ecf with SMTP id h16-20020a81b650000000b0061ad0f63ecfmr12657430ywk.14.1715079258013; Tue, 07 May 2024 03:54:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715079257; cv=pass; d=google.com; s=arc-20160816; b=dGm5lwFc5xa0/UEEigODPLOalUvm+zWUmETITYJA2LLfGBZmwhSGVlR9ntq9M9RFgS eeHVbE+d5e9z0h4hMqwR8EeKWLLUB/NhZ9IvU4uJLOS5ViEa3nQMz7oMNmIViESOQsOc wDaIQEYkmr442D+MtUerFhVN+6ZGGTV0Sd0xeP9Sf4wf7bdB1fjJgOduq2QmMncOMPTy pWzCwly45agQ0+Sm/0YMS+Wdx/lVwzgYCXezBleE3h3MqmRsksHV+GkTXpA/+2w7eO16 kTJBYoqtsopfL24Sga+Ugnr4zeJDbCGpKGrgxc5AWthtoY101tQvbT23a2V/MhzELpKY zydg== 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=sfBEDYzsdLY4aV6dvZcix1HAk7UHyNoKF94/cONHYqQ=; fh=nmDo0evxWwTAvBlxNELHY/fYZbxD4K9pluaUjPt1MrQ=; b=gPik87aPXMF9ROMjpd6ER5+GeZAWM1QAnm3u9mH1n2fpa1ZKcUDjsoI9p3gucaAuPD QSrc1xDb85666O9CXa10TtVcoEv5WAwMI+Cuk/3ASyYOb9dBf+XW1pj1xkdrK2//RnCu 141AAdQVWedks0naUvadBrvUPHjwLe2jEliwaG9R9FM6Ou/CcR6WXfaL4Sn61EBrHE72 kY/noprrEMcNA6gg+FTdlyD4cmWcAQlwlS13CAqgJ/ZHNvPbOu9HeAjcXcV5I5weEvXW fnhhzfZc9pv0gZUZSY7f93sGbmImRvhp/aducnw0Oj8orBbytTJHHE/gGLB6NeZ2u1AJ +rkQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IE8j+ILp; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-171146-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171146-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. [147.75.199.223]) by mx.google.com with ESMTPS id u14-20020a05622a14ce00b0043aea523a7asi11782126qtx.103.2024.05.07.03.54.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 03:54:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171146-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IE8j+ILp; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-171146-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171146-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 B8EEB1C23212 for ; Tue, 7 May 2024 10:54:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D7E88152DE7; Tue, 7 May 2024 10:53:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IE8j+ILp" 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 F2B1015250E; Tue, 7 May 2024 10:53:41 +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=1715079222; cv=none; b=qZDcd8D+WxQWZSLqjKd9pc5z03A0UILs89wA7+DgroRQNz/5CVf5ZVW/1pMtmMsv3aNFwh+YueZvtwcl/4frixJwg5zcUW11JyyPkDaywkGEHmIR5Bg2lAfTe6enWOJMjB/ichBeVwddtjOt2KQIncKY6BHzZw2/bLci4uN+q3I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715079222; c=relaxed/simple; bh=E5mBBj7H+FbDyWHA7CcEj363KWYlCnqsF3O54TPh5Qo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MvI/YnhOgP0fJMiPDtRkMNvMQ4180h/X4cEcicrrZdqsp3t4QrbBv6nm4g9K54jjdrjtu/4+CArFbRsjAUyHQxDfBmYeBRxs3/dPr5MP9kS/Kwzk6WvwdHsUsqSWP15wLG6L06gQMBExXX7npYz/LXU5zH18kaJRevdnEm6/a2g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IE8j+ILp; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C25E9C3277B; Tue, 7 May 2024 10:53:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715079221; bh=E5mBBj7H+FbDyWHA7CcEj363KWYlCnqsF3O54TPh5Qo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IE8j+ILpZhneZ+eS16hdwp4q4UWGdV3m3stCDpmOJ1ffS19nCy73C6e+KWeRarjfC vr53EKHeuAwV80AQQtRbNxL5V3634fmuPMGWKMgfE1NbrHp3vrAkaw5Iyc5i1kqtKl epXgCvuCCK45WUmicfJXlhnp1hSRrCG8qaatX4t2MqARo+P1LvHGoi3xJrw/OtOCBo sIrXU6m0cINym7sBgQGK+wlZswzINuFklchvt27ygZpTCphv7Udr110rMUPUvSlOF1 v8GwfllwG6Ef0CqdV5+mDyQZgXC0+zombzsZq4UQbS76EZn2XO/inUNFxC3VkhO+XS m54RypKyozoRg== 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: [PATCHv5 bpf-next 1/8] uprobe: Wire up uretprobe system call Date: Tue, 7 May 2024 12:53:14 +0200 Message-ID: <20240507105321.71524-2-jolsa@kernel.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240507105321.71524-1-jolsa@kernel.org> References: <20240507105321.71524-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 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