19 Nov, 2021
1 commit
-
[ Upstream commit f76fbbbb5061fe14824ba5807c44bd7400a6b4e1 ]
Use the actual return value instead of always -1 if register_kretprobe()
failed.E.g. without this patch:
# insmod samples/kprobes/kretprobe_example.ko func=no_such_func
insmod: ERROR: could not insert module samples/kprobes/kretprobe_example.ko: Operation not permittedWith this patch:
# insmod samples/kprobes/kretprobe_example.ko func=no_such_func
insmod: ERROR: could not insert module samples/kprobes/kretprobe_example.ko: Unknown symbol in moduleLink: https://lkml.kernel.org/r/1635213091-24387-2-git-send-email-yangtiezhu@loongson.cn
Fixes: 804defea1c02 ("Kprobes: move kprobe examples to samples/")
Signed-off-by: Tiezhu Yang
Acked-by: Masami Hiramatsu
Signed-off-by: Steven Rostedt (VMware)
Signed-off-by: Sasha Levin
15 Oct, 2020
1 commit
-
Pull kernel_clone() updates from Christian Brauner:
"During the v5.9 merge window we reworked the process creation
codepaths across multiple architectures. After this work we were only
left with the _do_fork() helper based on the struct kernel_clone_args
calling convention. As was pointed out _do_fork() isn't valid
kernelese especially for a helper that isn't just static.This series removes the _do_fork() helper and introduces the new
kernel_clone() helper. The process creation cleanup didn't change the
name to something more reasonable mainly because _do_fork() was used
in quite a few places. So sending this as a separate series seemed the
better strategy.I originally intended to send this early in the v5.9 development cycle
after the merge window had closed but given that this was touching
quite a few places I decided to defer this until the v5.10 merge
window"* tag 'kernel-clone-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux:
sched: remove _do_fork()
tracing: switch to kernel_clone()
kgdbts: switch to kernel_clone()
kprobes: switch to kernel_clone()
x86: switch to kernel_clone()
sparc: switch to kernel_clone()
nios2: switch to kernel_clone()
m68k: switch to kernel_clone()
ia64: switch to kernel_clone()
h8300: switch to kernel_clone()
fork: introduce kernel_clone()
11 Sep, 2020
1 commit
-
This patch was moved out of staging.
Fixes: 2165b82fde82 ("docs: Move kprobes.rst from staging/ to trace/")
Signed-off-by: Mauro Carvalho Chehab
Link: https://lore.kernel.org/r/a6d4c62e19ab1510789418a3a5ad42980cd7ae3a.1599660067.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Corbet
20 Aug, 2020
1 commit
-
The old _do_fork() helper is removed in favor of the new kernel_clone() helper.
The latter adheres to naming conventions for kernel internal syscall helpers.Signed-off-by: Christian Brauner
Cc: Mauro Carvalho Chehab
Cc: Alexandre Chartre
Cc: Jonathan Corbet
Cc: Thomas Gleixner
Cc: Masami Hiramatsu
Cc: Shuah Khan
Cc: Ingo Molnar
Cc: Steven Rostedt
Cc: Xiao Yang
Cc: Tom Zanussi
Cc: linux-doc@vger.kernel.org
Cc: linux-kselftest@vger.kernel.org
Link: https://lore.kernel.org/r/20200819104655.436656-11-christian.brauner@ubuntu.com
20 Jun, 2020
1 commit
-
There are several files that I was unable to find a proper place
for them, and 3 ones that are still in plain old text format.Let's place those stuff behind the carpet, as we'd like to keep the
root directory clean.We can later discuss and move those into better places.
Signed-off-by: Mauro Carvalho Chehab
Link: https://lore.kernel.org/r/11bd0d75e65a874f7c276a0aeab0fe13f3376f5f.1592203650.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Corbet
12 May, 2020
1 commit
-
Add __kprobes and NOKPROBE_SYMBOL() for sample kprobe handlers.
Signed-off-by: Masami Hiramatsu
Signed-off-by: Thomas Gleixner
Reviewed-by: Alexandre Chartre
Acked-by: Peter Zijlstra
Link: https://lkml.kernel.org/r/20200505134059.878578033@linutronix.de
21 May, 2019
1 commit
-
Add SPDX license identifiers to all files which:
- Have no license information of any form
- Have MODULE_LICENCE("GPL*") inside which was used in the initial
scan/conversion to ignore the fileThese files fall under the project license, GPL v2 only. The resulting SPDX
license identifier is:GPL-2.0-only
Signed-off-by: Thomas Gleixner
Signed-off-by: Greg Kroah-Hartman
04 Aug, 2016
2 commits
-
The regs_return_value() returns "unsigned long" or "long" value. But the
retval is int type now, it may cause overflow, the log may becomes:[ 2911.078869] do_brk returned -2003877888 and took 4620 ns to execute
This patch converts the retval to "unsigned long" type, and fixes the
overflow issue.Link: http://lkml.kernel.org/r/1464143083-3877-4-git-send-email-shijie.huang@arm.com
Signed-off-by: Huang Shijie
Cc: Petr Mladek
Cc: Steve Capper
Cc: Ananth N Mavinakayanahalli
Cc: Anil S Keshavamurthy
Cc: Masami Hiramatsu
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
We prefer to use the pr_* to print out the log now, this patch converts
the printk to pr_info. In the error path, use the pr_err to replace the
printk.Link: http://lkml.kernel.org/r/1464143083-3877-3-git-send-email-shijie.huang@arm.com
Signed-off-by: Huang Shijie
Cc: Petr Mladek
Cc: Steve Capper
Cc: Ananth N Mavinakayanahalli
Cc: Anil S Keshavamurthy
Cc: Masami Hiramatsu
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
02 Oct, 2015
1 commit
-
Commit 3033f14ab78c ("clone: support passing tls argument via C rather
than pt_regs magic") introduced _do_fork() that allowed to pass @tls
parameter.The old do_fork() is defined only for architectures that are not ready
to use this way and do not define HAVE_COPY_THREAD_TLS.Let's use _do_fork() in the kprobe examples to make them work again on
all architectures.Signed-off-by: Petr Mladek
Cc: Ingo Molnar
Cc: Masami Hiramatsu
Cc: Andy Lutomirski
Cc: Peter Zijlstra
Cc: "H. Peter Anvin"
Cc: Thomas Gleixner
Cc: Thiago Macieira
Cc: Jiri Kosina
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
17 Aug, 2009
1 commit
-
sched.h inclusion is definitely not needed like in 32-bit version,
remove it, fixup compilation.Signed-off-by: Alexey Dobriyan
Signed-off-by: David S. Miller
05 Mar, 2008
1 commit
-
Move kprobes examples from Documentation/kprobes.txt to under samples/.
Patch originally by Randy Dunlap.o Updated the patch to apply on 2.6.25-rc3
o Modified examples code to build on multiple architectures. Currently,
the kprobe and jprobe examples code works for x86 and powerpc
o Cleaned up unneeded #includes
o Cleaned up Kconfig per Sam Ravnborg's suggestions to fix build break
on archs that don't have kretprobes
o Implemented suggestions by Mathieu Desnoyers on CONFIG_KRETPROBES
o Included Andrew Morton's cleanup based on x86-git
o Modified kretprobe_example to act as a arch-agnostic module to
determine routine execution times:
Use 'modprobe kretprobe_example func=' to determine
execution time of func_name in nanoseconds.Signed-off-by: Randy Dunlap
Signed-off-by: Ananth N Mavinakayanahalli
Acked-by: Mathieu Desnoyers
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds