No description
Find a file
Eric W. Biederman db09247a9d ptrace: Reimplement PTRACE_KILL by always sending SIGKILL
commit 6a2d90ba02 upstream.

The current implementation of PTRACE_KILL is buggy and has been for
many years as it assumes it's target has stopped in ptrace_stop.  At a
quick skim it looks like this assumption has existed since ptrace
support was added in linux v1.0.

While PTRACE_KILL has been deprecated we can not remove it as
a quick search with google code search reveals many existing
programs calling it.

When the ptracee is not stopped at ptrace_stop some fields would be
set that are ignored except in ptrace_stop.  Making the userspace
visible behavior of PTRACE_KILL a noop in those case.

As the usual rules are not obeyed it is not clear what the
consequences are of calling PTRACE_KILL on a running process.
Presumably userspace does not do this as it achieves nothing.

Replace the implementation of PTRACE_KILL with a simple
send_sig_info(SIGKILL) followed by a return 0.  This changes the
observable user space behavior only in that PTRACE_KILL on a process
not stopped in ptrace_stop will also kill it.  As that has always
been the intent of the code this seems like a reasonable change.

Cc: stable@vger.kernel.org
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Link: https://lkml.kernel.org/r/20220505182645.497868-7-ebiederm@xmission.com
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-04-19 17:49:21 +08:00
arch ptrace: Reimplement PTRACE_KILL by always sending SIGKILL 2023-04-19 17:49:21 +08:00
block iocost: don't reset the inuse weight of under-weighted debtors 2023-04-19 17:48:22 +08:00
certs certs: Add support for using elliptic curve keys for signing modules 2021-08-23 19:55:42 +03:00
crypto crypto: ecrdsa - Fix incorrect use of vli_cmp 2023-04-19 17:49:16 +08:00
Documentation docs: submitting-patches: Fix crossref to 'The canonical patch format' 2023-04-19 17:49:18 +08:00
drivers platform/x86: intel-hid: fix _DSM function index handling 2023-04-19 17:49:21 +08:00
fs cifs: when extending a file with falloc we should make files not-sparse 2023-04-19 17:49:20 +08:00
include ptrace/xtensa: Replace PT_SINGLESTEP with TIF_SINGLESTEP 2023-04-19 17:49:21 +08:00
init random: handle latent entropy and command line from random_init() 2023-04-19 17:49:12 +08:00
ipc ipc/sem: do not sleep with a spin lock held 2023-04-19 17:45:01 +08:00
kernel ptrace: Reimplement PTRACE_KILL by always sending SIGKILL 2023-04-19 17:49:21 +08:00
lib lib/crypto: add prompts back to crypto libraries 2023-04-19 17:49:15 +08:00
LICENSES LICENSES/dual/CC-BY-4.0: Git rid of "smart quotes" 2021-07-15 06:31:24 -06:00
mm zsmalloc: fix races between asynchronous zspage free and page migration 2023-04-19 17:49:16 +08:00
net bpf: Enlarge offset check value to INT_MAX in bpf_skb_{load,store}_bytes 2023-04-19 17:49:18 +08:00
samples x86: Prepare inline-asm for straight-line-speculation 2023-04-19 17:48:43 +08:00
scripts x86: Add straight-line-speculation mitigation 2023-04-19 17:48:43 +08:00
security lockdown: also lock down previous kgdb use 2023-04-19 17:49:02 +08:00
sound ALSA: usb-audio: Cancel pending work at closing a MIDI substream 2023-04-19 17:49:19 +08:00
tools selftests: add ping test with ping_group_range tuned 2023-04-19 17:49:01 +08:00
usr usr/include/Makefile: add linux/nfc.h to the compile-test coverage 2023-04-19 17:44:58 +08:00
virt KVM: avoid NULL pointer dereference in kvm_dirty_ring_push 2023-04-19 17:47:52 +08:00
.clang-format clang-format: Update with the latest for_each macro list 2021-05-12 23:32:39 +02:00
.cocciconfig scripts: add Linux .cocciconfig for coccinelle 2016-07-22 12:13:39 +02:00
.get_maintainer.ignore Opt out of scripts/get_maintainer.pl 2019-05-16 10:53:40 -07:00
.gitattributes .gitattributes: use 'dts' diff driver for dts files 2019-12-04 19:44:11 -08:00
.gitignore .gitignore: ignore only top-level modules.builtin 2021-05-02 00:43:35 +09:00
.mailmap mailmap: add Andrej Shadura 2021-10-18 20:22:03 -10:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS MAINTAINERS: Move Daniel Drake to credits 2021-09-21 08:34:58 +03:00
Kbuild kbuild: rename hostprogs-y/always to hostprogs/always-y 2020-02-04 01:53:07 +09:00
Kconfig kbuild: ensure full rebuild when the compiler is updated 2020-05-12 13:28:33 +09:00
MAINTAINERS MAINTAINERS: add git tree for random.c 2023-04-19 17:49:03 +08:00
Makefile Linux 5.15.45 2023-04-19 17:49:18 +08:00
README Drop all 00-INDEX files from Documentation/ 2018-09-09 15:08:58 -06:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.