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

Goal: 1000 CNY · Raised: 1359 CNY

100%

CVE-2021-47178— scsi: target: core: Avoid smp_processor_id() in preemptible code

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存在安全漏洞,该漏洞源于 scsi target core 中的 smp_processor_id()存在安全问题。

CVSS 7.5 · High EPSS 0.58% · P46

Possible ATT&CK Techniques 1 AI

T1496 · Resource Hijacking

Affected Version Matrix 7

VendorProduct Version RangeStatus
Linux Linux 008b936bbde3e87a611b3828a0d5d2a4f99026a0< a222d2794c53f8165de20aa91b39e35e4b72bce9 affected
1526d9f10c6184031e42afad0adbdde1213e8ad1< a20b6eaf4f35046a429cde57bee7eb5f13d6857f affected
1526d9f10c6184031e42afad0adbdde1213e8ad1< 70ca3c57ff914113f681e657634f7fbfa68e1ad1 affected
5.11 affected
< 5.11 unaffected
5.12.9≤ 5.12.* unaffected
5.13≤ * unaffected
Get alerts for future matching vulnerabilities Log in to subscribe

I. Basic Information for CVE-2021-47178

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
scsi: target: core: Avoid smp_processor_id() in preemptible code
Source: CVE Program / CVE List V5
Vulnerability Description
In the Linux kernel, the following vulnerability has been resolved: scsi: target: core: Avoid smp_processor_id() in preemptible code The BUG message "BUG: using smp_processor_id() in preemptible [00000000] code" was observed for TCMU devices with kernel config DEBUG_PREEMPT. The message was observed when blktests block/005 was run on TCMU devices with fileio backend or user:zbc backend [1]. The commit 1130b499b4a7 ("scsi: target: tcm_loop: Use LIO wq cmd submission helper") triggered the symptom. The commit modified work queue to handle commands and changed 'current->nr_cpu_allowed' at smp_processor_id() call. The message was also observed at system shutdown when TCMU devices were not cleaned up [2]. The function smp_processor_id() was called in SCSI host work queue for abort handling, and triggered the BUG message. This symptom was observed regardless of the commit 1130b499b4a7 ("scsi: target: tcm_loop: Use LIO wq cmd submission helper"). To avoid the preemptible code check at smp_processor_id(), get CPU ID with raw_smp_processor_id() instead. The CPU ID is used for performance improvement then thread move to other CPU will not affect the code. [1] [ 56.468103] run blktests block/005 at 2021-05-12 14:16:38 [ 57.369473] check_preemption_disabled: 85 callbacks suppressed [ 57.369480] BUG: using smp_processor_id() in preemptible [00000000] code: fio/1511 [ 57.369506] BUG: using smp_processor_id() in preemptible [00000000] code: fio/1510 [ 57.369512] BUG: using smp_processor_id() in preemptible [00000000] code: fio/1506 [ 57.369552] caller is __target_init_cmd+0x157/0x170 [target_core_mod] [ 57.369606] CPU: 4 PID: 1506 Comm: fio Not tainted 5.13.0-rc1+ #34 [ 57.369613] Hardware name: System manufacturer System Product Name/PRIME Z270-A, BIOS 1302 03/15/2018 [ 57.369617] Call Trace: [ 57.369621] BUG: using smp_processor_id() in preemptible [00000000] code: fio/1507 [ 57.369628] dump_stack+0x6d/0x89 [ 57.369642] check_preemption_disabled+0xc8/0xd0 [ 57.369628] caller is __target_init_cmd+0x157/0x170 [target_core_mod] [ 57.369655] __target_init_cmd+0x157/0x170 [target_core_mod] [ 57.369695] target_init_cmd+0x76/0x90 [target_core_mod] [ 57.369732] tcm_loop_queuecommand+0x109/0x210 [tcm_loop] [ 57.369744] scsi_queue_rq+0x38e/0xc40 [ 57.369761] __blk_mq_try_issue_directly+0x109/0x1c0 [ 57.369779] blk_mq_try_issue_directly+0x43/0x90 [ 57.369790] blk_mq_submit_bio+0x4e5/0x5d0 [ 57.369812] submit_bio_noacct+0x46e/0x4e0 [ 57.369830] __blkdev_direct_IO_simple+0x1a3/0x2d0 [ 57.369859] ? set_init_blocksize.isra.0+0x60/0x60 [ 57.369880] generic_file_read_iter+0x89/0x160 [ 57.369898] blkdev_read_iter+0x44/0x60 [ 57.369906] new_sync_read+0x102/0x170 [ 57.369929] vfs_read+0xd4/0x160 [ 57.369941] __x64_sys_pread64+0x6e/0xa0 [ 57.369946] ? lockdep_hardirqs_on+0x79/0x100 [ 57.369958] do_syscall_64+0x3a/0x70 [ 57.369965] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 57.369973] RIP: 0033:0x7f7ed4c1399f [ 57.369979] Code: 08 89 3c 24 48 89 4c 24 18 e8 7d f3 ff ff 4c 8b 54 24 18 48 8b 54 24 10 41 89 c0 48 8b 74 24 08 8b 3c 24 b8 11 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 31 44 89 c7 48 89 04 24 e8 cd f3 ff ff 48 8b [ 57.369983] RSP: 002b:00007ffd7918c580 EFLAGS: 00000293 ORIG_RAX: 0000000000000011 [ 57.369990] RAX: ffffffffffffffda RBX: 00000000015b4540 RCX: 00007f7ed4c1399f [ 57.369993] RDX: 0000000000001000 RSI: 00000000015de000 RDI: 0000000000000009 [ 57.369996] RBP: 00000000015b4540 R08: 0000000000000000 R09: 0000000000000001 [ 57.369999] R10: 0000000000e5c000 R11: 0000000000000293 R12: 00007f7eb5269a70 [ 57.370002] R13: 0000000000000000 R14: 0000000000001000 R15: 00000000015b4568 [ 57.370031] CPU: 7 PID: 1507 Comm: fio Not tainted 5.13.0-rc1+ #34 [ 57.370036] Hardware name: System manufacturer System Product Name/PRIME Z270-A, BIOS 1302 03/15/2018 [ 57.370039] Call Trace: [ 57.370045] dump_stack+0x6d/0x89 [ 57.370056] ch ---truncated---
Source: CVE Program / CVE List V5
CVSS Information
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
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存在安全漏洞,该漏洞源于 scsi target core 中的 smp_processor_id()存在安全问题。
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 008b936bbde3e87a611b3828a0d5d2a4f99026a0 ~ a222d2794c53f8165de20aa91b39e35e4b72bce9 -
Linux Linux 5.11 -

