Dmitry V. Levin
cc6622730b
syscall.h: introduce syscall_set_nr()
...
Similar to syscall_set_arguments() that complements
syscall_get_arguments(), introduce syscall_set_nr() that complements
syscall_get_nr().
syscall_set_nr() is going to be needed along with syscall_set_arguments()
on all HAVE_ARCH_TRACEHOOK architectures to implement
PTRACE_SET_SYSCALL_INFO API.
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Dmitry V. Levin <[email protected] >
Tested-by: Charlie Jenkins <[email protected] >
Reviewed-by: Charlie Jenkins <[email protected] >
Acked-by: Helge Deller <[email protected] > # parisc
Reviewed-by: Maciej W. Rozycki <[email protected] > # mips
Cc: Alexander Gordeev <[email protected] >
Cc: Alexey Gladkov (Intel) <[email protected] >
Cc: Andreas Larsson <[email protected] >
Cc: anton ivanov <[email protected] >
Cc: Arnd Bergmann <[email protected] >
Cc: Borislav Betkov <[email protected] >
Cc: Brian Cain <[email protected] >
Cc: Christian Borntraeger <[email protected] >
Cc: Christian Zankel <[email protected] >
Cc: Christophe Leroy <[email protected] >
Cc: Dave Hansen <[email protected] >
Cc: Davide Berardi <[email protected] >
Cc: David S. Miller <[email protected] >
Cc: Dinh Nguyen <[email protected] >
Cc: Eugene Syromiatnikov <[email protected] >
Cc: Eugene Syromyatnikov <[email protected] >
Cc: Geert Uytterhoeven <[email protected] >
Cc: Guo Ren <[email protected] >
Cc: Heiko Carstens <[email protected] >
Cc: "H. Peter Anvin" <[email protected] >
Cc: Huacai Chen <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Johannes Berg <[email protected] >
Cc: John Paul Adrian Glaubitz <[email protected] >
Cc: Jonas Bonn <[email protected] >
Cc: Madhavan Srinivasan <[email protected] >
Cc: Max Filippov <[email protected] >
Cc: Michael Ellerman <[email protected] >
Cc: Michal Simek <[email protected] >
Cc: Mike Frysinger <[email protected] >
Cc: Naveen N Rao <[email protected] >
Cc: Nicholas Piggin <[email protected] >
Cc: Oleg Nesterov <[email protected] >
Cc: Renzo Davoi <[email protected] >
Cc: Richard Weinberger <[email protected] >
Cc: Rich Felker <[email protected] >
Cc: Russel King <[email protected] >
Cc: Shuah Khan <[email protected] >
Cc: Stafford Horne <[email protected] >
Cc: Stefan Kristiansson <[email protected] >
Cc: Sven Schnelle <[email protected] >
Cc: Thomas Gleinxer <[email protected] >
Cc: Vasily Gorbik <[email protected] >
Cc: Vineet Gupta <[email protected] >
Cc: WANG Xuerui <[email protected] >
Cc: Will Deacon <[email protected] >
Cc: Yoshinori Sato <[email protected] >
Signed-off-by: Andrew Morton <[email protected] >
2025-05-11 17:48:15 -07:00
Dmitry V. Levin
17fc7b8f9b
syscall.h: add syscall_set_arguments()
...
This function is going to be needed on all HAVE_ARCH_TRACEHOOK
architectures to implement PTRACE_SET_SYSCALL_INFO API.
This partially reverts commit 7962c2eddb ("arch: remove unused function
syscall_set_arguments()") by reusing some of old syscall_set_arguments()
implementations.
[[email protected] : fix compile time fortify checks]
Link: https://lkml.kernel.org/r/20250408213131.GA2872426@ax162
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Dmitry V. Levin <[email protected] >
Signed-off-by: Nathan Chancellor <[email protected] >
Tested-by: Charlie Jenkins <[email protected] >
Reviewed-by: Charlie Jenkins <[email protected] >
Acked-by: Helge Deller <[email protected] > # parisc
Reviewed-by: Maciej W. Rozycki <[email protected] > [mips]
Cc: Alexander Gordeev <[email protected] >
Cc: Alexey Gladkov (Intel) <[email protected] >
Cc: Andreas Larsson <[email protected] >
Cc: anton ivanov <[email protected] >
Cc: Arnd Bergmann <[email protected] >
Cc: Borislav Betkov <[email protected] >
Cc: Brian Cain <[email protected] >
Cc: Christian Borntraeger <[email protected] >
Cc: Christian Zankel <[email protected] >
Cc: Christophe Leroy <[email protected] >
Cc: Dave Hansen <[email protected] >
Cc: Davide Berardi <[email protected] >
Cc: David S. Miller <[email protected] >
Cc: Dinh Nguyen <[email protected] >
Cc: Eugene Syromiatnikov <[email protected] >
Cc: Eugene Syromyatnikov <[email protected] >
Cc: Geert Uytterhoeven <[email protected] >
Cc: Guo Ren <[email protected] >
Cc: Heiko Carstens <[email protected] >
Cc: "H. Peter Anvin" <[email protected] >
Cc: Huacai Chen <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Johannes Berg <[email protected] >
Cc: John Paul Adrian Glaubitz <[email protected] >
Cc: Jonas Bonn <[email protected] >
Cc: Madhavan Srinivasan <[email protected] >
Cc: Max Filippov <[email protected] >
Cc: Michael Ellerman <[email protected] >
Cc: Michal Simek <[email protected] >
Cc: Mike Frysinger <[email protected] >
Cc: Naveen N Rao <[email protected] >
Cc: Nicholas Piggin <[email protected] >
Cc: Oleg Nesterov <[email protected] >
Cc: Renzo Davoi <[email protected] >
Cc: Richard Weinberger <[email protected] >
Cc: Rich Felker <[email protected] >
Cc: Russel King <[email protected] >
Cc: Shuah Khan <[email protected] >
Cc: Stafford Horne <[email protected] >
Cc: Stefan Kristiansson <[email protected] >
Cc: Sven Schnelle <[email protected] >
Cc: Thomas Gleinxer <[email protected] >
Cc: Vasily Gorbik <[email protected] >
Cc: Vineet Gupta <[email protected] >
Cc: WANG Xuerui <[email protected] >
Cc: Will Deacon <[email protected] >
Cc: Yoshinori Sato <[email protected] >
Signed-off-by: Andrew Morton <[email protected] >
2025-05-11 17:48:15 -07:00
Sergey Matyukevich
fb0b54909b
ARC: implement syscall tracepoints
...
Implement all the bits required to support HAVE_SYSCALL_TRACEPOINTS
according to Documentation/trace/ftrace-design.rst.
Signed-off-by: Sergey Matyukevich <[email protected] >
Signed-off-by: Vineet Gupta <[email protected] >
2022-04-25 13:09:47 -07:00
Thomas Gleixner
d2912cb15b
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
...
Based on 2 normalized pattern(s):
this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation
this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation #
extracted by the scancode license scanner the SPDX license identifier
GPL-2.0-only
has been chosen to replace the boilerplate/reference in 4122 file(s).
Signed-off-by: Thomas Gleixner <[email protected] >
Reviewed-by: Enrico Weigelt <[email protected] >
Reviewed-by: Kate Stewart <[email protected] >
Reviewed-by: Allison Randal <[email protected] >
Cc: [email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected] >
2019-06-19 17:09:55 +02:00
Linus Torvalds
02aff8db64
Merge tag 'audit-pr-20190507' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit
...
Pull audit updates from Paul Moore:
"We've got a reasonably broad set of audit patches for the v5.2 merge
window, the highlights are below:
- The biggest change, and the source of all the arch/* changes, is
the patchset from Dmitry to help enable some of the work he is
doing around PTRACE_GET_SYSCALL_INFO.
To be honest, including this in the audit tree is a bit of a
stretch, but it does help move audit a little further along towards
proper syscall auditing for all arches, and everyone else seemed to
agree that audit was a "good" spot for this to land (or maybe they
just didn't want to merge it? dunno.).
- We can now audit time/NTP adjustments.
- We continue the work to connect associated audit records into a
single event"
* tag 'audit-pr-20190507' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit: (21 commits)
audit: fix a memory leak bug
ntp: Audit NTP parameters adjustment
timekeeping: Audit clock adjustments
audit: purge unnecessary list_empty calls
audit: link integrity evm_write_xattrs record to syscall event
syscall_get_arch: add "struct task_struct *" argument
unicore32: define syscall_get_arch()
Move EM_UNICORE to uapi/linux/elf-em.h
nios2: define syscall_get_arch()
nds32: define syscall_get_arch()
Move EM_NDS32 to uapi/linux/elf-em.h
m68k: define syscall_get_arch()
hexagon: define syscall_get_arch()
Move EM_HEXAGON to uapi/linux/elf-em.h
h8300: define syscall_get_arch()
c6x: define syscall_get_arch()
arc: define syscall_get_arch()
Move EM_ARCOMPACT and EM_ARCV2 to uapi/linux/elf-em.h
audit: Make audit_log_cap and audit_copy_inode static
audit: connect LOGIN record to its syscall record
...
2019-05-07 19:06:04 -07:00
Steven Rostedt (Red Hat)
b35f549df1
syscalls: Remove start and number from syscall_get_arguments() args
...
At Linux Plumbers, Andy Lutomirski approached me and pointed out that the
function call syscall_get_arguments() implemented in x86 was horribly
written and not optimized for the standard case of passing in 0 and 6 for
the starting index and the number of system calls to get. When looking at
all the users of this function, I discovered that all instances pass in only
0 and 6 for these arguments. Instead of having this function handle
different cases that are never used, simply rewrite it to return the first 6
arguments of a system call.
This should help out the performance of tracing system calls by ptrace,
ftrace and perf.
Link: http://lkml.kernel.org/r/[email protected]
Cc: Oleg Nesterov <[email protected] >
Cc: Kees Cook <[email protected] >
Cc: Andy Lutomirski <[email protected] >
Cc: Dominik Brodowski <[email protected] >
Cc: Dave Martin <[email protected] >
Cc: "Dmitry V. Levin" <[email protected] >
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Acked-by: Paul Burton <[email protected] > # MIPS parts
Acked-by: Max Filippov <[email protected] > # For xtensa changes
Acked-by: Will Deacon <[email protected] > # For the arm64 bits
Reviewed-by: Thomas Gleixner <[email protected] > # for x86
Reviewed-by: Dmitry V. Levin <[email protected] >
Reported-by: Andy Lutomirski <[email protected] >
Signed-off-by: Steven Rostedt (VMware) <[email protected] >
2019-04-05 09:26:43 -04:00
Dmitry V. Levin
16add41164
syscall_get_arch: add "struct task_struct *" argument
...
This argument is required to extend the generic ptrace API with
PTRACE_GET_SYSCALL_INFO request: syscall_get_arch() is going
to be called from ptrace_request() along with syscall_get_nr(),
syscall_get_arguments(), syscall_get_error(), and
syscall_get_return_value() functions with a tracee as their argument.
The primary intent is that the triple (audit_arch, syscall_nr, arg1..arg6)
should describe what system call is being called and what its arguments
are.
Reverts: 5e937a9ae9 ("syscall_get_arch: remove useless function arguments")
Reverts: 1002d94d30 ("syscall.h: fix doc text for syscall_get_arch()")
Reviewed-by: Andy Lutomirski <[email protected] > # for x86
Reviewed-by: Palmer Dabbelt <[email protected] >
Acked-by: Paul Moore <[email protected] >
Acked-by: Paul Burton <[email protected] > # MIPS parts
Acked-by: Michael Ellerman <[email protected] > (powerpc)
Acked-by: Kees Cook <[email protected] > # seccomp parts
Acked-by: Mark Salter <[email protected] > # for the c6x bit
Cc: Elvira Khabirova <[email protected] >
Cc: Eugene Syromyatnikov <[email protected] >
Cc: Oleg Nesterov <[email protected] >
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Dmitry V. Levin <[email protected] >
Signed-off-by: Paul Moore <[email protected] >
2019-03-20 21:12:36 -04:00
Dmitry V. Levin
67f2a8a293
arc: define syscall_get_arch()
...
syscall_get_arch() is required to be implemented on all architectures
in addition to already implemented syscall_get_nr(),
syscall_get_arguments(), syscall_get_error(), and
syscall_get_return_value() functions in order to extend the generic
ptrace API with PTRACE_GET_SYSCALL_INFO request.
Acked-by: Vineet Gupta <[email protected] >
Acked-by: Paul Moore <[email protected] >
Cc: Elvira Khabirova <[email protected] >
Cc: Eugene Syromyatnikov <[email protected] >
Cc: Alexey Brodkin <[email protected] >
Cc: Oleg Nesterov <[email protected] >
Cc: Andy Lutomirski <[email protected] >
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Dmitry V. Levin <[email protected] >
Signed-off-by: Paul Moore <[email protected] >
2019-03-20 21:08:08 -04:00
Vineet Gupta
352c1d95e3
ARC: stop using pt_regs->orig_r8
...
Historically, pt_regs have had orig_r8, an overloaded container for
(1) backup copy of r8 (syscall number Trap Exceptions)
(2) additional system state: (syscall/Exception/Interrupt)
There is no point in keeping (1) since syscall number is never clobbered
in-place, in pt_regs, unlike r0 which duals as first syscall arg as well
as syscall return value and in case of syscall restart, the orig arg0
needs restoring (from orig_r0) after having been updated in-place with
syscall ret value.
This further paves way to convert (2) to contain ECR itself (rather than
current madeup values)
Signed-off-by: Vineet Gupta <[email protected] >
2013-06-22 19:23:26 +05:30
Vineet Gupta
4adeefe161
ARC: Syscall support (no-legacy-syscall ABI)
...
This includes support for generic clone/for/vfork/execve
Signed-off-by: Vineet Gupta <[email protected] >
Cc: Arnd Bergmann <[email protected] >
Cc: Al Viro <[email protected] >
Acked-by: Arnd Bergmann <[email protected] >
2013-02-11 20:00:38 +05:30