aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorVenkat Yekkirala <vyekkirala@TrustedCS.com>2007-01-15 19:38:45 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2007-01-23 23:25:41 -0500
commit334c85569b8adeaa820c0f2fab3c8f0a9dc8b92e (patch)
treea813e11fc4168e8eb2597364b7d809cd981859ac /security
parentd88ae4cc97b24783ee4480697fbdcc02ab4133a6 (diff)
[SELINUX]: increment flow cache genid
Currently, old flow cache entries remain valid even after a reload of SELinux policy. This patch increments the flow cache generation id on policy (re)loads so that flow cache entries are revalidated as needed. Thanks to Herbet Xu for pointing this out. See: http://marc.theaimsgroup.com/?l=linux-netdev&m=116841378704536&w=2 There's also a general issue as well as a solution proposed by David Miller for when flow_cache_genid wraps. I might be submitting a separate patch for that later. I request that this be applied to 2.6.20 since it's a security relevant fix. Signed-off-by: Venkat Yekkirala <vyekkirala@TrustedCS.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'security')
-rw-r--r--security/selinux/ss/services.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
index 3eb1fa9f0de1..ff0393317f39 100644
--- a/security/selinux/ss/services.c
+++ b/security/selinux/ss/services.c
@@ -1299,6 +1299,7 @@ int security_load_policy(void *data, size_t len)
1299 avc_ss_reset(seqno); 1299 avc_ss_reset(seqno);
1300 selnl_notify_policyload(seqno); 1300 selnl_notify_policyload(seqno);
1301 selinux_netlbl_cache_invalidate(); 1301 selinux_netlbl_cache_invalidate();
1302 atomic_inc(&flow_cache_genid);
1302 return 0; 1303 return 0;
1303 } 1304 }
1304 1305
@@ -1354,6 +1355,7 @@ int security_load_policy(void *data, size_t len)
1354 avc_ss_reset(seqno); 1355 avc_ss_reset(seqno);
1355 selnl_notify_policyload(seqno); 1356 selnl_notify_policyload(seqno);
1356 selinux_netlbl_cache_invalidate(); 1357 selinux_netlbl_cache_invalidate();
1358 atomic_inc(&flow_cache_genid);
1357 1359
1358 return 0; 1360 return 0;
1359 1361
@@ -1853,6 +1855,7 @@ out:
1853 if (!rc) { 1855 if (!rc) {
1854 avc_ss_reset(seqno); 1856 avc_ss_reset(seqno);
1855 selnl_notify_policyload(seqno); 1857 selnl_notify_policyload(seqno);
1858 atomic_inc(&flow_cache_genid);
1856 } 1859 }
1857 return rc; 1860 return rc;
1858} 1861}