Memory safety bugs, such as out-of-bound accesses (OOB) in GPU programs, can compromise the security and reliability of GPU-accelerated software. We report the existence of input-dependent OOBs in the wild that manifest only under specific inputs. All existing tools to detect OOBs in GPU programs rely on runtime techniques that require an OOB to manifest for detection. Thus, input-dependent OOBs elude them. We also discover intra-allocation OOBs that arise in the presence of logical partitioning of a memory allocation into multiple data structures. Existing techniques are oblivious to the possibility of such OOBs. We make a key observation that the presence (or absence) of semantic relations among program variables, which determines the size of allocations (CPU code) and those calculating offsets into memory allocations (GPU code), helps identify the absence (or presence) of OOBs. We build SCuBA, a first-of-its-kind compile-time technique that analyzes CPU and GPU code to capture such semantic relations (if present). It uses a SAT solver to check if an OOB access is possible under any input, given the captured relations expressed as constraints. It further analyzes GPU code to track logical partitioning of memory allocations for detecting intra-allocation OOB. Compared to NVIDIA's Compute Sanitizer that misses 45 elusive memory bugs across 20 programs, SCuBA misses none with no false alarms.


翻译:GPU程序中的内存安全错误(如越界访问)可能危及GPU加速软件的安全性与可靠性。本文揭示了实际应用中存在仅在某些特定输入下才会显现的输入依赖性越界访问。现有检测GPU程序越界访问的工具均依赖运行时技术,需要错误显现才能被检测,因此这类输入依赖性错误得以隐匿。我们还发现了在内存分配被逻辑划分为多个数据结构时出现的分配内越界访问,现有技术完全忽视了此类错误的可能性。我们提出关键观察:程序变量间语义关系(决定CPU代码中内存分配大小与GPU代码中内存偏移量计算)的存在(或缺失)有助于判定越界访问的缺失(或存在)。基于此,我们构建了SCuBA——首个在编译时分析CPU与GPU代码以捕获此类语义关系(若存在)的技术。该方法将捕获的关系表达为约束条件,利用SAT求解器检验在任何输入下是否可能发生越界访问。SCuBA进一步分析GPU代码以追踪内存分配的逻辑划分,从而检测分配内越界访问。相较于NVIDIA Compute Sanitizer在20个程序中遗漏45个隐匿内存错误的表现,SCuBA实现了零遗漏且无虚假告警。

0
下载
关闭预览

相关内容

盘点来自工业界的GPU共享方案
计算机视觉life
12+阅读 · 2021年9月2日
TF1 到 TF2, 你的在线推理很可能内存爆炸
AINLP
12+阅读 · 2020年6月1日
GPU 显存不足怎么办?
AINLP
13+阅读 · 2019年8月16日
iOS如何区分App和SDK内部crash
CocoaChina
11+阅读 · 2019年4月17日
Linux挖矿病毒的清除与分析
FreeBuf
14+阅读 · 2019年4月15日
腾讯:机器学习构建通用的数据异常检测平台
全球人工智能
11+阅读 · 2018年5月1日
深度学习的GPU:深度学习中使用GPU的经验和建议
数据挖掘入门与实战
11+阅读 · 2018年1月3日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
相关VIP内容
相关资讯
盘点来自工业界的GPU共享方案
计算机视觉life
12+阅读 · 2021年9月2日
TF1 到 TF2, 你的在线推理很可能内存爆炸
AINLP
12+阅读 · 2020年6月1日
GPU 显存不足怎么办?
AINLP
13+阅读 · 2019年8月16日
iOS如何区分App和SDK内部crash
CocoaChina
11+阅读 · 2019年4月17日
Linux挖矿病毒的清除与分析
FreeBuf
14+阅读 · 2019年4月15日
腾讯:机器学习构建通用的数据异常检测平台
全球人工智能
11+阅读 · 2018年5月1日
深度学习的GPU:深度学习中使用GPU的经验和建议
数据挖掘入门与实战
11+阅读 · 2018年1月3日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员