首页|期刊导航|四川大学学报(自然科学版)|Cuda-Gen:一种基于API知识图覆盖驱动的CUDA模糊测试框架

Cuda-Gen:一种基于API知识图覆盖驱动的CUDA模糊测试框架OA

Cuda-Gen:An API-knowledge-graph coverage-driven fuzzing framework for CUDA libraries

中文摘要英文摘要

在人工智能驱动的时代,NVIDIA CUDA库已成为加速计算密集型任务不可或缺的工具,但由于其闭源代码和独特的编程范式,其安全性评估仍然严重不足.现有研究还没有专门针对CUDA库的漏洞挖掘工具.本文讨论了对CUDA库进行模糊测试所面临的挑战:1)缺乏指导导致生成的测试驱动能够覆盖的API范围有限;2)基于大模型生成的测试驱动在输入变异方面效率低下.本文提出了一种名为Cuda-Gen的新工具,用于发现CUDA库中的潜在漏洞.Cuda-Gen能够从零开始为各种CUDA库函数生成测试驱动,执行高效的参数变异,并适配多种CUDA库的需求.首先,利用大语言模型(LLM)从CUDA文档和示例代码中提取语义关系,构建知识图谱,从而优先考虑API交互与上下文依赖关系.提出API覆盖位图,以引导模糊测试器探索测试不足的库函数.此外,API知识图谱还结合编译器诊断信息来修复错误的桩代码,从而提升编译成功率.随后,Cuda-Gen使用大模型分析并解耦参数依赖关系,区分可变参数,对其进行参数隔离变异,以提高变异效率.在3个CUDA版本(12.4、12.7和13.0)以及6个被广泛使用的库(如 cuBLAS、cuFFT)上的评估表明,Cuda-Gen相较于基线工具 Fuzz4all,平均实现了2.97倍的API覆盖率和4.0倍的API边覆盖率.实验还发现了3个未知漏洞,已由NVIDIA安全团队验证.

In the AI-driven era,NVIDIA CUDA libraries have become indispensable for accelerating compute-intensive tasks,yet their security assessment remains critically understudied due to closed-source code and unique program.gming paradigms.Existing efforts primarily focus ontarget CUDA compiler vulner-abilities(e.g.,NVCC),but leaving library-level risks largely unexplored.overlook broader library-specific risks.This The paper addresses the challenges of fuzzing CUDA libraries:1)the absence of guidance nar-rows the set of APIs that generated harnesses can reach;and 2)input mutation remains inefficient for LLM-generated harnesses.We propose Cuda-Gen,Aa new tool called Cuda-Gen has been proposed,aimed at un-covering potential vulnerabilities in the CUDA libraries.Cuda-Gen has the ability tocan generate testing har-nesses for various CUDA library functions from scratch,perform efficient parameter mutation,and adapt to the needs of multiple CUDA libraries.First,LLMs are used to extract semantic relationships from CUDA documentation and sample codes,constructing a knowledge graph that prioritizes API interactions and contex-tual dependencies.We introduce anThe API coverage bitmap is proposed to guide the fuzzer to explore under-tested library functions.AdditionallyBesides,we integrate the API knowledge graph is also combined with compiler diagnostics to automatically repair erroneous harnesses,thereby improving compilation success rates.Subsequently,Cuda-Gen employs the LLMs to analyze and decouple parameter dependencies,sepa-rates out the mutable parameters,and performs parameter-isolated mutation on them to enhance mutation effi-ciency.Evaluated across three CUDA releases(12.4,12.7,and 13.0)on eightsix widely adopted libraries(e.g.,cuBLAS,cuFFT),Cuda-Gen achieves on average 2.97×improvements inhigher API coverage and 4.0×improvements insuperior API edge coverage over the baseline tool Fuzz4Allrelative to baseline(Fuzz4all),on average.The experiments uncovered 43 unknown vulnerabilitiesbugs,validated by NVIDIA's security team.

宋霁洋;范希明;高心怡;丁雪川;雷琦;方勇

四川大学网络空间安全学院,成都 610065四川大学网络空间安全学院,成都 610065四川大学网络空间安全学院,成都 610065成都市公安局,成都 610017中国电子科技集团公司第三十研究所,北京 100071四川大学网络空间安全学院,成都 610065

信息技术与安全科学

模糊测试基于大语言模型的知识图谱CUDA库安全API覆盖位图

fuzzingLLM-based knowledge graphCUDA libraries securityAPI coverage bitmap

《四川大学学报(自然科学版)》 2026 (2)

259-274,16

军委科技委预先研究项目(CA131B0502T-065)

10.19907/j.0490-6756.250305

评论