]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
lsm: Relocate the IPv4 security_inet_conn_request() hooks
authorPaul Moore <paul.moore@hp.com>
Fri, 8 May 2009 21:58:30 +0000 (17:58 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 18 May 2009 23:34:47 +0000 (16:34 -0700)
commit18414ab61a689fa3fdaf90ad962aeae930be64d5
tree3e96b1eca17d9618b4bc688a0f4998e199d8f4b5
parentb16c010a91f513a3df4c166d4752446ec75e3f5a
lsm: Relocate the IPv4 security_inet_conn_request() hooks

[NOTE: present in Linus' tree as 284904aa79466a4736f4c775fdbe5c7407fa136c]

The current placement of the security_inet_conn_request() hooks do not allow
individual LSMs to override the IP options of the connection's request_sock.
This is a problem as both SELinux and Smack have the ability to use labeled
networking protocols which make use of IP options to carry security attributes
and the inability to set the IP options at the start of the TCP handshake is
problematic.

This patch moves the IPv4 security_inet_conn_request() hooks past the code
where the request_sock's IP options are set/reset so that the LSM can safely
manipulate the IP options as needed.  This patch intentionally does not change
the related IPv6 hooks as IPv6 based labeling protocols which use IPv6 options
are not currently implemented, once they are we will have a better idea of
the correct placement for the IPv6 hooks.

Signed-off-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/ipv4/syncookies.c
net/ipv4/tcp_ipv4.c