]> git.baikalelectronics.ru Git - kernel.git/commit
ipv4: tcp: unicast_sock should not land outside of TCP stack
authorEric Dumazet <edumazet@google.com>
Thu, 9 Aug 2012 13:56:06 +0000 (13:56 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 10 Aug 2012 03:56:08 +0000 (20:56 -0700)
commit03af3b3ced648ae3f16c16e8f61480c741eccf29
treeb9d1040eccd22af0d856af318f13f4cdd1f8dc75
parent3c01d4877bf8f0977b55d6c88e6f674999cfcee2
ipv4: tcp: unicast_sock should not land outside of TCP stack

commit a3f95ab3851335ba (ipv4: tcp: remove per net tcp_sock) added a
selinux regression, reported and bisected by John Stultz

selinux_ip_postroute_compat() expect to find a valid sk->sk_security
pointer, but this field is NULL for unicast_sock

It turns out that unicast_sock are really temporary stuff to be able
to reuse  part of IP stack (ip_append_data()/ip_push_pending_frames())

Fact is that frames sent by ip_send_unicast_reply() should be orphaned
to not fool LSM.

Note IPv6 never had this problem, as tcp_v6_send_response() doesnt use a
fake socket at all. I'll probably implement tcp_v4_send_response() to
remove these unicast_sock in linux-3.7

Reported-by: John Stultz <johnstul@us.ibm.com>
Bisected-by: John Stultz <johnstul@us.ibm.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Paul Moore <paul@paul-moore.com>
Cc: Eric Paris <eparis@parisplace.org>
Cc: "Serge E. Hallyn" <serge@hallyn.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_output.c