From: David Miller <davem@davemloft.net>
To: zlpnobody@163.com
Cc: pshelar@ovn.org, netdev@vger.kernel.org, zlpnobody@gmail.com,
neil.mckee@inmon.com
Subject: Re: [PATCH net V3] openvswitch: fix skb_panic due to the incorrect actions attrlen
Date: Wed, 16 Aug 2017 14:13:05 -0700 (PDT) [thread overview]
Message-ID: <20170816.141305.1998207836740801812.davem@davemloft.net> (raw)
In-Reply-To: <20170816053007.13991-1-zlpnobody@163.com>
From: Liping Zhang <zlpnobody@163.com>
Date: Wed, 16 Aug 2017 13:30:07 +0800
> From: Liping Zhang <zlpnobody@gmail.com>
>
> For sw_flow_actions, the actions_len only represents the kernel part's
> size, and when we dump the actions to the userspace, we will do the
> convertions, so it's true size may become bigger than the actions_len.
>
> But unfortunately, for OVS_PACKET_ATTR_ACTIONS, we use the actions_len
> to alloc the skbuff, so the user_skb's size may become insufficient and
> oops will happen like this:
...
> Also we can find that the actions_len is much little than the orig_len:
> crash> struct sw_flow_actions 0xffff8812f539d000
> struct sw_flow_actions {
> rcu = {
> next = 0xffff8812f5398800,
> func = 0xffffe3b00035db32
> },
> orig_len = 1384,
> actions_len = 592,
> actions = 0xffff8812f539d01c
> }
>
> So as a quick fix, use the orig_len instead of the actions_len to alloc
> the user_skb.
>
> Last, this oops happened on our system running a relative old kernel, but
> the same risk still exists on the mainline, since we use the wrong
> actions_len from the beginning.
>
> Fixes: ccea74457bbd ("openvswitch: include datapath actions with sampled-packet upcall to userspace")
> Cc: Neil McKee <neil.mckee@inmon.com>
> Signed-off-by: Liping Zhang <zlpnobody@gmail.com>
Applied and queued up for -stable, thanks.
prev parent reply other threads:[~2017-08-16 21:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-16 5:30 [PATCH net V3] openvswitch: fix skb_panic due to the incorrect actions attrlen Liping Zhang
2017-08-16 19:21 ` Pravin Shelar
2017-08-16 21:13 ` 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=20170816.141305.1998207836740801812.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=neil.mckee@inmon.com \
--cc=netdev@vger.kernel.org \
--cc=pshelar@ovn.org \
--cc=zlpnobody@163.com \
--cc=zlpnobody@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox