Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1359 CNY

100%

CVE-2023-54271— blk-cgroup: Fix NULL deref caused by blkg_policy_data being installed before init

Quick assessment

Affected
Linux Linux
Exploitation
No confirmed in-the-wild exploitation; assess based on exposure
Recommended action
Check the vendor advisory and references for a fixed version. If immediate upgrade is impossible, restrict exposure and increase monitoring.

Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel存在安全漏洞,该漏洞源于blk-cgroup中blkg_policy_data在初始化前安装,可能导致空指针取消引用。

AI Predicted 7.8 Difficulty: Hard EPSS 0.21% · P10

Affected Version Matrix 12

VendorProduct Version RangeStatus
Linux Linux 9d179b865449b351ad5cb76dbea480c9170d4a27< da6cc648c1f570290af1ddbe6b7ca3d91b1d6db9 affected
9d179b865449b351ad5cb76dbea480c9170d4a27< 33f0370bb7ce15a59d72a4d8a05421d334a04add affected
9d179b865449b351ad5cb76dbea480c9170d4a27< e39ef7880d1057b2ebcdb013405f4d84a257db23 affected
9d179b865449b351ad5cb76dbea480c9170d4a27< 7d63c6f9765339dcfc34b7365ced7c518012e4fe affected
9d179b865449b351ad5cb76dbea480c9170d4a27< ec14a87ee1999b19d8b7ed0fa95fea80644624ae affected
5.4 affected
< 5.4 unaffected
5.15.210≤ 5.15.* unaffected
… +4 more rows
Get alerts for future matching vulnerabilities Log in to subscribe

I. Basic Information for CVE-2023-54271

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
blk-cgroup: Fix NULL deref caused by blkg_policy_data being installed before init
Source: CVE Program / CVE List V5
Vulnerability Description
In the Linux kernel, the following vulnerability has been resolved: blk-cgroup: Fix NULL deref caused by blkg_policy_data being installed before init blk-iocost sometimes causes the following crash: BUG: kernel NULL pointer dereference, address: 00000000000000e0 ... RIP: 0010:_raw_spin_lock+0x17/0x30 Code: be 01 02 00 00 e8 79 38 39 ff 31 d2 89 d0 5d c3 0f 1f 00 0f 1f 44 00 00 55 48 89 e5 65 ff 05 48 d0 34 7e b9 01 00 00 00 31 c0 <f0> 0f b1 0f 75 02 5d c3 89 c6 e8 ea 04 00 00 5d c3 0f 1f 84 00 00 RSP: 0018:ffffc900023b3d40 EFLAGS: 00010046 RAX: 0000000000000000 RBX: 00000000000000e0 RCX: 0000000000000001 RDX: ffffc900023b3d20 RSI: ffffc900023b3cf0 RDI: 00000000000000e0 RBP: ffffc900023b3d40 R08: ffffc900023b3c10 R09: 0000000000000003 R10: 0000000000000064 R11: 000000000000000a R12: ffff888102337000 R13: fffffffffffffff2 R14: ffff88810af408c8 R15: ffff8881070c3600 FS: 00007faaaf364fc0(0000) GS:ffff88842fdc0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000000000e0 CR3: 00000001097b1000 CR4: 0000000000350ea0 Call Trace: <TASK> ioc_weight_write+0x13d/0x410 cgroup_file_write+0x7a/0x130 kernfs_fop_write_iter+0xf5/0x170 vfs_write+0x298/0x370 ksys_write+0x5f/0xb0 __x64_sys_write+0x1b/0x20 do_syscall_64+0x3d/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 This happens because iocg->ioc is NULL. The field is initialized by ioc_pd_init() and never cleared. The NULL deref is caused by blkcg_activate_policy() installing blkg_policy_data before initializing it. blkcg_activate_policy() was doing the following: 1. Allocate pd's for all existing blkg's and install them in blkg->pd[]. 2. Initialize all pd's. 3. Online all pd's. blkcg_activate_policy() only grabs the queue_lock and may release and re-acquire the lock as allocation may need to sleep. ioc_weight_write() grabs blkcg->lock and iterates all its blkg's. The two can race and if ioc_weight_write() runs during #1 or between #1 and #2, it can encounter a pd which is not initialized yet, leading to crash. The crash can be reproduced with the following script: #!/bin/bash echo +io > /sys/fs/cgroup/cgroup.subtree_control systemd-run --unit touch-sda --scope dd if=/dev/sda of=/dev/null bs=1M count=1 iflag=direct echo 100 > /sys/fs/cgroup/system.slice/io.weight bash -c "echo '8:0 enable=1' > /sys/fs/cgroup/io.cost.qos" & sleep .2 echo 100 > /sys/fs/cgroup/system.slice/io.weight with the following patch applied: > diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c > index fc49be622e05..38d671d5e10c 100644 > --- a/block/blk-cgroup.c > +++ b/block/blk-cgroup.c > @@ -1553,6 +1553,12 @@ int blkcg_activate_policy(struct gendisk *disk, const struct blkcg_policy *pol) > pd->online = false; > } > > + if (system_state == SYSTEM_RUNNING) { > + spin_unlock_irq(&q->queue_lock); > + ssleep(1); > + spin_lock_irq(&q->queue_lock); > + } > + > /* all allocated, init in the same order */ > if (pol->pd_init_fn) > list_for_each_entry_reverse(blkg, &q->blkg_list, q_node) I don't see a reason why all pd's should be allocated, initialized and onlined together. The only ordering requirement is that parent blkgs to be initialized and onlined before children, which is guaranteed from the walking order. Let's fix the bug by allocating, initializing and onlining pd for each blkg and holding blkcg->lock over initialization and onlining. This ensures that an installed blkg is always fully initialized and onlined removing the the race window.
Source: CVE Program / CVE List V5
CVSS Information
N/A
Source: CVE Program / CVE List V5
Vulnerability Type
N/A
Source: CVE Program / CVE List V5
Vulnerability Title
Linux kernel 安全漏洞
Source: CNNVD (China National Vulnerability Database)
Vulnerability Description
Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel存在安全漏洞,该漏洞源于blk-cgroup中blkg_policy_data在初始化前安装,可能导致空指针取消引用。
Source: CNNVD (China National Vulnerability Database)
CVSS Information
N/A
Source: CNNVD (China National Vulnerability Database)
Vulnerability Type
N/A
Source: CNNVD (China National Vulnerability Database)

