Go to file
Jiawei Ye c328bf681e smackfs: Use rcu_assign_pointer() to ensure safe assignment in smk_set_cipso
[ Upstream commit 2749749afa ]

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: 0817534ff9 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-10-17 15:20:59 +02:00
arch xen: use correct end address of kernel for conflict checking 2024-10-17 15:20:54 +02:00
block block: fix potential invalid pointer dereference in blk_add_partition 2024-10-17 15:20:45 +02:00
certs
crypto crypto: xor - fix template benchmarking 2024-10-17 15:20:36 +02:00
Documentation ipmi: docs: don't advertise deprecated sysfs entries 2024-10-17 15:20:54 +02:00
drivers tpm: Clean up TPM space after command failure 2024-10-17 15:20:55 +02:00
fs ext4: clear EXT4_GROUP_INFO_WAS_TRIMMED_BIT even mount with discard 2024-10-17 15:20:59 +02:00
include i2c: Add i2c_get_match_data() 2024-10-17 15:20:48 +02:00
init rust: fix the default format for CONFIG_{RUSTC,BINDGEN}_VERSION_TEXT 2024-08-29 17:30:32 +02:00
io_uring io_uring/sqpoll: Do not set PF_NO_SETAFFINITY on sqpoll threads 2024-09-12 11:10:26 +02:00
ipc sysctl: treewide: drop unused argument ctl_table_root::set_ownership(table) 2024-08-11 12:35:51 +02:00
kernel kthread: fix task state in kthread worker if being frozen 2024-10-17 15:20:58 +02:00
lib xz: cleanup CRC32 edits from 2018 2024-10-17 15:20:58 +02:00
LICENSES
mm mm: avoid leaving partial pfn mappings around in error case 2024-09-18 19:23:04 +02:00
net ipv6: avoid possible NULL deref in rt6_uncached_list_flush_dev() 2024-10-17 15:20:44 +02:00
rust rust: kbuild: fix export of bss symbols 2024-09-12 11:10:21 +02:00
samples bpf: Replace bpf_lpm_trie_key 0-length array with flexible array 2024-08-29 17:30:22 +02:00
scripts scripts: kconfig: merge_config: config files: add a trailing newline 2024-09-18 19:23:03 +02:00
security smackfs: Use rcu_assign_pointer() to ensure safe assignment in smk_set_cipso 2024-10-17 15:20:59 +02:00
sound ALSA: hda: cs35l41: fix module autoloading 2024-10-17 15:20:47 +02:00
tools selftests/bpf: Fix compile if backtrace support missing in libc 2024-10-17 15:20:58 +02:00
usr
virt KVM: Fix a data race on last_boosted_vcpu in kvm_vcpu_on_spin() 2024-06-27 13:46:21 +02:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS MAINTAINERS: add leah to 6.1 MAINTAINERS file 2024-05-17 11:56:16 +02:00
Makefile Linux 6.1.112 2024-09-30 16:23:56 +02:00
README

Linux kernel

There are several guides for kernel developers and users. These guides can be rendered in a number of formats, like HTML and PDF. Please read Documentation/admin-guide/README.rst first.

In order to build the documentation, use make htmldocs or make pdfdocs. The formatted documentation can also be read online at:

https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory, several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the requirements for building and running the kernel, and information about the problems which may result by upgrading your kernel.