From: Ben Hutchings <bhutchings@solarflare.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>,
Daniel Borkmann <dborkman@redhat.com>
Subject: Re: [PATCH net-next] filter: do not output bpf image address for security reason
Date: Sat, 18 May 2013 02:11:18 +0100 [thread overview]
Message-ID: <1368839478.3469.70.camel@deadeye.wl.decadent.org.uk> (raw)
In-Reply-To: <1368833499.3301.126.camel@edumazet-glaptop>
On Fri, 2013-05-17 at 16:31 -0700, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> Do not leak starting address of BPF JIT code, as it might help
> intruders to perform an attack.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Daniel Borkmann <dborkman@redhat.com>
> ---
> include/linux/filter.h | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/include/linux/filter.h b/include/linux/filter.h
> index c050dcc..08cda1c 100644
> --- a/include/linux/filter.h
> +++ b/include/linux/filter.h
> @@ -58,10 +58,11 @@ extern void bpf_jit_free(struct sk_filter *fp);
> static inline void bpf_jit_dump(unsigned int flen, unsigned int proglen,
> u32 pass, void *image)
> {
> - pr_err("flen=%u proglen=%u pass=%u image=%p\n",
> - flen, proglen, pass, image);
> + /* Do not output address (image) for security reason */
> + pr_err("flen=%u proglen=%u pass=%u image=10\n",
Not "%pK"?
Ben.
> + flen, proglen, pass);
> if (image)
> - print_hex_dump(KERN_ERR, "JIT code: ", DUMP_PREFIX_ADDRESS,
> + print_hex_dump(KERN_ERR, "JIT code: ", DUMP_PREFIX_OFFSET,
> 16, 1, image, proglen, false);
> }
> #define SK_RUN_FILTER(FILTER, SKB) (*FILTER->bpf_func)(SKB, FILTER->insns)
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
next prev parent reply other threads:[~2013-05-18 1:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-17 23:31 [PATCH net-next] filter: do not output bpf image address for security reason Eric Dumazet
2013-05-17 23:42 ` Joe Perches
2013-05-17 23:48 ` Eric Dumazet
2013-05-18 1:11 ` Ben Hutchings [this message]
2013-05-18 1:27 ` David Miller
2013-05-18 2:55 ` Eric Dumazet
-- strict thread matches above, loose matches on Subject: below --
2013-05-18 2:57 Eric Dumazet
2013-05-20 6:57 ` David Miller
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=1368839478.3469.70.camel@deadeye.wl.decadent.org.uk \
--to=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=dborkman@redhat.com \
--cc=eric.dumazet@gmail.com \
--cc=netdev@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