]> git.ipfire.org Git - people/arne_f/kernel.git/commit
vrf: Fix use after free and double free in vrf_finish_output
authorDavid Ahern <dsahern@gmail.com>
Thu, 29 Mar 2018 19:49:52 +0000 (12:49 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Apr 2018 10:32:24 +0000 (12:32 +0200)
commit65c42a2d475d904688436a50aa596f643671461f
treefc8aaed496459d711d5a1b8d50aec299a0c3863c
parent09cb8267add584dc494683989c5ed6881be00ad7
vrf: Fix use after free and double free in vrf_finish_output

[ Upstream commit 82dd0d2a9a76fc8fa2b18d80b987d455728bf83a ]

Miguel reported an skb use after free / double free in vrf_finish_output
when neigh_output returns an error. The vrf driver should return after
the call to neigh_output as it takes over the skb on error path as well.

Patch is a simplified version of Miguel's patch which was written for 4.9,
and updated to top of tree.

Fixes: 8f58336d3f78a ("net: Add ethernet header for pass through VRF device")
Signed-off-by: Miguel Fadon Perlines <mfadon@teldat.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/vrf.c