@@ -1053,7 +1053,7 @@ void security_inode_free(struct inode *inode)
* The inode will be freed after the RCU grace period too.
*/
if (inode->i_security)
- call_rcu((struct rcu_head *)inode->i_security,
+ call_rcu_lazy((struct rcu_head *)inode->i_security,
inode_free_by_rcu);
}
@@ -442,7 +442,7 @@ static void avc_node_free(struct rcu_head *rhead)
static void avc_node_delete(struct selinux_avc *avc, struct avc_node *node)
{
hlist_del_rcu(&node->list);
- call_rcu(&node->rhead, avc_node_free);
+ call_rcu_lazy(&node->rhead, avc_node_free);
atomic_dec(&avc->avc_cache.active_nodes);
}
@@ -458,7 +458,7 @@ static void avc_node_replace(struct selinux_avc *avc,
struct avc_node *new, struct avc_node *old)
{
hlist_replace_rcu(&old->list, &new->list);
- call_rcu(&old->rhead, avc_node_free);
+ call_rcu_lazy(&old->rhead, avc_node_free);
atomic_dec(&avc->avc_cache.active_nodes);
}
This is required to prevent callbacks triggering RCU machinery too quickly and too often, which adds more power to the system. Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org> --- security/security.c | 2 +- security/selinux/avc.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)