{"id":"DEBIAN-CVE-2021-47178","details":"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-\u003enr_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 \u003c48\u003e 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---","modified":"2025-12-22T07:49:26.233900Z","published":"2024-03-25T10:15:09.267Z","withdrawn":"2025-12-22T07:49:26.233900Z","upstream":["CVE-2021-47178"],"references":[{"type":"ADVISORY","url":"https://security-tracker.debian.org/tracker/CVE-2021-47178"}],"affected":[{"package":{"name":"linux","ecosystem":"Debian:11","purl":"pkg:deb/debian/linux?arch=source"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["5.10.103-1","5.10.103-1~bpo10+1","5.10.106-1","5.10.113-1","5.10.120-1","5.10.120-1~bpo10+1","5.10.127-1","5.10.127-2","5.10.127-2~bpo10+1","5.10.136-1","5.10.140-1","5.10.148-1","5.10.149-1","5.10.149-2","5.10.158-1","5.10.158-2","5.10.162-1","5.10.178-1","5.10.178-2","5.10.178-3","5.10.179-1","5.10.179-2","5.10.179-3","5.10.179-4","5.10.179-5","5.10.191-1","5.10.197-1","5.10.205-1","5.10.205-2","5.10.209-1","5.10.209-2","5.10.216-1","5.10.218-1","5.10.221-1","5.10.223-1","5.10.226-1","5.10.234-1","5.10.237-1","5.10.244-1","5.10.46-4","5.10.46-5","5.10.70-1","5.10.70-1~bpo10+1","5.10.84-1","5.10.92-1","5.10.92-1~bpo10+1","5.10.92-2","5.13.12-1~exp1","5.13.9-1~exp1","5.13.9-1~exp2","5.14-1~exp1","5.14-1~exp2","5.14.1-1~exp1","5.14.12-1","5.14.16-1","5.14.2-1~exp1","5.14.3-1~exp1","5.14.6-1","5.14.6-2","5.14.6-3","5.14.9-1","5.14.9-2","5.14.9-2~bpo11+1","5.15-1~exp1","5.15.1-1~exp1","5.15.15-1","5.15.15-2","5.15.15-2~bpo11+1","5.15.2-1~exp1","5.15.3-1","5.15.5-1","5.15.5-2","5.15.5-2~bpo11+1","5.16.10-1","5.16.11-1","5.16.11-1~bpo11+1","5.16.12-1","5.16.12-1~bpo11+1","5.16.14-1","5.16.18-1","5.16.3-1~exp1","5.16.4-1~exp1","5.16.7-1","5.16.7-2","5.16~rc1-1~exp1","5.16~rc3-1~exp1","5.16~rc4-1~exp1","5.16~rc5-1~exp1","5.16~rc6-1~exp1","5.16~rc7-1~exp1","5.16~rc8-1~exp1","5.17.1-1~exp1","5.17.11-1","5.17.3-1","5.17.6-1","5.17~rc3-1~exp1","5.17~rc4-1~exp1","5.17~rc5-1~exp1","5.17~rc6-1~exp1","5.17~rc7-1~exp1","5.17~rc8-1~exp1","5.18-1~exp1","5.18.14-1","5.18.14-1~bpo11+1","5.18.16-1","5.18.16-1~bpo11+1","5.18.2-1","5.18.2-1~bpo11+1","5.18.5-1","5.19-1~exp1","5.19.11-1","5.19.11-1~bpo11+1","5.19.6-1","5.19~rc4-1~exp1","5.19~rc6-1~exp1","6.0-1~exp1","6.0.10-1","6.0.10-2","6.0.12-1","6.0.12-1+alpha","6.0.12-1~bpo11+1","6.0.2-1","6.0.3-1","6.0.3-1~bpo11+1","6.0.5-1","6.0.6-1","6.0.6-2","6.0.7-1","6.0.8-1","6.0~rc7-1~exp1","6.1.1-1~exp1","6.1.1-1~exp2","6.1.106-1","6.1.106-2","6.1.106-3","6.1.11-1","6.1.112-1","6.1.115-1","6.1.119-1","6.1.12-1","6.1.12-1~bpo11+1","6.1.123-1","6.1.124-1","6.1.128-1","6.1.129-1","6.1.133-1","6.1.135-1","6.1.137-1","6.1.139-1","6.1.140-1","6.1.147-1","6.1.148-1","6.1.15-1","6.1.15-1~bpo11+1","6.1.153-1","6.1.158-1","6.1.2-1~exp1","6.1.20-1","6.1.20-1~bpo11+1","6.1.20-2","6.1.20-2~bpo11+1","6.1.25-1","6.1.27-1","6.1.27-1~bpo11+1","6.1.37-1","6.1.38-1","6.1.38-2","6.1.38-2~bpo11+1","6.1.38-3","6.1.38-4","6.1.38-4~bpo11+1","6.1.4-1","6.1.52-1","6.1.55-1","6.1.55-1~bpo11+1","6.1.64-1","6.1.66-1","6.1.67-1","6.1.69-1","6.1.69-1~bpo11+1","6.1.7-1","6.1.76-1","6.1.76-1~bpo11+1","6.1.8-1","6.1.8-1+sh4","6.1.82-1","6.1.85-1","6.1.90-1","6.1.90-1~bpo11+1","6.1.94-1","6.1.94-1~bpo11+1","6.1.98-1","6.1.99-1","6.10-1~exp1","6.10.1-1~exp1","6.10.11-1","6.10.11-1~bpo12+1","6.10.12-1","6.10.3-1","6.10.4-1","6.10.6-1","6.10.6-1~bpo12+1","6.10.7-1","6.10.9-1","6.11-1~exp1","6.11.10-1","6.11.10-1~bpo12+1","6.11.2-1","6.11.4-1","6.11.5-1","6.11.5-1~bpo12+1","6.11.6-1","6.11.7-1","6.11.9-1","6.11~rc4-1~exp1","6.11~rc5-1~exp1","6.12.10-1","6.12.11-1","6.12.11-1+alpha","6.12.11-1+alpha.1","6.12.12-1","6.12.12-1~bpo12+1","6.12.13-1","6.12.15-1","6.12.16-1","6.12.17-1","6.12.19-1","6.12.20-1","6.12.21-1","6.12.22-1","6.12.22-1~bpo12+1","6.12.25-1","6.12.27-1","6.12.27-1~bpo12+1","6.12.29-1","6.12.3-1","6.12.30-1","6.12.30-1~bpo12+1","6.12.31-1","6.12.32-1","6.12.32-1~bpo12+1","6.12.33-1","6.12.33-1~bpo12+1","6.12.35-1","6.12.35-1~bpo12+1","6.12.37-1","6.12.38-1","6.12.38-1~bpo12+1","6.12.41-1","6.12.43-1","6.12.43-1~bpo12+1","6.12.48-1","6.12.5-1","6.12.57-1","6.12.57-1~bpo12+1","6.12.6-1","6.12.8-1","6.12.9-1","6.12.9-1+alpha","6.12.9-1~bpo12+1","6.12~rc6-1~exp1","6.13.10-1~exp1","6.13.11-1~exp1","6.13.2-1~exp1","6.13.3-1~exp1","6.13.4-1~exp1","6.13.5-1~exp1","6.13.6-1~exp1","6.13.7-1~exp1","6.13.8-1~exp1","6.13.9-1~exp1","6.13~rc6-1~exp1","6.13~rc7-1~exp1","6.14.3-1~exp1","6.14.5-1~exp1","6.14.6-1~exp1","6.15-1~exp1","6.15.1-1~exp1","6.15.2-1~exp1","6.15.3-1~exp1","6.15.4-1~exp1","6.15.5-1~exp1","6.15.6-1~exp1","6.15~rc7-1~exp1","6.16-1~exp1","6.16.1-1~exp1","6.16.10-1","6.16.11-1","6.16.12-1","6.16.12-2","6.16.3-1","6.16.3-1~bpo13+1","6.16.5-1","6.16.6-1","6.16.7-1","6.16.8-1","6.16.9-1","6.16~rc7-1~exp1","6.17.2-1~exp1","6.17.5-1~exp1","6.17.6-1","6.17.7-1","6.17.7-2","6.17.8-1","6.18~rc4-1~exp1","6.18~rc4-1~exp2","6.18~rc5-1~exp1","6.18~rc6-1~exp1","6.1~rc3-1~exp1","6.1~rc5-1~exp1","6.1~rc6-1~exp1","6.1~rc7-1~exp1","6.1~rc8-1~exp1","6.3.1-1~exp1","6.3.11-1","6.3.2-1~exp1","6.3.4-1~exp1","6.3.5-1~exp1","6.3.7-1","6.3.7-1~bpo12+1","6.4.1-1~exp1","6.4.11-1","6.4.13-1","6.4.4-1","6.4.4-1~bpo12+1","6.4.4-2","6.4.4-3","6.4.4-3~bpo12+1","6.4~rc6-1~exp1","6.4~rc7-1~exp1","6.5.1-1~exp1","6.5.10-1","6.5.10-1~bpo12+1","6.5.13-1","6.5.3-1","6.5.3-1~bpo12+1","6.5.6-1","6.5.8-1","6.5~rc4-1~exp1","6.5~rc6-1~exp1","6.5~rc7-1~exp1","6.6.11-1","6.6.13-1","6.6.13-1~bpo12+1","6.6.15-1","6.6.15-2","6.6.3-1~exp1","6.6.4-1~exp1","6.6.7-1~exp1","6.6.8-1","6.6.9-1","6.7-1~exp1","6.7.1-1~exp1","6.7.12-1","6.7.12-1~bpo12+1","6.7.4-1~exp1","6.7.7-1","6.7.9-1","6.7.9-2","6.8.11-1","6.8.12-1","6.8.12-1~bpo12+1","6.8.9-1","6.9.10-1","6.9.10-1~bpo12+1","6.9.11-1","6.9.12-1","6.9.2-1~exp1","6.9.7-1","6.9.7-1~bpo12+1","6.9.8-1","6.9.9-1"],"ecosystem_specific":{"urgency":"not yet assigned"},"database_specific":{"source":"https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2021-47178.json"}},{"package":{"name":"linux","ecosystem":"Debian:12","purl":"pkg:deb/debian/linux?arch=source"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.14.6-1"}]}],"ecosystem_specific":{"urgency":"not yet assigned"},"database_specific":{"source":"https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2021-47178.json"}},{"package":{"name":"linux","ecosystem":"Debian:13","purl":"pkg:deb/debian/linux?arch=source"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.14.6-1"}]}],"ecosystem_specific":{"urgency":"not yet assigned"},"database_specific":{"source":"https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2021-47178.json"}},{"package":{"name":"linux","ecosystem":"Debian:14","purl":"pkg:deb/debian/linux?arch=source"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.14.6-1"}]}],"ecosystem_specific":{"urgency":"not yet assigned"},"database_specific":{"source":"https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2021-47178.json"}}],"schema_version":"1.7.3","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"}]}