一、漏洞信息
漏洞编号:[CVE-2021-46984](https://nvd.nist.gov/vuln/detail/CVE-2021-46984)
漏洞归属组件:[kernel](https://gitee.com/src-openeuler/kernel)
漏洞归属的版本:4.19.140,4.19.194,4.19.90,5.10.0,6.1.0,6.1.14,6.1.19,6.1.5,6.1.6,6.1.8,6.4.0
CVSS V2.0分值:
BaseScore:0.0 Low
Vector:CVSS:2.0/
漏洞简述:
In the Linux kernel, the following vulnerability has been resolved:kyber: fix out of bounds access when preempted__blk_mq_sched_bio_merge() gets the ctx and hctx for the current CPU andpasses the hctx to ->bio_merge(). kyber_bio_merge() then gets the ctxfor the current CPU again and uses that to get the corresponding Kybercontext in the passed hctx. However, the thread may be preempted betweenthe two calls to blk_mq_get_ctx(), and the ctx returned the second timemay no longer correspond to the passed hctx. This works accidentallymost of the time, but it can cause us to read garbage if the second ctxcame from an hctx with more ctx s than the first one (i.e., ifctx->index_hw[hctx->type] > hctx->nr_ctx).This manifested as this UBSAN array index out of bounds error reportedby Jakub:UBSAN: array-index-out-of-bounds in ../kernel/locking/qspinlock.c:130:9index 13106 is out of range for type long unsigned int [128] Call Trace: dump_stack+0xa4/0xe5 ubsan_epilogue+0x5/0x40 __ubsan_handle_out_of_bounds.cold.13+0x2a/0x34 queued_spin_lock_slowpath+0x476/0x480 do_raw_spin_lock+0x1c2/0x1d0 kyber_bio_merge+0x112/0x180 blk_mq_submit_bio+0x1f5/0x1100 submit_bio_noacct+0x7b0/0x870 submit_bio+0xc2/0x3a0 btrfs_map_bio+0x4f0/0x9d0 btrfs_submit_data_bio+0x24e/0x310 submit_one_bio+0x7f/0xb0 submit_extent_page+0xc4/0x440 __extent_writepage_io+0x2b8/0x5e0 __extent_writepage+0x28d/0x6e0 extent_write_cache_pages+0x4d7/0x7a0 extent_writepages+0xa2/0x110 do_writepages+0x8f/0x180 __writeback_single_inode+0x99/0x7f0 writeback_sb_inodes+0x34e/0x790 __writeback_inodes_wb+0x9e/0x120 wb_writeback+0x4d2/0x660 wb_workfn+0x64d/0xa10 process_one_work+0x53a/0xa80 worker_thread+0x69/0x5b0 kthread+0x20b/0x240 ret_from_fork+0x1f/0x30Only Kyber uses the hctx, so fix it by passing the request_queue to->bio_merge() instead. BFQ and mq-deadline just use that, and Kyber canmap the queues itself to avoid the mismatch.
漏洞公开时间:2024-02-28 17:15:37
漏洞创建时间:2024-03-06 16:46:25
漏洞详情参考链接:
https://nvd.nist.gov/vuln/detail/CVE-2021-46984
<details>
<summary>更多参考(点击展开)</summary>
| 参考来源 | 参考链接 | 来源链接 |
| ------- | -------- | -------- |
| 416baaa9-dc9f-4396-8d5f-8c081fb06d67 | https://git.kernel.org/stable/c/0b6b4b90b74c27bea968c214d820ba4254b903a5 | |
| 416baaa9-dc9f-4396-8d5f-8c081fb06d67 | https://git.kernel.org/stable/c/2ef3c76540c49167a0bc3d5f80d00fd1fc4586df | |
| 416baaa9-dc9f-4396-8d5f-8c081fb06d67 | https://git.kernel.org/stable/c/54dbe2d2c1fcabf650c7a8b747601da355cd7f9f | |
| 416baaa9-dc9f-4396-8d5f-8c081fb06d67 | https://git.kernel.org/stable/c/a287cd84e047045f5a4d4da793414e848de627c6 | |
| 416baaa9-dc9f-4396-8d5f-8c081fb06d67 | https://git.kernel.org/stable/c/efed9a3337e341bd0989161b97453b52567bc59d | |
| suse_bugzilla | http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-46984 | https://bugzilla.suse.com/show_bug.cgi?id=1220631 |
| suse_bugzilla | https://git.kernel.org/stable/c/efed9a3337e341bd0989161b97453b52567bc59d | https://bugzilla.suse.com/show_bug.cgi?id=1220631 |
| suse_bugzilla | https://www.cve.org/CVERecord?id=CVE-2021-46984 | https://bugzilla.suse.com/show_bug.cgi?id=1220631 |
| suse_bugzilla | https://git.kernel.org/stable/c/0b6b4b90b74c27bea968c214d820ba4254b903a5 | https://bugzilla.suse.com/show_bug.cgi?id=1220631 |
| suse_bugzilla | https://git.kernel.org/stable/c/2ef3c76540c49167a0bc3d5f80d00fd1fc4586df | https://bugzilla.suse.com/show_bug.cgi?id=1220631 |
| suse_bugzilla | https://git.kernel.org/stable/c/54dbe2d2c1fcabf650c7a8b747601da355cd7f9f | https://bugzilla.suse.com/show_bug.cgi?id=1220631 |
| suse_bugzilla | https://git.kernel.org/stable/c/a287cd84e047045f5a4d4da793414e848de627c6 | https://bugzilla.suse.com/show_bug.cgi?id=1220631 |
| suse_bugzilla | https://bugzilla.redhat.com/show_bug.cgi?id=2266750 | https://bugzilla.suse.com/show_bug.cgi?id=1220631 |
| redhat_bugzilla | https://lore.kernel.org/linux-cve-announce/2024022824-CVE-2021-46984-e55e@gregkh/T/#u | https://bugzilla.redhat.com/show_bug.cgi?id=2266750 |
| ubuntu | https://git.kernel.org/linus/efed9a3337e341bd0989161b97453b52567bc59d (5.13-rc2) | https://ubuntu.com/security/CVE-2021-46984 |
| ubuntu | https://git.kernel.org/stable/c/0b6b4b90b74c27bea968c214d820ba4254b903a5 | https://ubuntu.com/security/CVE-2021-46984 |
| ubuntu | https://git.kernel.org/stable/c/54dbe2d2c1fcabf650c7a8b747601da355cd7f9f | https://ubuntu.com/security/CVE-2021-46984 |
| ubuntu | https://git.kernel.org/stable/c/a287cd84e047045f5a4d4da793414e848de627c6 | https://ubuntu.com/security/CVE-2021-46984 |
| ubuntu | https://git.kernel.org/stable/c/2ef3c76540c49167a0bc3d5f80d00fd1fc4586df | https://ubuntu.com/security/CVE-2021-46984 |
| ubuntu | https://git.kernel.org/stable/c/efed9a3337e341bd0989161b97453b52567bc59d | https://ubuntu.com/security/CVE-2021-46984 |
| ubuntu | https://www.cve.org/CVERecord?id=CVE-2021-46984 | https://ubuntu.com/security/CVE-2021-46984 |
| ubuntu | https://nvd.nist.gov/vuln/detail/CVE-2021-46984 | https://ubuntu.com/security/CVE-2021-46984 |
| ubuntu | https://launchpad.net/bugs/cve/CVE-2021-46984 | https://ubuntu.com/security/CVE-2021-46984 |
| ubuntu | https://security-tracker.debian.org/tracker/CVE-2021-46984 | https://ubuntu.com/security/CVE-2021-46984 |
| cve_search | | https://git.kernel.org/stable/c/0b6b4b90b74c27bea968c214d820ba4254b903a5 |
| cve_search | | https://git.kernel.org/stable/c/54dbe2d2c1fcabf650c7a8b747601da355cd7f9f |
| cve_search | | https://git.kernel.org/stable/c/a287cd84e047045f5a4d4da793414e848de627c6 |
| cve_search | | https://git.kernel.org/stable/c/2ef3c76540c49167a0bc3d5f80d00fd1fc4586df |
| cve_search | | https://git.kernel.org/stable/c/efed9a3337e341bd0989161b97453b52567bc59d |
| ubuntu | https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-46984 | https://ubuntu.com/security/CVE-2021-46984 |
</details>
漏洞分析指导链接:
https://gitee.com/openeuler/cve-manager/blob/master/cve-vulner-manager/doc/md/manual.md
漏洞数据来源:
openBrain开源漏洞感知系统
漏洞补丁信息:
<details>
<summary>详情(点击展开)</summary>
| 影响的包 | 修复版本 | 修复补丁 | 问题引入补丁 | 来源 |
| ------- | -------- | ------- | -------- | --------- |
| linux | | https://git.kernel.org/linus/efed9a3337e341bd0989161b97453b52567bc59d | https://git.kernel.org/linus/a6088845c2bf754d6cb2572b484180680b037804 | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:kyber: fix out of bounds access when preempted__blk_mq_sched_bio_merge() gets the ctx and hctx for the current CPU andpasses the hctx to ->bio_merge(). kyber_bio_merge() then gets the ctxfor the current CPU again and uses that to get the corresponding Kybercontext in the passed hctx. However, the thread may be preempted betweenthe two calls to blk_mq_get_ctx(), and the ctx returned the second timemay no longer correspond to the passed hctx. This works accidentallymost of the time, but it can cause us to read garbage if the second ctxcame from an hctx with more ctx s than the first one (i.e., ifctx->index_hw[hctx->type] > hctx->nr_ctx).This manifested as this UBSAN array index out of bounds error reportedby Jakub:UBSAN: array-index-out-of-bounds in ../kernel/locking/qspinlock.c:130:9index 13106 is out of range for type long unsigned int [128] Call Trace: dump_stack+0xa4/0xe5 ubsan_epilogue+0x5/0x40 __ubsan_handle_out_of_bounds.cold.13+0x2a/0x34 queued_spin_lock_slowpath+0x476/0x480 do_raw_spin_lock+0x1c2/0x1d0 kyber_bio_merge+0x112/0x180 blk_mq_submit_bio+0x1f5/0x1100 submit_bio_noacct+0x7b0/0x870 submit_bio+0xc2/0x3a0 btrfs_map_bio+0x4f0/0x9d0 btrfs_submit_data_bio+0x24e/0x310 submit_one_bio+0x7f/0xb0 submit_extent_page+0xc4/0x440 __extent_writepage_io+0x2b8/0x5e0 __extent_writepage+0x28d/0x6e0 extent_write_cache_pages+0x4d7/0x7a0 extent_writepages+0xa2/0x110 do_writepages+0x8f/0x180 __writeback_single_inode+0x99/0x7f0 writeback_sb_inodes+0x34e/0x790 __writeback_inodes_wb+0x9e/0x120 wb_writeback+0x4d2/0x660 wb_workfn+0x64d/0xa10 process_one_work+0x53a/0xa80 worker_thread+0x69/0x5b0 kthread+0x20b/0x240 ret_from_fork+0x1f/0x30Only Kyber uses the hctx, so fix it by passing the request_queue to->bio_merge() instead. BFQ and mq-deadline just use that, and Kyber canmap the queues itself to avoid the mismatch.
openEuler评分:
6.0
Vector:CVSS:2.0/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:H
受影响版本排查(受影响/不受影响):
1.openEuler-20.03-LTS-SP1(4.19.90):受影响
2.openEuler-20.03-LTS-SP4(4.19.90):受影响
3.openEuler-22.03-LTS(5.10.0):不受影响
4.openEuler-22.03-LTS-SP1(5.10.0):不受影响
5.openEuler-22.03-LTS-SP2(5.10.0):不受影响
6.openEuler-22.03-LTS-SP3(5.10.0):不受影响
7.master(6.1.0):不受影响
8.openEuler-22.03-LTS-Next(5.10.0):不受影响
9.openEuler-24.03-LTS:不受影响
10.openEuler-24.03-LTS-Next:不受影响
修复是否涉及abi变化(是/否):
1.openEuler-20.03-LTS-SP1(4.19.90):否
2.openEuler-20.03-LTS-SP4(4.19.90):否
3.openEuler-22.03-LTS(5.10.0):否
4.openEuler-22.03-LTS-SP1(5.10.0):否
5.openEuler-22.03-LTS-SP2(5.10.0):否
6.openEuler-22.03-LTS-SP3(5.10.0):否
7.master(6.1.0):否
8.openEuler-22.03-LTS-Next(5.10.0):否
9.openEuler-24.03-LTS:否
10.openEuler-24.03-LTS-Next:否
三、漏洞修复
安全公告链接:https://www.openeuler.org/zh/security/safety-bulletin/detail/?id=openEuler-SA-2024-1484