From: David Miller <davem@davemloft.net>
To: xiaosuo@gmail.com
Cc: hadi@cyberus.ca, netdev@vger.kernel.org
Subject: Re: [PATCH v2] cls_u32: use skb_header_pointer() to dereference data safely
Date: Wed, 02 Jun 2010 07:15:10 -0700 (PDT) [thread overview]
Message-ID: <20100602.071510.255391809.davem@davemloft.net> (raw)
In-Reply-To: <1275487236-14452-1-git-send-email-xiaosuo@gmail.com>
From: Changli Gao <xiaosuo@gmail.com>
Date: Wed, 2 Jun 2010 22:00:36 +0800
> use skb_header_pointer() to dereference data safely
>
> the original skb->data dereference isn't safe, as there isn't any skb->len or
> skb_is_nonlinear() check. skb_header_pointer() is used instead in this patch.
> And when the skb isn't long enough, we terminate the function u32_classify()
> immediately with -1. Unaligned access is also fixed.
>
> Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Please don't do so many things at once Changli.
Everything is fine except the get_unaligned() addition. It's
intentionally not there, and by adding the get_unaligned() you're
going to kill performance as this expands to 4 byte loads per u32 key
check on RISC systems.
If it's not aligned, that's a path or configuration that will need to
be fixed up such that the accesses are aligned.
Please respin this patch with the get_unaligned() part removed.
Thanks.
prev parent reply other threads:[~2010-06-02 14:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-02 14:00 [PATCH v2] cls_u32: use skb_header_pointer() to dereference data safely Changli Gao
2010-06-02 14:15 ` David Miller [this message]
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=20100602.071510.255391809.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=hadi@cyberus.ca \
--cc=netdev@vger.kernel.org \
--cc=xiaosuo@gmail.com \
/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.