arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.10290cs.CRcs.SE
收藏

Linux IOCTL 普查:基于源码的 Linux 内核控制码表面数据库

The Linux IOCTL Census: A Source-Derived Database of the Linux Kernel Control-Code Surface

Michael J. Bommarito

AI总结:

通过静态分析构建 Linux 内核 ioctl 接口的可查询清单,覆盖 878 个模块、586 个分发入口点及 1289 个命令码,并编码威胁模型以区分权限门控区域,支持跨操作系统查询。

摘要:

ioctl 系统调用是 Linux 的全功能设备控制接口。用户空间程序打开设备节点并向驱动程序传递一个数字命令码和一个参数缓冲区,驱动程序执行该命令码对应的操作,无论是配置硬件、读取状态,还是在内核与用户空间之间移动数据。驱动程序自行定义这些命令,数量成千上万,并在内核上下文中解析其参数,这使得 ioctl 处理程序成为内核中最广泛且最不统一的局部攻击面之一。一个信任未经验证参数长度的处理程序可能导致越界读写内核内存,而命令空间没有集中编目。我们提出了 Linux IOCTL Census,这是一个基于源码且可查询的攻击面清单。一次 allmodconfig 构建会编译 169 个子树中的 878 个模块,通过一次确定的 libclang 遍历内核源码,我们恢复了 586 个 ioctl 分发入口点、1289 个解码的 _IOC 命令码、3583 个受控输入接收点以及 1298 个权限门。第二次遍历将内核自身文档化的威胁模型编码为可查询的列,将无能力门控的 ioctl 表面(非特权可达的上界,而非已证明的可达性)与硬能力门控排除的部分区分开。我们使用 22 个近期内核树内 ioctl CVE 对普查结果进行回溯测试,并以开放数据形式发布结构层,采用与配套的 Windows IOCTL Census 共享的模式,以便单个查询可跨越两个操作系统。

英文摘要:

The ioctl system call is Linux's catch-all device-control interface. A userspace program opens a device node and hands the driver a numeric command code and an argument buffer, and the driver does whatever that code means, whether configuring hardware, reading back state, or moving data into and out of the kernel. Drivers define these commands themselves, by the thousand, and parse their arguments in kernel context, which makes ioctl handlers one of the broadest and least uniform local attack surfaces in the kernel. A handler that trusts an argument length it never validates can read or write kernel memory out of bounds, and the command space is catalogued in no central place. We present the Linux IOCTL Census, a source-derived and queryable inventory of that surface. An allmodconfig build compiles 878 modules across 169 subtrees, and over them a single deterministic libclang pass over the kernel source recovers 586 ioctl dispatch entry points, 1,289 decoded _IOC command codes, 3,583 controlled-input sinks, and 1,298 permission gates. A second pass encodes the kernel's own documented threat model as a queryable column, separating the capability-ungated ioctl surface, an upper bound on unprivileged reach rather than proven reach, from the part a hard capability gate puts out of scope. We backtest the census against 22 recent in-tree ioctl CVEs and release the structural tier as open data, on a schema shared with the companion Windows IOCTL Census so a single query spans both operating systems.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