]> www.infradead.org Git - users/jedix/linux-maple.git/commit
netlink: Fix dump skb leak/double free
authorHerbert Xu <herbert@gondor.apana.org.au>
Mon, 16 May 2016 09:28:16 +0000 (17:28 +0800)
committerDhaval Giani <dhaval.giani@oracle.com>
Mon, 16 Jan 2017 21:42:46 +0000 (16:42 -0500)
commitf406e133bed5b0a7fae05ff0188824315eae5ba1
treeb19e971416398d557388bb8af6f4f7b063b2c8e7
parent15479833a7e32cc9ba01c6cf466053db5e3082a1
netlink: Fix dump skb leak/double free

When we free cb->skb after a dump, we do it after releasing the
lock.  This means that a new dump could have started in the time
being and we'll end up freeing their skb instead of ours.

This patch saves the skb and module before we unlock so we free
the right memory.

Fixes: 16b304f3404f ("netlink: Eliminate kmalloc in netlink dump operation.")
Reported-by: Baozeng Ding <sploving1@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 92964c79b357efd980812c4de5c1fd2ec8bb5520)

Orabug: 25203221
CVE: CVE-2016-9806
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
net/netlink/af_netlink.c