Commit db394dea authored by Eric W. Biederman's avatar Eric W. Biederman Committed by Kamal Mostafa

ipv4: Fix ip_local_out_sk by passing the sk into __ip_local_out_sk

commit fd2874b3 upstream.

In the rare case where sk != skb->sk ip_local_out_sk arranges
to call dst->output differently if the skb is queued or not.
This is a bug.

Fix this bug by passing the sk parameter of ip_local_out_sk through
from ip_local_out_sk to __ip_local_out_sk (skipping __ip_local_out).

Fixes: 7026b1dd ("netfilter: Pass socket pointer down through okfn().")
Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent ab169a1b
...@@ -114,7 +114,7 @@ int ip_local_out_sk(struct sock *sk, struct sk_buff *skb) ...@@ -114,7 +114,7 @@ int ip_local_out_sk(struct sock *sk, struct sk_buff *skb)
{ {
int err; int err;
err = __ip_local_out(skb); err = __ip_local_out_sk(sk, skb);
if (likely(err == 1)) if (likely(err == 1))
err = dst_output_sk(sk, skb); err = dst_output_sk(sk, skb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment