IPBUF安全漏洞报告
English
CVE-2023-53661 CVSS 5.5 中危

CVE-2023-53661 Linux内核bnxt驱动整数溢出漏洞

披露日期: 2025-10-07
来源: 416baaa9-dc9f-4396-8d5f-8c081fb06d67

漏洞信息

漏洞编号
CVE-2023-53661
漏洞类型
整数溢出
CVSS评分
5.5 中危
攻击向量
本地 (AV:L)
认证要求
低权限 (PR:L)
用户交互
无需交互 (UI:N)
影响产品
Linux Kernel (bnxt网络驱动)

相关标签

整数溢出Linux KernelbnxtBroadcom NetXtreme本地提权拒绝服务内核漏洞SVACE网络驱动NVRAM

漏洞概述

CVE-2023-53661是Linux内核中Broadcom NetXtreme(bnxt)网络驱动程序的一个整数溢出漏洞。该漏洞存在于bnxt_get_nvram_directory()函数中,由于在执行算术运算(乘法运算)之前未能将操作数强制转换为更大的数据类型,导致算术表达式的值可能出现溢出。

该漏洞由Security Code and Linux Verification Center(linuxtesting.org)使用SVACE静态分析工具发现。漏洞的CVSS 3.1评分为5.5分,属于中等严重级别。攻击者需要本地低权限访问权限即可触发该漏洞,无需用户交互。漏洞的成功利用不会导致机密性泄露或完整性破坏,但会导致系统可用性受到严重影响,可能造成内核崩溃或系统不稳定。

bnxt驱动程序广泛用于支持Broadcom NetXtreme系列网卡,包括各种企业级服务器和数据中心环境中常见的BCM57xxx、BCM574xx等系列网络控制器。由于Linux内核广泛应用于服务器、桌面和嵌入式系统,该漏洞的影响范围较广。

该漏洞已在Linux内核的多个稳定版本中通过提交17e0453a7523ad7a25bb47af941b150a6c66d7b6、7c6dddc239abe660598c49ec95ea0ed6399a4b2a、d5eaf2a6b077f32a477feb1e9e1c1f60605b460e和efb1a257513438d43f4335f09b2f684e8167cad2进行了修复,主要通过使用安全的乘法宏替代直接的乘法运算符来避免溢出问题。

技术细节

该漏洞的技术原理在于bnxt_get_nvram_directory()函数中存在的整数溢出问题。在C语言中,当两个较小的整数类型(如int或unsigned int)相乘时,结果仍然存储在相同类型的变量中,如果乘积超过该类型能表示的最大值,就会发生整数溢出,导致结果被截断为一个意外的小值或负值。

在bnxt_get_nvram_directory()函数中,开发者在计算NVRAM目录相关参数时使用了直接的乘法运算符(*),而不是使用Linux内核提供的安全乘法宏(如check_mul_overflow()或mul_u32_u32()等)。当传入的目录大小或偏移量参数经过乘法运算后,如果结果超出了变量类型的表示范围,就会发生溢出。

利用方式方面,攻击者可以通过以下步骤触发该漏洞:
1. 拥有本地系统的低权限访问权限
2. 通过ioctl或其他驱动程序接口与bnxt网卡驱动交互
3. 精心构造调用bnxt_get_nvram_directory()函数时的参数
4. 触发整数溢出后,可能导致缓冲区分配过小或数组越界访问
5. 最终导致内核崩溃(kernel panic)或系统不稳定

修复方案是将直接乘法运算符替换为Linux内核提供的安全乘法检查宏,这些宏在编译时或运行时检测溢出并返回错误,从而防止溢出导致的未定义行为。

攻击链分析

STEP 1
步骤1:获取本地访问
攻击者需要获得目标系统的本地低权限访问权限,可以通过获取普通用户账户、利用其他漏洞等方式实现。
STEP 2
步骤2:识别bnxt网卡
确认目标系统使用Broadcom NetXtreme网卡,通过lspci或查看/sys/class/net/等接口确认bnxt驱动已加载。
STEP 3
步骤3:构造溢出参数
分析bnxt_get_nvram_directory()函数的调用路径,构造能触发整数溢出的参数组合,使乘法运算结果超出变量类型范围。
STEP 4
步骤4:触发漏洞
通过ioctl系统调用或其他驱动接口调用bnxt_get_nvram_directory()函数,传入精心构造的参数触发整数溢出。
STEP 5
步骤5:导致系统不可用
整数溢出可能导致缓冲区分配过小、数组越界访问等后果,最终导致内核崩溃(kernel panic)或系统不稳定,造成拒绝服务。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
/* CVE-2023-53661 - Linux Kernel bnxt Integer Overflow PoC * This PoC demonstrates the integer overflow vulnerability in * bnxt_get_nvram_directory() function. * * Note: This vulnerability requires local access with low privileges * and interaction with the bnxt network driver. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <fcntl.h> #include <unistd.h> #include <sys/ioctl.h> #include <errno.h> /* Simulate the vulnerable code pattern */ #define BNXT_DIR_ENTRIES_PER_PAGE 128 #define BNXT_MAX_NVRAM_SIZE 0xFFFFFFFF /* Vulnerable function - mimics bnxt_get_nvram_directory() */ static int bnxt_get_nvram_directory_vulnerable(unsigned int dir_size, unsigned int entry_size, unsigned int *num_entries) { /* Integer overflow occurs here when dir_size * entry_size overflows */ unsigned int total_size = dir_size * entry_size; if (total_size > BNXT_MAX_NVRAM_SIZE) { return -EINVAL; } *num_entries = total_size / entry_size; return 0; } /* Fixed function using safe multiplication */ static int bnxt_get_nvram_directory_fixed(unsigned int dir_size, unsigned int entry_size, unsigned int *num_entries) { unsigned int total_size; /* Use safe multiplication macro to check for overflow */ if (__builtin_mul_overflow(dir_size, entry_size, &total_size)) { return -EOVERFLOW; } if (total_size > BNXT_MAX_NVRAM_SIZE) { return -EINVAL; } *num_entries = total_size / entry_size; return 0; } int main(int argc, char *argv[]) { unsigned int dir_size = 0x10000; unsigned int entry_size = 0x10000; unsigned int num_entries = 0; int ret; printf("[*] CVE-2023-53661 PoC - bnxt Integer Overflow\n"); printf("[*] Testing vulnerable function with dir_size=0x%x, entry_size=0x%x\n", dir_size, entry_size); /* Trigger the overflow: 0x10000 * 0x10000 = 0x100000000 (overflows to 0 for 32-bit) */ ret = bnxt_get_nvram_directory_vulnerable(dir_size, entry_size, &num_entries); printf("[*] Vulnerable result: ret=%d, num_entries=%u\n", ret, num_entries); /* Test the fixed version */ ret = bnxt_get_nvram_directory_fixed(dir_size, entry_size, &num_entries); printf("[*] Fixed result: ret=%d, num_entries=%u\n", ret, num_entries); printf("[*] In real scenario, this would trigger kernel panic via ioctl to bnxt driver\n"); printf("[*] Example: ioctl(fd, BNXT_GET_NVRAM_DIR, &dir_params)\n"); return 0; }

影响范围

Linux Kernel < 6.6 (受影响版本)
Linux Kernel 6.6.x (受影响版本)
Linux Kernel 6.1.x LTS (受影响版本)
Linux Kernel 5.15.x LTS (受影响版本)
Linux Kernel 5.10.x LTS (受影响版本)

防御指南

临时缓解措施
在无法立即升级内核的情况下,可以采取以下临时缓解措施:1)如果系统不使用Broadcom NetXtreme网卡,可以通过在/etc/modprobe.d/blacklist.conf中添加'blacklist bnxt'来禁用bnxt驱动模块;2)限制普通用户对/dev/net/*等网络设备文件的访问权限;3)监控系统日志,关注与bnxt驱动相关的异常信息;4)使用SELinux或AppArmor等强制访问控制机制限制对网络驱动接口的访问;5)及时关注Linux内核安全公告,在补丁可用后尽快应用。

参考链接

快速导航: 前沿安全 最新收录域名列表 最新威胁情报列表 最新网站排名列表 最新工具资源列表 最新CVE漏洞列表