mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
NetLabel: fix a cache race condition
Testing revealed a problem with the NetLabel cache where a cached entry could be freed while in use by the LSM layer causing an oops and other problems. This patch fixes that problem by introducing a reference counter to the cache entry so that it is only freed when it is no longer in use. Signed-off-by: Paul Moore <[email protected]> Signed-off-by: James Morris <[email protected]>
This commit is contained in:
parent
c25d518044
commit
ffb733c650
4 changed files with 79 additions and 40 deletions
|
|
@ -200,7 +200,7 @@ void netlbl_cache_invalidate(void)
|
|||
int netlbl_cache_add(const struct sk_buff *skb,
|
||||
const struct netlbl_lsm_secattr *secattr)
|
||||
{
|
||||
if (secattr->cache.data == NULL)
|
||||
if (secattr->cache == NULL)
|
||||
return -ENOMSG;
|
||||
|
||||
if (CIPSO_V4_OPTEXIST(skb))
|
||||
|
|
|
|||
Loading…
Reference in a new issue