Unleashing the Hidden Power of Compiler Optimization on Binary Code Difference: An Empirical Study

03/23/2021
by   Xiaolei Ren, et al.
0

Since compiler optimization is the most common source contributing to binary code differences in syntax, testing the resilience against the changes caused by different compiler optimization settings has become a standard evaluation step for most binary diffing approaches. For example, 47 top-venue papers in the last 12 years compared different program versions compiled by default optimization levels (e.g., -Ox in GCC and LLVM). Although many of them claim they are immune to compiler transformations, it is yet unclear about their resistance to non-default optimization settings. Especially, we have observed that adversaries explored non-default compiler settings to amplify malware differences. This paper takes the first step to systematically studying the effectiveness of compiler optimization on binary code differences. We tailor search-based iterative compilation for the auto-tuning of binary code differences. We develop BinTuner to search near-optimal optimization sequences that can maximize the amount of binary code differences. We run BinTuner with GCC 10.2 and LLVM 11.0 on SPEC benchmarks (CPU2006 CPU2017), Coreutils, and OpenSSL. Our experiments show that at the cost of 279 to 1,881 compilation iterations, BinTuner can find custom optimization sequences that are substantially better than the general -Ox settings. BinTuner's outputs seriously undermine prominent binary diffing tools' comparisons. In addition, the detection rate of the IoT malware variants tuned by BinTuner falls by more than 50 cautionary tale for security analysts that attackers have a new way to mutate malware code cost-effectively, and the research community needs to step back to reassess optimization-resistance evaluations.

READ FULL TEXT

page 9

page 12

research
01/18/2023

Understand Code Style: Efficient CNN-based Compiler Optimization Recognition System

Compiler optimization level recognition can be applied to vulnerability ...
research
04/20/2022

Unleashing the Power of Compiler Intermediate Representation to Enhance Neural Program Embeddings

Neural program embeddings have demonstrated considerable promise in a ra...
research
09/25/2019

A Survey of Binary Code Similarity

Binary code similarity approaches compare two or more pieces of binary c...
research
11/29/2019

Drndalo: Lightweight Control Flow Obfuscation Through Minimal Processor/Compiler Co-Design

Binary analysis is traditionally used in the realm of malware detection....
research
09/04/2019

SATURN – Software Deobfuscation Framework Based on LLVM

The strength of obfuscated software has increased over the recent years....
research
12/02/2021

Efficient Calling Conventions for Irregular Architectures

We empirically evaluated thousands of different C calling conventions fo...
research
05/24/2023

Invited Paper: Initial Steps Toward a Compiler for Distributed Programs

In the Hydro project we are designing a compiler toolkit that can optimi...

Please sign up or login with your details

Forgot password? Click here to reset