Affected Products

Vendor Product Affected Versions CPE Subscribe
Linux Linux 9d179b865449b351ad5cb76dbea480c9170d4a27 ~ da6cc648c1f570290af1ddbe6b7ca3d91b1d6db9 -
Linux Linux 5.4 -

II. Public POCs for CVE-2023-54271

# POC Description Source Link Shenlong Link
AI-Generated POC Premium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2023-54271

请登录查看更多情报信息。

Patches & Fixes for CVE-2023-54271 (2)

Other References for CVE-2023-54271 (3)

Same Patch Batch · Linux · 2025-12-30 · 244 CVEs total

CVE-2023-54184 9.8 CRITICAL scsi: target: iscsit: Free cmds before session free
CVE-2023-54223 9.8 CRITICAL net/mlx5e: xsk: Fix invalid buffer access for legacy rq
CVE-2023-54237 9.8 CRITICAL net/smc: fix potential panic dues to unprotected smc_llc_srv_add_link()
CVE-2023-54257 9.8 CRITICAL net: macb: fix a memory corruption in extended buffer descriptor mode
CVE-2023-54258 9.8 CRITICAL cifs: fix potential oops in cifs_oplock_break
CVE-2023-54269 9.8 CRITICAL SUNRPC: double free xprt_ctxt while still in use
CVE-2023-54280 9.8 CRITICAL cifs: fix potential race when tree connecting ipc
CVE-2023-54292 9.8 CRITICAL RDMA/irdma: Fix data race on CQP request done
CVE-2023-54203 9.1 CRITICAL ksmbd: fix slab-out-of-bounds in init_smb2_rsp_hdr
CVE-2022-50880 8.8 HIGH wifi: ath10k: add peer map clean up for peer delete in ath10k_sta_state()
CVE-2023-54262 8.8 HIGH net/mlx5e: Don't clone flow post action attributes second time
CVE-2023-54214 8.8 HIGH Bluetooth: L2CAP: Fix potential user-after-free
CVE-2023-54162 8.8 HIGH ksmbd: fix possible memory leak in smb2_lock()
CVE-2023-54318 8.8 HIGH net/smc: use smc_lgr_list.lock to protect smc_lgr_list.list iterate in smcr_port_add
CVE-2023-54250 8.2 HIGH ksmbd: avoid out of bounds access in decode_preauth_ctxt()
CVE-2023-54164 8.0 HIGH Bluetooth: ISO: fix iso_conn related locking and validity issues
CVE-2023-54206 7.8 HIGH net/sched: flower: fix filter idr initialization
CVE-2023-54202 7.8 HIGH drm/i915: fix race condition UAF in i915_perf_add_config_ioctl
CVE-2023-54210 7.8 HIGH Bluetooth: hci_sync: Avoid use-after-free in dbg for hci_remove_adv_monitor()
CVE-2023-54243 7.8 HIGH netfilter: ebtables: fix table blob use-after-free

Showing top 20 of 244 CVEs. View all on vendor page &rarr; →

IV. Related Vulnerabilities

V. Comments for CVE-2023-54271

No comments yet


Leave a comment