Message ID | 20220824050213.3643599-7-steffen.klassert@secunet.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 17ecd4a4db4783392edd4944f5e8268205083f70 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [1/6] xfrm: fix refcount leak in __xfrm_policy_check() | expand |
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 4f8bbb825abc..cc6ab79609e2 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -3162,7 +3162,7 @@ struct dst_entry *xfrm_lookup_with_ifid(struct net *net, return dst; nopol: - if (!(dst_orig->dev->flags & IFF_LOOPBACK) && + if ((!dst_orig->dev || !(dst_orig->dev->flags & IFF_LOOPBACK)) && net->xfrm.policy_default[dir] == XFRM_USERPOLICY_BLOCK) { err = -EPERM; goto error;