[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>

authored by Venkat Yekkirala and committed by David S. Miller 334c8556 d88ae4cc

+3
+3
security/selinux/ss/services.c
··· 1299 avc_ss_reset(seqno); 1300 selnl_notify_policyload(seqno); 1301 selinux_netlbl_cache_invalidate(); 1302 return 0; 1303 } 1304 ··· 1355 avc_ss_reset(seqno); 1356 selnl_notify_policyload(seqno); 1357 selinux_netlbl_cache_invalidate(); 1358 1359 return 0; 1360 ··· 1855 if (!rc) { 1856 avc_ss_reset(seqno); 1857 selnl_notify_policyload(seqno); 1858 } 1859 return rc; 1860 }
··· 1299 avc_ss_reset(seqno); 1300 selnl_notify_policyload(seqno); 1301 selinux_netlbl_cache_invalidate(); 1302 + atomic_inc(&flow_cache_genid); 1303 return 0; 1304 } 1305 ··· 1354 avc_ss_reset(seqno); 1355 selnl_notify_policyload(seqno); 1356 selinux_netlbl_cache_invalidate(); 1357 + atomic_inc(&flow_cache_genid); 1358 1359 return 0; 1360 ··· 1853 if (!rc) { 1854 avc_ss_reset(seqno); 1855 selnl_notify_policyload(seqno); 1856 + atomic_inc(&flow_cache_genid); 1857 } 1858 return rc; 1859 }