• Vishal Goel's avatar
    SMACK: Add the rcu synchronization mechanism in ipv6 hooks · 3c7ce342
    Vishal Goel authored
    Add the rcu synchronization mechanism for accessing smk_ipv6_port_list
    in smack IPv6 hooks. Access to the port list is vulnerable to a race
    condition issue,it does not apply proper synchronization methods while
    working on critical section. It is possible that when one thread is
    reading the list, at the same time another thread is modifying the
    same port list, which can cause the major problems.
    
    To ensure proper synchronization between two threads, rcu mechanism
    has been applied while accessing and modifying the port list. RCU will
    also not affect the performance, as there are more accesses than
    modification where RCU is most effective synchronization mechanism.
    Signed-off-by: default avatarVishal Goel <vishal.goel@samsung.com>
    Signed-off-by: default avatarHimanshu Shukla <himanshu.sh@samsung.com>
    Signed-off-by: default avatarCasey Schaufler <casey@schaufler-ca.com>
    3c7ce342
smack_lsm.c 116 KB