]> git.baikalelectronics.ru Git - kernel.git/commit
xfrm: Add security check before flushing SAD/SPD
authorJoy Latten <latten@austin.ibm.com>
Mon, 4 Jun 2007 23:05:57 +0000 (19:05 -0400)
committerDavid S. Miller <davem@sunset.davemloft.net>
Thu, 7 Jun 2007 20:42:46 +0000 (13:42 -0700)
commitaf199fb74715549c4a211933e1ac51ee3e62fc3b
tree16649593d55f3df4dac54227fcda28bb4fb49f17
parent0394a8f9b9eea1fbdeb6925b792a812a69db441c
xfrm: Add security check before flushing SAD/SPD

Currently we check for permission before deleting entries from SAD and
SPD, (see security_xfrm_policy_delete() security_xfrm_state_delete())
However we are not checking for authorization when flushing the SPD and
the SAD completely. It was perhaps missed in the original security hooks
patch.

This patch adds a security check when flushing entries from the SAD and
SPD.  It runs the entire database and checks each entry for a denial.
If the process attempting the flush is unable to remove all of the
entries a denial is logged the the flush function returns an error
without removing anything.

This is particularly useful when a process may need to create or delete
its own xfrm entries used for things like labeled networking but that
same process should not be able to delete other entries or flush the
entire database.

Signed-off-by: Joy Latten<latten@austin.ibm.com>
Signed-off-by: Eric Paris <eparis@parisplace.org>
Signed-off-by: James Morris <jmorris@namei.org>
include/net/xfrm.h
net/key/af_key.c
net/xfrm/xfrm_policy.c
net/xfrm/xfrm_state.c
net/xfrm/xfrm_user.c