II. Public POCs for CVE-2021-47178

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

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2021-47178

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

Other References for CVE-2021-47178 (3)

Same Patch Batch · Linux · 2024-03-25 · 40 CVEs total

CVE-2021-47137 9.8 CRITICAL net: lantiq: fix memory corruption in RX ring
CVE-2021-47168 9.8 CRITICAL NFS: fix an incorrect limit in filelayout_decode_layout()
CVE-2021-47162 9.8 CRITICAL tipc: skb_linearize the head skb when reassembling msgs
CVE-2021-47136 8.6 HIGH net: zero-initialize tc skb extension on allocation
CVE-2021-47160 8.1 HIGH net: dsa: mt7530: fix VLAN traffic leaks
CVE-2021-47142 7.8 HIGH drm/amdgpu: Fix a use-after-free
CVE-2021-47175 7.8 HIGH net/sched: fq_pie: fix OOB access in the traffic path
CVE-2021-47163 7.8 HIGH tipc: wait and exit until all work queues are done
CVE-2021-47159 7.8 HIGH net: dsa: fix a crash if ->get_sset_count() fails
CVE-2021-47158 7.8 HIGH net: dsa: sja1105: add error handling in sja1105_setup()
CVE-2021-47153 7.8 HIGH i2c: i801: Don't generate an interrupt on bus reset
CVE-2021-47152 7.8 HIGH mptcp: fix data stream corruption
CVE-2021-47148 7.8 HIGH octeontx2-pf: fix a buffer overflow in otx2_set_rxfh_context()
CVE-2021-47179 7.5 HIGH NFSv4: Fix a NULL pointer dereference in pnfs_mark_matching_lsegs_return()
CVE-2021-47166 NFS: Don't corrupt the value of pg_bytes_written in nfs_do_recoalesce()
CVE-2021-47180 NFC: nci: fix memory leak in nci_allocate_device
CVE-2021-47177 iommu/vt-d: Fix sysfs leak in alloc_iommu()
CVE-2021-47176 s390/dasd: add missing discipline function
CVE-2021-47141 gve: Add NULL pointer checks when freeing irqs.
CVE-2021-47174 netfilter: nft_set_pipapo_avx2: Add irq_fpu_usable() check, fallback to non-AVX2 version

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

IV. Related Vulnerabilities

V. Comments for CVE-2021-47178

No comments yet


Leave a comment