mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 10:12:16 +09:00
netfilter: Fix potential use after free in ip6_route_me_harder()
commita8951d5814upstream. Dst is released one line before we access it again with dst->error. Fixes:58e35d1471netfilter: ipv6: propagate routing errors from ip6_route_me_harder() Signed-off-by: Sergey Popovich <popovich_sergei@mail.ru> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c318d7b4db
commit
25a685d20e
@@ -30,13 +30,15 @@ int ip6_route_me_harder(struct sk_buff *skb)
|
||||
.daddr = iph->daddr,
|
||||
.saddr = iph->saddr,
|
||||
};
|
||||
int err;
|
||||
|
||||
dst = ip6_route_output(net, skb->sk, &fl6);
|
||||
if (dst->error) {
|
||||
err = dst->error;
|
||||
if (err) {
|
||||
IP6_INC_STATS(net, ip6_dst_idev(dst), IPSTATS_MIB_OUTNOROUTES);
|
||||
LIMIT_NETDEBUG(KERN_DEBUG "ip6_route_me_harder: No more route.\n");
|
||||
dst_release(dst);
|
||||
return dst->error;
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Drop old route. */
|
||||
|
||||
Reference in New Issue
Block a user