Re: [PATCH net-next] openvswitch: Initialize unmasked key and uid len
flat view
From: Pravin Shelar <hidden>
Date: 2015-02-06 18:21:38
On Thu, Feb 5, 2015 at 10:37 AM, Eric Dumazet [off-list ref] wrote:
On Thu, 2015-02-05 at 09:56 -0800, Pravin B Shelar wrote:quoted
Flow alloc needs to initialize unmasked key pointer. Otherwise it can crash kernel trying to free random unmasked-key pointer.quoted
CC: Joe Stringer <redacted> Reported-by: Or Gerlitz <redacted> Signed-off-by: Pravin B Shelar <redacted> --- net/openvswitch/flow_table.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)diff --git a/net/openvswitch/flow_table.c b/net/openvswitch/flow_table.c index 5e57628..d58447d 100644 --- a/net/openvswitch/flow_table.c +++ b/net/openvswitch/flow_table.c@@ -85,6 +85,8 @@ struct sw_flow *ovs_flow_alloc(void) flow->sf_acts = NULL; flow->mask = NULL; + flow->id.unmasked_key = NULL; + flow->id.ufid_len = 0; flow->stats_last_writer = NUMA_NO_NODE;At this stage, one has to wonder why not using kmem_cache_zalloc() and reduce icache pressure right ?
struct flow is still big struct, about 536 bytes. Most of the struct
is still not cleared. I do not want to clear it then initialize it
again. This helps in OVS flow setup performance.
And please please add :
Fixes: e64457191a259 ("openvswitch: Restructure datapath.c and flow.c")
or whatever commit was the bug origin.ok, I will send updated patch.
Thanks