Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1096008lqm; Thu, 2 May 2024 05:23:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWwE09LC05x6cygb2u2pBjvvfWnCYt+KFN277u27Sd4mHyCfJUHdzidirSbsFlpM2F+RqBnstCy67xYhXt3IMM2MiEdmP5qgquitaz6/Q== X-Google-Smtp-Source: AGHT+IHPpGDKPivNYDnm5mOhXoupqbjlfOQRdsZBX3o8WsNpgWseq30GHLijECnX3Con3dvYuK4L X-Received: by 2002:a17:906:a189:b0:a52:56e8:224a with SMTP id s9-20020a170906a18900b00a5256e8224amr1542967ejy.51.1714652626516; Thu, 02 May 2024 05:23:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714652626; cv=pass; d=google.com; s=arc-20160816; b=OGADwk5JCJGcrc4smic5fk99kbFpMY15pIR0qAQUkw0ypYSiHt+7aU8N1g2RW+1Qnv Bx0Uhfh9SR2TIsuarka/AIeBdZeLgLeYhN64+bZDdrP8zJV7BokMJsEMqb+4AV7xXgGt W8O5dmMoA2gqEUI6c1xx+v4OV/WeZXcsD3GGHz0NvRe1IDYVjGWzKp6jn7smtAyaTDA1 vWyaj4iNmmvU+7IfJhlcw6CvS7N+H//wtsnIyiFSMg5L9j8l3xdU3mgibg2XcIZR1/uq oD5S8ET9eUL+Z4+ZVfBQvHyiw+ZR+csnd/Mczl+RCtsHSxL1U/eQs3Cq1BWu08GBP8nR AA+A== 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=u6oFqhax+rdToeRfofEe2lYdipIB9IHQSSbHp+u1raI=; b=ABYR1UrJLgBj7YMDHh/Yt0G9SMegdL2wYPvH7St/Zoqr8Lykct/RQcaeZIsyNyM+Nn lcom5Ngy7/y5c69eV+mOYUTkztZN94PoRWRxvbtDdb6tcQNqAR1Vnyi7jY7qK/dl6o77 OcYONT1wtAT1O+SMi7W9HqpnHZLlzv7/AOBdYcD4nxGk3gAOtxsdA/JO4JwZF+u7kcgl EswlQIEYAyI5X3C9ITNNiIZudL5N/aSwUQNjkoQVidTYeT3dXamNg/0NXWRWR9alRtYv gw8EqVp1hJB94Nd793mO/Ide2nFUAyLf8FWbqeSwk/O/9VvVViQnWYBQ8rUOSjN+XiJq /dtw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=J+07Pk7s; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-166439-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166439-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id j25-20020a170906051900b00a58e4d5bd86si286292eja.112.2024.05.02.05.23.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 05:23:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166439-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=J+07Pk7s; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-166439-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166439-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 39E511F21CF8 for ; Thu, 2 May 2024 12:23:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 476327E567; Thu, 2 May 2024 12:23:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="J+07Pk7s" 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 58D2F79B87; Thu, 2 May 2024 12:23:33 +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=1714652613; cv=none; b=mA53dPyize4SpY56rkC2jrAFgdYSz1R0Uh5V01qrnEWSDk+DnouUUt6oCo9VmhhXrebA+t/0semhesP+Qax4N6rmJ1TnURkYxspfEp6UplhlZl7JjRVBT1YMv8kHK08MjULdT5qJ2QnWpWpebbJasvwx8s7zrhtBNHaOrh/xeMc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714652613; c=relaxed/simple; bh=E5mBBj7H+FbDyWHA7CcEj363KWYlCnqsF3O54TPh5Qo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PdG7LD/CD1st12Fxl8rnORlMLhHBJek5HMf4JYucxQqwgODCugigqBusax2X90VASMzmd3TPkBc2yM+VVdb5DJcE6IUk9ISziz0q3MyG4wqr1/xEeqIaNOswmDAefMqYD0PRRqg77z9Yb7iDl5b+zXWBf7bOrEIisFRSKCWZ3RQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=J+07Pk7s; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A749C113CC; Thu, 2 May 2024 12:23:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714652613; bh=E5mBBj7H+FbDyWHA7CcEj363KWYlCnqsF3O54TPh5Qo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J+07Pk7sD7MGVUUbcEBVGjt6/cPQrt2hkGzytFOnyV8z9AUCMHsgI2zGKHi1g8vWc UrX2Q3RgrNHnkQ81OYOS1oZ2/tNy0/sTMIbfVvI74Wg1WD5wKjyM8PWfsJ7EWz4J+s YR4yU4dCLiWKpLYXSKe+0EcWooE9gpj0AIvGlXo77pdW77uLAKLSeMS76bimIjAa1Y 2tEIZ8+adyQNy/1NWNJxThQ6bn3asSl1rld7atXhi56CEYPQBLxq3mV6noSfC432JW zIaDylqdZZ/NDmAtuvwQbCBhj+pd/TNR2188BQRrHELszbGBsruB7jQYyoxrbXg3g5 hYPZ8lcNYtlqA== 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 Subject: [PATCHv4 bpf-next 1/7] uprobe: Wire up uretprobe system call Date: Thu, 2 May 2024 14:23:07 +0200 Message-ID: <20240502122313.1579719-2-jolsa@kernel.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240502122313.1579719-1-jolsa@kernel.org> References: <20240502122313.1579719-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