android_kernel_motorola_sm6225/net
Trent Jaeger df71837d50 [LSM-IPSec]: Security association restriction.
This patch series implements per packet access control via the
extension of the Linux Security Modules (LSM) interface by hooks in
the XFRM and pfkey subsystems that leverage IPSec security
associations to label packets.  Extensions to the SELinux LSM are
included that leverage the patch for this purpose.

This patch implements the changes necessary to the XFRM subsystem,
pfkey interface, ipv4/ipv6, and xfrm_user interface to restrict a
socket to use only authorized security associations (or no security
association) to send/receive network packets.

Patch purpose:

The patch is designed to enable access control per packets based on
the strongly authenticated IPSec security association.  Such access
controls augment the existing ones based on network interface and IP
address.  The former are very coarse-grained, and the latter can be
spoofed.  By using IPSec, the system can control access to remote
hosts based on cryptographic keys generated using the IPSec mechanism.
This enables access control on a per-machine basis or per-application
if the remote machine is running the same mechanism and trusted to
enforce the access control policy.

Patch design approach:

The overall approach is that policy (xfrm_policy) entries set by
user-level programs (e.g., setkey for ipsec-tools) are extended with a
security context that is used at policy selection time in the XFRM
subsystem to restrict the sockets that can send/receive packets via
security associations (xfrm_states) that are built from those
policies.

A presentation available at
www.selinux-symposium.org/2005/presentations/session2/2-3-jaeger.pdf
from the SELinux symposium describes the overall approach.

Patch implementation details:

On output, the policy retrieved (via xfrm_policy_lookup or
xfrm_sk_policy_lookup) must be authorized for the security context of
the socket and the same security context is required for resultant
security association (retrieved or negotiated via racoon in
ipsec-tools).  This is enforced in xfrm_state_find.

On input, the policy retrieved must also be authorized for the socket
(at __xfrm_policy_check), and the security context of the policy must
also match the security association being used.

The patch has virtually no impact on packets that do not use IPSec.
The existing Netfilter (outgoing) and LSM rcv_skb hooks are used as
before.

Also, if IPSec is used without security contexts, the impact is
minimal.  The LSM must allow such policies to be selected for the
combination of socket and remote machine, but subsequent IPSec
processing proceeds as in the original case.

Testing:

The pfkey interface is tested using the ipsec-tools.  ipsec-tools have
been modified (a separate ipsec-tools patch is available for version
0.5) that supports assignment of xfrm_policy entries and security
associations with security contexts via setkey and the negotiation
using the security contexts via racoon.

The xfrm_user interface is tested via ad hoc programs that set
security contexts.  These programs are also available from me, and
contain programs for setting, getting, and deleting policy for testing
this interface.  Testing of sa functions was done by tracing kernel
behavior.

Signed-off-by: Trent Jaeger <tjaeger@cse.psu.edu>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-01-03 13:10:24 -08:00
..
802 [NET]: kfree cleanup 2005-11-08 09:41:34 -08:00
8021q [VLAN]: Add two missing checks to vlan_ioctl_handler() 2005-12-21 18:39:49 -08:00
appletalk [APPLETALK]: Fix broadcast bug. 2005-09-27 16:11:29 -07:00
atm [ATM]: deregistration removes device from atm_devs list immediately 2005-11-29 16:16:41 -08:00
ax25 [NET]: kfree cleanup 2005-11-08 09:41:34 -08:00
bluetooth [Bluetooth]: Remove the usage of /proc completely 2005-11-08 09:57:38 -08:00
bridge [BR_NETFILTER]: Fix leak if skb traverses > 1 bridge 2005-12-26 17:27:10 -08:00
core [LSM-IPSec]: Security association restriction. 2006-01-03 13:10:24 -08:00
dccp [DCCP]: Comment typo 2005-12-21 19:02:39 -08:00
decnet [DECNET]: add memory buffer settings 2005-12-05 13:42:06 -08:00
econet [IPV4]: Replace __in_dev_get with __in_dev_get_rcu/rtnl 2005-10-03 14:35:55 -07:00
ethernet [NET]: kfree cleanup 2005-11-08 09:41:34 -08:00
ieee80211 [PATCH] ieee80211_crypt_tkip depends on NET_RADIO 2005-12-12 23:59:28 -05:00
ipv4 [XFRM]: Handle DCCP in xfrm{4,6}_decode_session 2005-12-19 14:03:46 -08:00
ipv6 [IPV6] mcast: Fix multiple issues in MLDv2 reports. 2005-12-27 14:03:00 -08:00
ipx [NET]: Fix sparse warnings 2005-08-29 16:01:32 -07:00
irda [NET]: kfree cleanup 2005-11-08 09:41:34 -08:00
key [LSM-IPSec]: Security association restriction. 2006-01-03 13:10:24 -08:00
lapb [NET]: Kill skb->list 2005-08-29 15:31:14 -07:00
llc [LLC]: Fix compiler warnings introduced by TX window scaling changes. 2005-11-17 15:17:42 -08:00
netfilter [NETFILTER]: Wait for untracked references in nf_conntrack module unload 2005-12-05 13:36:50 -08:00
netlink [NETLINK]: Use tgid instead of pid for nlmsg_pid 2005-11-22 14:41:50 -08:00
netrom [NETROM]: Fix three if-statements in nr_state1_machine() 2005-12-21 18:38:26 -08:00
packet [AF_PACKET]: Convert PACKET_MMAP over to vm_insert_page(). 2005-12-06 16:38:35 -08:00
rose [NET]: kfree cleanup 2005-11-08 09:41:34 -08:00
rxrpc [NET]: Detect hardware rx checksum faults correctly 2005-11-10 13:01:24 -08:00
sched [PKT_SCHED]: Disable debug tracing logs by default in packet action API. 2005-12-13 22:59:50 -08:00
sctp [SCTP]: Fix sctp to not return erroneous POLLOUT events. 2005-12-19 14:24:40 -08:00
sunrpc SUNRPC: Fix "EPIPE" error on mount of rpcsec_gss-protected partitions 2005-12-19 23:12:21 -05:00
unix [PATCH] add a vfs_permission helper 2005-11-09 07:55:58 -08:00
wanrouter [NET]: kfree cleanup 2005-11-08 09:41:34 -08:00
x25 [TCP]: Move the tcp sock states to net/tcp_states.h 2005-08-29 15:41:54 -07:00
xfrm [LSM-IPSec]: Security association restriction. 2006-01-03 13:10:24 -08:00
compat.c [PATCH] Fix 32bit sendmsg() flaw 2005-09-08 08:14:11 -07:00
Kconfig [NETFILTER] move nfnetlink options to right location in kconfig menu 2005-09-17 00:41:21 -07:00
Makefile [NETFILTER]: link 'netfilter' before ipv4 2005-11-14 15:25:59 -08:00
nonet.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
socket.c [NET]: Fix module reference counts for loadable protocol modules 2005-09-27 15:23:38 -07:00
sysctl_net.c [NET]: Fix "sysctl_net.c:36: error: 'core_table' undeclared here" 2005-10-03 14:16:34 -07:00
TUNABLE Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00