On Hardware Security Bug Code Fixes by Prompting Large Language Models

被引:20
作者
Ahmad, Baleegh [1 ]
Thakur, Shailja [1 ]
Tan, Benjamin [2 ]
Karri, Ramesh [1 ]
Pearce, Hammond [3 ]
机构
[1] NYU, Dept Elect & Comp Engn, Tandon Sch Engn, Brooklyn, NY 11201 USA
[2] Univ Calgary, Dept Elect & Software Engn, Calgary, AB T2N 1N4, Canada
[3] Univ New South Wales, Dept Elect & Comp Engn, Sydney, NSW 2052, Australia
关键词
Maintenance engineering; Computer bugs; Codes; Hardware; Security; Software; Registers; Hardware security; large language models; bug repair;
D O I
10.1109/TIFS.2024.3374558
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
Novel AI-based code-writing Large Language Models (LLMs) such as OpenAI's Codex have demonstrated capabilities in many coding-adjacent domains. In this work, we consider how LLMs may be leveraged to automatically repair identified security-relevant bugs present in hardware designs by generating replacement code. We focus on bug repair in code written in Verilog. For this study, we curate a corpus of domain-representative hardware security bugs. We then design and implement a framework to quantitatively evaluate the performance of any LLM tasked with fixing the specified bugs. The framework supports design space exploration of prompts (i.e., prompt engineering) and identifying the best parameters for the LLM. We show that an ensemble of LLMs can repair all fifteen of our benchmarks. This ensemble outperforms a state-of-the-art automated hardware bug repair tool on its own suite of bugs. These results show that LLMs have the ability to repair hardware security bugs and the framework is an important step towards the ultimate goal of an automated end-to-end bug repair tool.
引用
收藏
页码:4043 / 4057
页数:15
相关论文
共 38 条
[1]  
A. F. Rev, 2023, Artifacts for 'On Hardware Security Bug Code Fixes By Querying Large Language Models'
[2]   Don't CWEAT It: Toward CWE Analysis Techniques in Early Stages of Hardware Design [J].
Ahmad, Baleegh ;
Liu, Wei-Kai ;
Collini, Luca ;
Pearce, Hammond ;
Fung, Jason M. ;
Valamehr, Jonathan ;
Bidmeshki, Mohammad ;
Sapiecha, Piotr ;
Brown, Steve ;
Chakrabarty, Krishnendu ;
Karri, Ramesh ;
Tan, Benjamin .
2022 IEEE/ACM INTERNATIONAL CONFERENCE ON COMPUTER AIDED DESIGN, ICCAD, 2022,
[3]   CirFix: Automatically Repairing Defects in Hardware Design Code [J].
Ahmad, Hammad ;
Huang, Yu ;
Weimer, Westley .
ASPLOS '22: PROCEEDINGS OF THE 27TH ACM INTERNATIONAL CONFERENCE ON ARCHITECTURAL SUPPORT FOR PROGRAMMING LANGUAGES AND OPERATING SYSTEMS, 2022, :990-1003
[4]  
[Anonymous], 2020, ModelSim Vivado Design Suite Reference Guide: Model-Based DSP Design Using System Generator (UG958). Reader. AMD Adaptive Computing Documentation Portal
[5]  
[Anonymous], 2022, VC Formal
[6]  
[Anonymous], 2019, Hardware OpenTitan Documentation
[7]   VeriSketch: Synthesizing Secure Hardware Designs with Timing-Sensitive Information Flow Properties [J].
Ardeshiricham, Armaiti ;
Takashima, Yoshiki ;
Gao, Sicun ;
Kastner, Ryan .
PROCEEDINGS OF THE 2019 ACM SIGSAC CONFERENCE ON COMPUTER AND COMMUNICATIONS SECURITY (CCS'19), 2019, :1623-1638
[8]  
Cadence, 2022, Jasper RTL Apps Cadence
[9]  
Chen M., 2021, arXiv
[10]   Neural Transfer Learning for Repairing Security Vulnerabilities in C Code [J].
Chen, Zimin ;
Kommrusch, Steve ;
Monperrus, Martin .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2023, 49 (01) :147-165