summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cppc_cpufreq.c
diff options
context:
space:
mode:
authorJiawei Ye <jiawei.ye@foxmail.com>2024-09-02 08:47:26 +0000
committerCasey Schaufler <casey@schaufler-ca.com>2024-09-03 08:37:17 -0700
commit2749749afa071f8a0e405605de9da615e771a7ce (patch)
tree9cd11638a48892f7373f207051b9056a2f3928fa /drivers/cpufreq/cppc_cpufreq.c
parenteabc10e60dac08b9f4f05872d785532d0856e09f (diff)
downloadlinux-stable-2749749afa071f8a0e405605de9da615e771a7ce.tar.gz
linux-stable-2749749afa071f8a0e405605de9da615e771a7ce.tar.bz2
linux-stable-2749749afa071f8a0e405605de9da615e771a7ce.zip
smackfs: Use rcu_assign_pointer() to ensure safe assignment in smk_set_cipso
In the `smk_set_cipso` function, the `skp->smk_netlabel.attr.mls.cat` field is directly assigned to a new value without using the appropriate RCU pointer assignment functions. According to RCU usage rules, this is illegal and can lead to unpredictable behavior, including data inconsistencies and impossible-to-diagnose memory corruption issues. This possible bug was identified using a static analysis tool developed by myself, specifically designed to detect RCU-related issues. To address this, the assignment is now done using rcu_assign_pointer(), which ensures that the pointer assignment is done safely, with the necessary memory barriers and synchronization. This change prevents potential RCU dereference issues by ensuring that the `cat` field is safely updated while still adhering to RCU's requirements. Fixes: 0817534ff9ea ("smackfs: Fix use-after-free in netlbl_catmap_walk()") Signed-off-by: Jiawei Ye <jiawei.ye@foxmail.com> Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Diffstat (limited to 'drivers/cpufreq/cppc_cpufreq.c')
0 files changed, 0 insertions, 0 deletions