From: Masami Hiramatsu <mhiramat@kernel•org>
To: Kees Cook <keescook@chromium•org>
Cc: Dominik Czarnota <dominik.czarnota@trailofbits•com>,
stable@vger•kernel.org, Jessica Yu <jeyu@kernel•org>,
Linus Torvalds <torvalds@linux-foundation•org>,
Greg Kroah-Hartman <gregkh@linuxfoundation•org>,
Andrew Morton <akpm@linux-foundation•org>,
Alexei Starovoitov <ast@kernel•org>,
Daniel Borkmann <daniel@iogearbox•net>,
Martin KaFai Lau <kafai@fb•com>, Song Liu <songliubraving@fb•com>,
Yonghong Song <yhs@fb•com>, Andrii Nakryiko <andriin@fb•com>,
KP Singh <kpsingh@chromium•org>,
"Naveen N. Rao" <naveen.n.rao@linux•ibm.com>,
Anil S Keshavamurthy <anil.s.keshavamurthy@intel•com>,
"David S. Miller" <davem@davemloft•net>,
Masami Hiramatsu <mhiramat@kernel•org>,
Jakub Kicinski <kuba@kernel•org>,
"Steven Rostedt (VMware)" <rostedt@goodmis•org>,
Dmitry Safonov <0x7f454c46@gmail•com>,
Will Deacon <will@kernel•org>,
Alexey Dobriyan <adobriyan@gmail•com>,
Marc Zyngier <maz@kernel•org>,
Masahiro Yamada <masahiroy@kernel•org>,
Al Viro <viro@zeniv•linux.org.uk>,
Matteo Croce <mcroce@redhat•com>,
Edward Cree <ecree@solarflare•com>,
Nicolas Dichtel <nicolas.dichtel@6wind•com>,
Alexander Lobakin <alobakin@dlink•ru>,
Thomas Richter <tmricht@linux•ibm.com>,
Ingo Molnar <mingo@kernel•org>,
netdev@vger•kernel.org, bpf@vger•kernel.org,
linux-kernel@vger•kernel.org
Subject: Re: [PATCH 4/5] kprobes: Do not expose probe addresses to non-CAP_SYSLOG
Date: Fri, 10 Jul 2020 23:09:21 +0900 [thread overview]
Message-ID: <20200710230921.7199e51fa19a7dce53823835@kernel.org> (raw)
In-Reply-To: <20200702232638.2946421-5-keescook@chromium.org>
On Thu, 2 Jul 2020 16:26:37 -0700
Kees Cook <keescook@chromium•org> wrote:
> The kprobe show() functions were using "current"'s creds instead
> of the file opener's creds for kallsyms visibility. Fix to use
> seq_file->file->f_cred.
This looks good to me.
Acked-by: Masami Hiramatsu <mhiramat@kernel•org>
Thanks!
>
> Cc: stable@vger•kernel.org
> Fixes: 81365a947de4 ("kprobes: Show address of kprobes if kallsyms does")
> Fixes: ffb9bd68ebdb ("kprobes: Show blacklist addresses as same as kallsyms does")
> Signed-off-by: Kees Cook <keescook@chromium•org>
> ---
> kernel/kprobes.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/kprobes.c b/kernel/kprobes.c
> index d4de217e4a91..2e97febeef77 100644
> --- a/kernel/kprobes.c
> +++ b/kernel/kprobes.c
> @@ -2448,7 +2448,7 @@ static void report_probe(struct seq_file *pi, struct kprobe *p,
> else
> kprobe_type = "k";
>
> - if (!kallsyms_show_value(current_cred()))
> + if (!kallsyms_show_value(pi->file->f_cred))
> addr = NULL;
>
> if (sym)
> @@ -2540,7 +2540,7 @@ static int kprobe_blacklist_seq_show(struct seq_file *m, void *v)
> * If /proc/kallsyms is not showing kernel address, we won't
> * show them here either.
> */
> - if (!kallsyms_show_value(current_cred()))
> + if (!kallsyms_show_value(m->file->f_cred))
> seq_printf(m, "0x%px-0x%px\t%ps\n", NULL, NULL,
> (void *)ent->start_addr);
> else
> --
> 2.25.1
>
--
Masami Hiramatsu <mhiramat@kernel•org>
next prev parent reply other threads:[~2020-07-10 14:09 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-02 23:26 [PATCH 0/5] Refactor kallsyms_show_value() users for correct cred Kees Cook
2020-07-02 23:26 ` [PATCH 1/5] kallsyms: Refactor kallsyms_show_value() to take cred Kees Cook
2020-07-02 23:26 ` [PATCH 2/5] module: Refactor section attr into bin attribute Kees Cook
2020-07-03 6:02 ` Greg Kroah-Hartman
2020-07-03 15:29 ` Kees Cook
2020-07-08 16:10 ` Jessica Yu
2020-07-02 23:26 ` [PATCH 3/5] module: Do not expose section addresses to non-CAP_SYSLOG Kees Cook
2020-07-08 16:12 ` Jessica Yu
2020-07-02 23:26 ` [PATCH 4/5] kprobes: Do not expose probe " Kees Cook
2020-07-03 1:00 ` Linus Torvalds
2020-07-03 15:13 ` Kees Cook
2020-07-03 15:50 ` Kees Cook
2020-07-05 20:10 ` Linus Torvalds
2020-07-05 20:19 ` Kees Cook
2020-07-10 14:09 ` Masami Hiramatsu [this message]
2020-07-02 23:26 ` [PATCH 5/5] bpf: Check correct cred for CAP_SYSLOG in bpf_dump_raw_ok() Kees Cook
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=20200710230921.7199e51fa19a7dce53823835@kernel.org \
--to=mhiramat@kernel$(echo .)org \
--cc=0x7f454c46@gmail$(echo .)com \
--cc=adobriyan@gmail$(echo .)com \
--cc=akpm@linux-foundation$(echo .)org \
--cc=alobakin@dlink$(echo .)ru \
--cc=andriin@fb$(echo .)com \
--cc=anil.s.keshavamurthy@intel$(echo .)com \
--cc=ast@kernel$(echo .)org \
--cc=bpf@vger$(echo .)kernel.org \
--cc=daniel@iogearbox$(echo .)net \
--cc=davem@davemloft$(echo .)net \
--cc=dominik.czarnota@trailofbits$(echo .)com \
--cc=ecree@solarflare$(echo .)com \
--cc=gregkh@linuxfoundation$(echo .)org \
--cc=jeyu@kernel$(echo .)org \
--cc=kafai@fb$(echo .)com \
--cc=keescook@chromium$(echo .)org \
--cc=kpsingh@chromium$(echo .)org \
--cc=kuba@kernel$(echo .)org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=masahiroy@kernel$(echo .)org \
--cc=maz@kernel$(echo .)org \
--cc=mcroce@redhat$(echo .)com \
--cc=mingo@kernel$(echo .)org \
--cc=naveen.n.rao@linux$(echo .)ibm.com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=nicolas.dichtel@6wind$(echo .)com \
--cc=rostedt@goodmis$(echo .)org \
--cc=songliubraving@fb$(echo .)com \
--cc=stable@vger$(echo .)kernel.org \
--cc=tmricht@linux$(echo .)ibm.com \
--cc=torvalds@linux-foundation$(echo .)org \
--cc=viro@zeniv$(echo .)linux.org.uk \
--cc=will@kernel$(echo .)org \
--cc=yhs@fb$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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