TCP-fuzz: Detecting memory and semantic bugs in TCP stacks with fuzzing

  • Yong Hao Zou
  • , Jia Ju Bai*
  • , Jielong Zhou
  • , Jiangfeng Tan
  • , Chenggang Qin
  • , Shi Min Hu
  • *Corresponding author for this work

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

Abstract

TCP stacks provide reliable data transmission in network, and thus they should be correctly implemented and well tested to ensure reliability and security. However, testing TCP stacks is difficult. First, a TCP stack accepts packets and system calls that have dependencies between each other, and thus generating effective test cases is challenging. Second, a TCP stack has various complex state transitions, but existing testing approaches target covering states instead of covering state transitions, and thus their testing coverage is limited. Finally, our study of TCP stack commits shows that 87% of bug-fixing commits are related to semantic bugs (such as RFC violations), but existing bug sanitizers can detect only memory bugs not semantic bugs. In this paper, we design a novel fuzzing framework named TCP-Fuzz, to effectively test TCP stacks and detect bugs. TCP-Fuzz consists of three key techniques: (1) a dependencybased strategy that considers dependencies between packets and system calls, to generate effective test cases; (2) a transition-guided fuzzing approach that uses a new coverage metric named branch transition as program feedback, to improve the coverage of state transitions; (3) a differential checker that compares the outputs of multiple TCP stacks for the same inputs, to detect semantic bugs. We have evaluated TCP-Fuzz on five widely-used TCP stacks (TLDK, F-Stack, mTCP, FreeBSD TCP and Linux TCP), and find 56 real bugs (including 8 memory bugs and 48 semantic bugs). 40 of these bugs have been confirmed by related developers.

Original languageEnglish
Title of host publication2021 USENIX Annual Technical Conference
PublisherUSENIX Association
Pages161-175
Number of pages15
ISBN (Electronic)9781939133236
StatePublished - 2021
Externally publishedYes
Event2021 USENIX Annual Technical Conference, ATC 2021 - Virtual, Online
Duration: 14 Jul 202116 Jul 2021

Publication series

Name2021 USENIX Annual Technical Conference

Conference

Conference2021 USENIX Annual Technical Conference, ATC 2021
CityVirtual, Online
Period14/07/2116/07/21

Fingerprint

Dive into the research topics of 'TCP-fuzz: Detecting memory and semantic bugs in TCP stacks with fuzzing'. Together they form a unique fingerprint.

Cite this