From 26be8df8135ecb59e8034967927aa18c26117a3a Mon Sep 17 00:00:00 2001 From: Taras Madan Date: Wed, 22 Feb 2023 16:09:15 +0100 Subject: all: tools/syz-env make generate result --- pkg/csource/csource.go | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'pkg/csource') diff --git a/pkg/csource/csource.go b/pkg/csource/csource.go index 8671a57db..d4972261b 100644 --- a/pkg/csource/csource.go +++ b/pkg/csource/csource.go @@ -4,23 +4,23 @@ // Package csource generates [almost] equivalent C programs from syzkaller programs. // // Outline of the process: -// - inputs to the generation are the program and options -// - options control multiple aspects of the resulting C program, -// like if we want a multi-threaded program or a single-threaded, -// what type of sandbox we want to use, if we want to setup net devices or not, etc -// - we use actual executor sources as the base -// - gen.go takes all executor/common*.h headers and bundles them into generated.go -// - during generation we tear executor headers apart and take only the bits -// we need for the current program/options, this is done by running C preprocessor -// with particular set of defines so that the preprocessor removes unneeded -// #ifdef SYZ_FOO sections -// - then we generate actual syscall calls with the given arguments -// based on the binary "encodingexec" representation of the program -// (the same representation executor uses for interpretation) -// - then we glue it all together -// - as the last step we run some text post-processing on the resulting source code: -// remove debug calls, replace exitf/fail with exit, hoist/sort/dedup includes, -// remove duplicate empty lines, etc +// - inputs to the generation are the program and options +// - options control multiple aspects of the resulting C program, +// like if we want a multi-threaded program or a single-threaded, +// what type of sandbox we want to use, if we want to setup net devices or not, etc +// - we use actual executor sources as the base +// - gen.go takes all executor/common*.h headers and bundles them into generated.go +// - during generation we tear executor headers apart and take only the bits +// we need for the current program/options, this is done by running C preprocessor +// with particular set of defines so that the preprocessor removes unneeded +// #ifdef SYZ_FOO sections +// - then we generate actual syscall calls with the given arguments +// based on the binary "encodingexec" representation of the program +// (the same representation executor uses for interpretation) +// - then we glue it all together +// - as the last step we run some text post-processing on the resulting source code: +// remove debug calls, replace exitf/fail with exit, hoist/sort/dedup includes, +// remove duplicate empty lines, etc package csource import ( -- cgit mrf-deployment