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.


翻译:ioctl系统调用是Linux通用的设备控制接口。用户空间程序打开设备节点后,向驱动程序传递数值型命令码和参数缓冲区,驱动程序根据该命令码执行相应操作——无论是配置硬件、读取状态,还是在内核与用户空间之间传输数据。驱动程序自行定义数以千计的命令,并在内核上下文中解析参数,这使得ioctl处理程序成为内核中最广泛且最不统一的局部攻击面之一。若处理程序信任未经校验的参数长度,可能导致越界读写内核内存,而命令空间没有任何中央编录体系。本文提出Linux IOCTL普查系统——一个从源代码衍生且可查询的攻击面清单。通过全模块配置编译,我们在169个子系统中构建了878个模块;在此基础上,对内核源代码执行单次确定性libclang扫描,恢复了586个ioctl调度入口点、1289条已解码的_IOC命令码、3583个受控输入接收点以及1298个权限门控。第二轮扫描将内核自有的文档化威胁模型编码为可查询列,将权限门缺失的ioctl攻击面(即无特权可触及范围的上界,而非经证实的可触及范围)与硬权限门控隔离的部分加以区分。我们以22个近期内核树内ioctl相关CVE对该普查系统进行回溯验证,并将结构性层级数据作为开放数据集发布,其数据模式与配套的Windows IOCTL普查系统兼容,从而可通过单一查询跨两个操作系统执行分析。

0
下载
关闭预览

相关内容

Linux 是一系列类 Unix 计算机操作系统的统称。该操作系统的核心为 Linux 内核。Linux 操作系统也是软件和开放源代码发展中最著名的例子之一。
【硬核书】Linux核心编程|Linux Kernel Programming,741页pdf
专知会员服务
80+阅读 · 2021年3月26日
【经典书】Linux UNIX系统编程手册,1554页pdf
专知会员服务
48+阅读 · 2021年2月20日
【经典书】精通Linux,394页pdf
专知会员服务
98+阅读 · 2021年2月19日
Linux导论,Introduction to Linux,96页ppt
专知会员服务
82+阅读 · 2020年7月26日
【数据中台】什么是数据中台?
产业智能官
18+阅读 · 2019年7月30日
Github库分享:超全的PyTorch学习资源汇总
专知
25+阅读 · 2019年5月9日
Seq2seq强化,Pointer Network简介
机器学习算法与Python学习
15+阅读 · 2018年12月8日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
7+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
8+阅读 · 6月17日
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
6+阅读 · 6月17日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员