Gauntlet: Finding Bugs in Compilers for Programmable Packet Processing
Programmable packet-processing devices such as programmable switches and network interface cards are becoming mainstream. These devices are programmed in a domain-specific language such as P4, using a compiler to translate packet-processing programs into instructions for different targets. As networks with programmable devices become widespread, it is critical that these compilers are dependable. This paper considers the problem of finding bugs in compilers for packet processing in the context of P4-16. We introduce domain-specific techniques to induce both abnormal termination of the compiler (crash bugs) and miscompilation (semantic bugs). We apply these techniques to (1) the open-source P4 compiler (P4C) infrastructure, which serves as a base for different P4 back ends; (2) the P4 back end for the P4 reference software switch; and (3) the P4 back end for the Barefoot Tofino switch. Across the 3 platforms, over 4 months of bug finding, our tool Gauntlet detected 78 new and distinct bugs (47 crash and 31 semantic), which we confirmed with the respective compiler developers. 44 have been fixed (27 crash and 17 semantic); the remaining have been assigned to a developer. Our bug-finding efforts also led to 6 P4 specification changes. We have open sourced Gauntlet at https://github.com/p4gauntlet.
READ FULL TEXT