一、 漏洞 CVE-2021-47044 基础信息
漏洞标题
sched/fair:修复load_balance()中的shift越界问题。
来源:AIGC 神龙大模型
漏洞描述信息
在Linux内核中,以下漏洞已得到解决: ``` sched/fair: Fix shift-out-of-bounds in load_balance() ``` Syzbot报告了一些实例,其中sd->nr_balance_failed的值可能会增长到远远超出预期的数值。 成功的load_balance()会将其重置为0;失败则会增加它。一旦它达到sd->cache_nice_tries + 3,这应该触发一个主动平衡,要么将它设置为sd->cache_nice_tries+1,要么将其重置回0。然而,在某些情况下,即将进行主动平衡的任务不允许在env->dst_cpu上运行,那么增加操作就会在没有任何进一步修改的情况下完成。 这种情况可能会反复发生,从而解释了Syzbot报告的荒谬高水平值(例如86、149)。VincentG指出,让sd->cache_nice_tries增长是有价值的,因此移位本身应该得到修复。这意味着需要阻止以下情况: ``` 如果右操作数的值为负或大于等于左提升操作数宽度,则行为未定义。 ``` 因此,我们需要将移位指数限制在typeof(lefthand))类型的比特数减1。 我通过coccinelle搜索了内核/sched中其他类似的情况: ```python @expr@ position pos; expression E1; expression E2; @@ ( E1 >> E2@pos | E1 >> E2@pos ) @cst depends on expr@ position pos; expression expr.E1; constant cst; @@ ( E1 >> cst@pos | E1 << cst@pos ) ``` 在内核/sched中,唯一的其他匹配是rq_clock_thermal()函数,它使用了sched_thermal_decay_shift,而该指数已经被限制为10,所以那个就没事了。
来源:AIGC 神龙大模型
CVSS信息
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N
来源:AIGC 神龙大模型
漏洞类别
跨界内存读
来源:AIGC 神龙大模型
漏洞标题
sched/fair: Fix shift-out-of-bounds in load_balance()
来源:美国国家漏洞数据库 NVD
漏洞描述信息
In the Linux kernel, the following vulnerability has been resolved: sched/fair: Fix shift-out-of-bounds in load_balance() Syzbot reported a handful of occurrences where an sd->nr_balance_failed can grow to much higher values than one would expect. A successful load_balance() resets it to 0; a failed one increments it. Once it gets to sd->cache_nice_tries + 3, this *should* trigger an active balance, which will either set it to sd->cache_nice_tries+1 or reset it to 0. However, in case the to-be-active-balanced task is not allowed to run on env->dst_cpu, then the increment is done without any further modification. This could then be repeated ad nauseam, and would explain the absurdly high values reported by syzbot (86, 149). VincentG noted there is value in letting sd->cache_nice_tries grow, so the shift itself should be fixed. That means preventing: """ If the value of the right operand is negative or is greater than or equal to the width of the promoted left operand, the behavior is undefined. """ Thus we need to cap the shift exponent to BITS_PER_TYPE(typeof(lefthand)) - 1. I had a look around for other similar cases via coccinelle: @expr@ position pos; expression E1; expression E2; @@ ( E1 >> E2@pos | E1 >> E2@pos ) @cst depends on expr@ position pos; expression expr.E1; constant cst; @@ ( E1 >> cst@pos | E1 << cst@pos ) @script:python depends on !cst@ pos << expr.pos; exp << expr.E2; @@ # Dirty hack to ignore constexpr if exp.upper() != exp: coccilib.report.print_report(pos[0], "Possible UB shift here") The only other match in kernel/sched is rq_clock_thermal() which employs sched_thermal_decay_shift, and that exponent is already capped to 10, so that one is fine.
来源:美国国家漏洞数据库 NVD
CVSS信息
N/A
来源:美国国家漏洞数据库 NVD
漏洞类别
N/A
来源:美国国家漏洞数据库 NVD
漏洞标题
Linux kernel 安全漏洞
来源:中国国家信息安全漏洞库 CNNVD
漏洞描述信息
Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel 存在安全漏洞,该漏洞源于 load_balance() 方法中存在移位越界问题。
来源:中国国家信息安全漏洞库 CNNVD
CVSS信息
N/A
来源:中国国家信息安全漏洞库 CNNVD
漏洞类别
其他
来源:中国国家信息安全漏洞库 CNNVD
二、漏洞 CVE-2021-47044 的公开POC
# POC 描述 源链接 神龙链接
三、漏洞 CVE-2021-47044 的情报信息