From: Masami Hiramatsu <mhiramat@kernel.org>
To: David Howells <dhowells@redhat.com>
Cc: ananth@linux.vnet.ibm.com, alexei.starovoitov@gmail.com,
Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>,
"David S. Miller" <davem@davemloft.net>,
Masami Hiramatsu <mhiramat@kernel.org>,
linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH] Lock down kprobes
Date: Fri, 10 Nov 2017 10:01:50 +0900 [thread overview]
Message-ID: <20171110100150.ae0062c1bdab4a2f18ddd68c@kernel.org> (raw)
In-Reply-To: <11786.1510246325@warthog.procyon.org.uk>
Hi David,
On Thu, 09 Nov 2017 16:52:05 +0000
David Howells <dhowells@redhat.com> wrote:
>
> Lock down kprobes
>
> Disallow the creation of kprobes when the kernel is locked down by
> preventing their registration. This prevents kprobes from being used to
> access kernel memory, either to make modifications or to steal crypto data.
Is that locked-down flag changed while running the kernel, or
only specified by boot parameter?
If that can happen while running, we have to take care of enabling/disabling
unregistering etc. too.
Thank you,
>
> Reported-by: Alexei Starovoitov <alexei.starovoitov@gmail.com>
> Signed-off-by: David Howells <dhowells@redhat.com>
>
> diff --git a/kernel/kprobes.c b/kernel/kprobes.c
> index a1606a4224e1..f06023b0936c 100644
> --- a/kernel/kprobes.c
> +++ b/kernel/kprobes.c
> @@ -1530,6 +1530,9 @@ int register_kprobe(struct kprobe *p)
> struct module *probed_mod;
> kprobe_opcode_t *addr;
>
> + if (kernel_is_locked_down("Use of kprobes"))
> + return -EPERM;
> +
> /* Adjust probe address from symbol */
> addr = kprobe_addr(p);
> if (IS_ERR(addr))
--
Masami Hiramatsu <mhiramat@kernel.org>
next prev parent reply other threads:[~2017-11-10 1:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-09 16:52 [RFC][PATCH] Lock down kprobes David Howells
2017-11-09 17:30 ` Ananth N Mavinakayanahalli
2017-11-09 21:54 ` David Howells
2017-11-10 0:38 ` Ananth N Mavinakayanahalli
2017-11-10 1:01 ` Masami Hiramatsu [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-11-09 16:44 David Howells
2017-11-09 16:52 ` David Howells
2017-11-08 16:21 David Howells
2017-11-08 16:31 ` Ananth N Mavinakayanahalli
2017-11-09 15:31 ` David Howells
2017-11-09 16:43 ` David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171110100150.ae0062c1bdab4a2f18ddd68c@kernel.org \
--to=mhiramat@kernel.org \
--cc=alexei.starovoitov@gmail.com \
--cc=ananth@linux.vnet.ibm.com \
--cc=anil.s.keshavamurthy@intel.com \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox