[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130408154519.18177.57709.stgit@localhost>
Date: Mon, 08 Apr 2013 11:45:19 -0400
From: Paul Moore <pmoore@...hat.com>
To: netdev@...r.kernel.org
Cc: Miroslav Vadkerti <mvadkert@...hat.com>
Subject: [PATCH] tcp: assign the sock correctly to an outgoing SYNACK packet
Commit 90ba9b1986b5ac4b2d184575847147ea7c4280a2 converted
tcp_make_synack() to use alloc_skb() directly instead of calling
sock_wmalloc(), the goal being the elimination of two atomic
operations. Unfortunately, in doing so the change broke certain
SELinux/NetLabel configurations by no longer correctly assigning
the sock to the outgoing packet.
This patch fixes this regression by doing the skb->sk assignment
directly inside tcp_make_synack().
Reported-by: Miroslav Vadkerti <mvadkert@...hat.com>
Signed-off-by: Paul Moore <pmoore@...hat.com>
---
net/ipv4/tcp_output.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 5d0b438..23cc295 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2705,6 +2705,8 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst,
dst_release(dst);
return NULL;
}
+ skb->sk = sk;
+
/* Reserve space for headers. */
skb_reserve(skb, MAX_TCP_HEADER);
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists