Skip to content

RFC Fix a problem with incoming TCP connections and NetLabel

Paul Moore netdev selinux 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3lsm: Relocate the IPv4 security_inet_conn_request() hooksnet/ipv4/syncookies.c net/ipv4/tcp_ipv4.c+9 -72 replies
2/3netlabel: Label incoming TCP connections correctly in SELinuxinclude/net/cipso_ipv4.h include/net/netlabel.h net/ipv4/cipso_ipv4.c +5 more+327 -2120 replies
3/3netlabel: Label incoming TCP connections correctly in Smackinclude/net/netlabel.h net/netlabel/netlabel_kapi.c security/smack/smack_lsm.c+57 -120 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchDavid S. Miller
1/3A-b
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC PATCH v1 0/3] Fix a problem with incoming TCP connections and NetLabel

The patches below have more information on the problem but the issue is that we are not correctly labeling incoming TCP connection sockets at present. Due to a variety of things all coming together we've gotten a bit lucky in that the majority of labeled TCP connections are labeled correctly now but this won't hold for long as some of the new features added recently will break this "happy coincidence" for some configurations.

For the folks on netdev, you probably only care about the relocation of the security_inet_conn_request() hooks but this is such a minor move I doubt there will be much objection. Still, I would appreciate any feedback/comments.

For the folks on the SELinux and LSM lists please take a look and let me know if the basic approach seems reasonable. Keep in mind I still need to make a few more passes through the code to clean it up and make sure I haven't done anything stupid. I've done basic testing under both SELinux and Smack using 2.6.29-rc7 and everything looks okay so far so feel free to play with it but more testing is still needed.

---

Paul Moore (3):
netlabel: Label incoming TCP connections correctly in Smack
netlabel: Label incoming TCP connections correctly in SELinux
lsm: Relocate the IPv4 security_inet_conn_request() hooks

 include/net/cipso_ipv4.h            |   17 +++
 include/net/netlabel.h              |   17 +++
 net/ipv4/cipso_ipv4.c               |  130 ++++++++++++++++++++++--
 net/ipv4/syncookies.c               |    9 +-
 net/ipv4/tcp_ipv4.c                 |    7 +
 net/netlabel/netlabel_kapi.c        |  124 +++++++++++++++++++++--
 security/selinux/hooks.c            |   54 +++-------
 security/selinux/include/netlabel.h |   26 ++---
 security/selinux/netlabel.c         |  187 ++++++++++-------------------------
 security/smack/smack_lsm.c          |   53 +++++++---
 10 files changed, 393 insertions(+), 231 deletions(-)