All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Tokarev <mjt@tls.msk.ru>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: davem@davemloft.net, eric.dumazet@gmail.com,
	drosenberg@vsecurity.com, netdev@vger.kernel.org
Subject: Re: [PATCH] filter: Optimize instruction revalidation code.
Date: Tue, 16 Nov 2010 16:11:43 +0300	[thread overview]
Message-ID: <4CE2830F.5060907@msgid.tls.msk.ru> (raw)
In-Reply-To: <201011162208.BHC17628.SVtFMJOOLFQFOH@I-love.SAKURA.ne.jp>

16.11.2010 16:08, Tetsuo Handa wrote:
[]
>  net/core/filter.c |  214 ++++++++++++++++-------------------------------------
>  1 files changed, 65 insertions(+), 149 deletions(-)
> 
> diff --git a/net/core/filter.c b/net/core/filter.c
> index 23e9b2a..85be3d8 100644
> --- a/net/core/filter.c
> +++ b/net/core/filter.c
> @@ -383,7 +383,57 @@ EXPORT_SYMBOL(sk_run_filter);
>   */
>  int sk_chk_filter(struct sock_filter *filter, int flen)
>  {
> -	struct sock_filter *ftest;
> +	/*
> +	 * Valid instructions are initialized to non-0.
> +	 * Invalid instructions are initialized to 0.
> +	 */
> +	static u16 codes[] = {
> +		[BPF_ALU|BPF_ADD|BPF_K]  = BPF_S_ALU_ADD_K + 1,

How about using some "const" there?  :)

/mjt

  reply	other threads:[~2010-11-16 13:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-10 18:18 [PATCH] Prevent reading uninitialized memory with socketfilters Dan Rosenberg
2010-11-10 18:21 ` David Miller
2010-11-10 18:33   ` Eric Dumazet
2010-11-10 18:38     ` David Miller
2010-11-16 13:08       ` [PATCH] filter: Optimize instruction revalidation code Tetsuo Handa
2010-11-16 13:11         ` Michael Tokarev [this message]
2010-11-16 13:44         ` Eric Dumazet
2010-11-16 14:31           ` [PATCH v2] " Tetsuo Handa
2010-11-16 16:30             ` Eric Dumazet
2010-11-17  1:19               ` [PATCH v3] " Tetsuo Handa
2010-11-17  7:48                 ` Eric Dumazet
2010-11-17  7:54                   ` Changli Gao
2010-11-17  8:18                     ` Eric Dumazet
2010-11-17  8:06                   ` Tetsuo Handa
2010-11-17  9:01                     ` Hagen Paul Pfeifer
2010-11-18 18:58                 ` David Miller
2010-11-16 22:13         ` [PATCH] " Hagen Paul Pfeifer
2010-11-16 23:31           ` Changli Gao
2010-11-16 23:45             ` Hagen Paul Pfeifer
2010-11-16 23:24         ` Changli Gao

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=4CE2830F.5060907@msgid.tls.msk.ru \
    --to=mjt@tls.msk.ru \
    --cc=davem@davemloft.net \
    --cc=drosenberg@vsecurity.com \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.