From mboxrd@z Thu Jan 1 00:00:00 1970 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 EB89319CD0F for ; Tue, 16 Jul 2024 14:44:49 +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=1721141090; cv=none; b=gsNAsMXyA4NrFJZqrAzYzOzL0xC7XlPBtDPwhn+PIFoZN0ULzRvehbgfSzRHwoxzDd4s6cH855TiK+Blq7hz+IHAgmas/EtSJeNpR7vUjvl/HcTt2BjFqvGq9iOidEAkAnR9q4xtxjjYNprHRnhw/tk4LRjSuYqR+IUiH5OKoTk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721141090; c=relaxed/simple; bh=H4NquPLU96OgxyfbuAsKR5J5KG7JvsxSWW0kdaj4CrI=; h=Date:From:To:Cc:Subject:Message-Id:Mime-Version:Content-Type; b=aLZv3QK7hz+TrTzZ+R4OZJY1qCZqnTWylS9VpmM5g2KuMH6Xs3t4Srvcl68FKgUZl0M3oj/WVI+nFw57eWlI/9L8uD1p+c10Mi1jUZrLjFNn7I3AUrLq0bZf2d9/WxhjIJyhU5rhrleJo27mukHVmGiFUjpAP1k7B3My2XjtzV4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FefoqI0J; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FefoqI0J" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 891C4C4AF0F; Tue, 16 Jul 2024 14:44:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721141089; bh=H4NquPLU96OgxyfbuAsKR5J5KG7JvsxSWW0kdaj4CrI=; h=Date:From:To:Cc:Subject:From; b=FefoqI0JIwHyhJ5ltT6vZLouzs2tu7aFi3uWWspvlAMp0iuBEn65FdUsS5+6f4tjW +MdF8NBw7Wpbj4GlY6BhDribawevbeY+l7gok1s3wg742IKrIeIttvjkDsvNroobQn HVLSmqsYa/Qot3M9+LeZyOj1TUkeMOAEUIVh3W9h4Ts5cznmqtrg5uhmK/EmcTpeK1 8x0y79hWZMJQ2gQA9E9Q3astCkPGT77KWn3hjpbG8B7Ss4Po13ucN7a9SWbZ50MMES 2uAFmQRGmp/4dIm1IVwsvKc1TxP72svERxgV2DuNlNvUfJfU/Ppc+hJDvD42Y1TAzp wg3Psx5jHt3og== Date: Tue, 16 Jul 2024 23:44:45 +0900 From: Masami Hiramatsu (Google) To: Linus Torvalds Cc: Andrii Nakryiko , Jeff Johnson , Jiri Olsa , Masami Hiramatsu (Google) , Steven Rostedt , Masami Hiramatsu , linux-kernel@vger.kernel.org Subject: [GIT PULL] probes: Updates for v6.11 Message-Id: <20240716234445.a17a40e8d3d7b4ba5cef949e@kernel.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi Linus, Probes updates for v6.11: Uprobes: - x86/shstk: Make return uprobe work with shadow stack. - Add uretprobe syscall which speeds up the uretprobe 10-30% faster. This syscall is automatically used from user-space trampolines which are generated by the uretprobe. If this syscall is used by normal user program, it will cause SIGILL. Note that this is currently only implemented on x86_64. (This also has 2 fixes for adjusting the syscall number to avoid conflict with new *attrat syscalls.) - uprobes/perf: fix user stack traces in the presence of pending uretprobe. This corrects the uretprobe's trampoline address in the stacktrace with correct return address. - selftests/x86: Add a return uprobe with shadow stack test. - selftests/bpf: Add uretprobe syscall related tests. . test case for register integrity check. . test case with register changing case. . test case for uretprobe syscall without uprobes (expected to be failed). . test case for uretprobe with shadow stack. - selftests/bpf: add test validating uprobe/uretprobe stack traces - MAINTAINERS: Add uprobes entry. This does not specify the tree but to clarify who maintains and reviews the uprobes. Kprobes: - tracing/kprobes: Test case cleanups. Replace redundant WARN_ON_ONCE() + pr_warn() with WARN_ONCE() and remove unnecessary code from selftest. - tracing/kprobes: Add symbol counting check when module loads. This checks the uniqueness of the probed symbol on modules. The same check has already done for kernel symbols. (This also has a fix for build error with CONFIG_MODULES=n) Cleanup: - Add MODULE_DESCRIPTION() macros for fprobe and kprobe examples. Please pull the latest probes-v6.11 tree, which can be found at: git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git probes-v6.11 Tag SHA1: aa4c31f7638918b4fe22ccea2bc9469721ee95cd Head SHA1: c26b1b89b8a9fd8665e79cd798bd970e233772b6 Andrii Nakryiko (2): perf,uprobes: fix user stack traces in the presence of pending uretprobes selftests/bpf: add test validating uprobe/uretprobe stack traces Jeff Johnson (2): fprobe: add missing MODULE_DESCRIPTION() macro samples: kprobes: add missing MODULE_DESCRIPTION() macros Jiri Olsa (10): x86/shstk: Make return uprobe work with shadow stack uprobe: Wire up uretprobe system call uprobe: Add uretprobe syscall to speed up return probe selftests/x86: Add return uprobe shadow stack test selftests/bpf: Add uretprobe syscall test for regs integrity selftests/bpf: Add uretprobe syscall test for regs changes selftests/bpf: Add uretprobe syscall call from user space test selftests/bpf: Add uretprobe shadow stack test uprobe: Change uretprobe syscall scope and number selftests/bpf: Change uretprobe syscall number in uprobe_syscall test Masami Hiramatsu (Google) (5): tracing/kprobe: Integrate test warnings into WARN_ONCE tracing/kprobe: Remove cleanup code unrelated to selftest tracing/kprobes: Add symbol counting check when module loads tracing/kprobes: Fix build error when find_module() is not available MAINTAINERS: Add uprobes entry ---- MAINTAINERS | 13 + arch/x86/entry/syscalls/syscall_64.tbl | 1 + arch/x86/include/asm/shstk.h | 4 + arch/x86/kernel/shstk.c | 16 + arch/x86/kernel/uprobes.c | 124 ++++++- include/linux/syscalls.h | 2 + include/linux/uprobes.h | 3 + include/uapi/asm-generic/unistd.h | 5 +- kernel/events/callchain.c | 43 ++- kernel/events/uprobes.c | 33 +- kernel/sys_ni.c | 2 + kernel/trace/trace_kprobe.c | 192 +++++----- samples/fprobe/fprobe_example.c | 1 + samples/kprobes/kprobe_example.c | 1 + samples/kprobes/kretprobe_example.c | 1 + tools/include/linux/compiler.h | 4 + .../selftests/bpf/bpf_testmod/bpf_testmod.c | 123 ++++++- .../selftests/bpf/prog_tests/uprobe_syscall.c | 385 +++++++++++++++++++++ .../selftests/bpf/prog_tests/uretprobe_stack.c | 186 ++++++++++ tools/testing/selftests/bpf/progs/uprobe_syscall.c | 15 + .../selftests/bpf/progs/uprobe_syscall_executed.c | 17 + .../testing/selftests/bpf/progs/uretprobe_stack.c | 96 +++++ tools/testing/selftests/x86/test_shadow_stack.c | 145 ++++++++ 23 files changed, 1320 insertions(+), 92 deletions(-) create mode 100644 tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c create mode 100644 tools/testing/selftests/bpf/prog_tests/uretprobe_stack.c create mode 100644 tools/testing/selftests/bpf/progs/uprobe_syscall.c create mode 100644 tools/testing/selftests/bpf/progs/uprobe_syscall_executed.c create mode 100644 tools/testing/selftests/bpf/progs/uretprobe_stack.c -- Masami Hiramatsu (Google)