Skip to content

Commit

Permalink
save money
Browse files Browse the repository at this point in the history
  • Loading branch information
SpencerL-Y committed Sep 4, 2024
1 parent 1d97827 commit d9f6959
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 97 deletions.
91 changes: 1 addition & 90 deletions experiment_output_llmenabled.txt
Original file line number Diff line number Diff line change
@@ -1,90 +1 @@
2024/09/03 21:38:44 serving http on http://127.0.0.1:56741
2024/09/03 21:38:44 serving rpc on tcp://[::]:37371
2024/09/03 21:38:44 booting test machines...
2024/09/03 21:38:44 wait for the connection from test machine...
2024/09/03 21:38:54 XXX Fuzzer command:
/syz-fuzzer -executor=/syz-executor -name=vm-1 -arch=amd64 -manager=localhost:37371 -sandbox=none -cover=true -debug=false -optional=slowdown=1:sandbox_arg=0:pprof_port=6060
2024/09/03 21:39:04 machine check:
failed to read the following files in the VM:
/dev/raw-gadget : open /dev/raw-gadget: no such file or directory

BinFmtMisc : enabled
Comparisons : call 0 failed with errno 38
Coverage : enabled
DelayKcovMmap : enabled
DevlinkPCI : PCI device 0000:00:10.0 is not available. (errno 2: No such file or directory).
ExtraCoverage : enabled
Fault : CONFIG_FAULT_INJECTION is not enabled. (errno 2: No such file or directory).
KCSAN : write(/sys/kernel/debug/kcsan, on) failed. (errno 2: No such file or directory).
LRWPANEmulation : netlink: failed to get family id for nl802154: No such file or directory. netlink_query_family_id failed. (errno 2: No such file or directory).
Leak : failed to write(kmemleak, "scan=off"). (errno 2: No such file or directory).
NetDevices : enabled
NetInjection : tun: can't open /dev/net/tun. (errno 2: No such file or directory).
NicVF : PCI device 0000:00:11.0 is not available. (errno 2: No such file or directory).
SandboxAndroid : enabled
SandboxNamespace : enabled
SandboxSetuid : enabled
Swap : enabled
USBEmulation : failed to chmod /dev/raw-gadget. (errno 2: No such file or directory).
VhciInjection : socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI) failed. (errno 97: Address family not supported by protocol).
WifiEmulation : netlink_query_family_id failed. (errno 2: No such file or directory).
syscalls : 2192/4499

2024/09/03 21:39:11 corpus : 29 (0 broken, 29 seeds)
2024/09/03 21:39:14 candidates=0 corpus=26 coverage=14110 exec total=758 (25/sec) fuzzing VMs=1 reproducing=0
2024/09/03 21:39:18 update choice table with LLM
2024/09/03 21:39:18 UpdateChoiceTable using LLM comm content
2024/09/03 21:39:18 Build Choice Table with LLM
2024/09/03 21:39:24 candidates=0 corpus=38 coverage=14142 exec total=1330 (33/sec) fuzzing VMs=1 reproducing=0
2024/09/03 21:39:34 candidates=0 corpus=49 coverage=14455 exec total=1738 (34/sec) fuzzing VMs=1 reproducing=0
2024/09/03 21:39:44 candidates=0 corpus=56 coverage=14533 exec total=2069 (34/sec) fuzzing VMs=1 reproducing=0
2024/09/03 21:39:52 update choice table with LLM
2024/09/03 21:39:52 UpdateChoiceTable using LLM comm content
2024/09/03 21:39:52 Build Choice Table with LLM
2024/09/03 21:39:54 candidates=0 corpus=68 coverage=14625 exec total=2707 (38/sec) fuzzing VMs=1 reproducing=0
2024/09/03 21:40:04 candidates=0 corpus=79 coverage=14693 exec total=3187 (39/sec) fuzzing VMs=1 reproducing=0
2024/09/03 21:40:14 candidates=0 corpus=85 coverage=14744 exec total=3572 (39/sec) fuzzing VMs=1 reproducing=0
2024/09/03 21:40:24 candidates=0 corpus=116 coverage=15436 exec total=4531 (45/sec) fuzzing VMs=1 reproducing=0
2024/09/03 21:40:30 XXXXX REACH
2024/09/03 21:40:30 XXXXX REACH
2024/09/03 21:40:30 XXXXX REACH
2024/09/03 21:40:30 XXXXX REACH
2024/09/03 21:40:30 XXXXX REACH
2024/09/03 21:40:30 XXXXX REACH
2024/09/03 21:40:31 Hit times: 
2024/09/03 21:40:31 process print: /usr/bin/python3 ./scripts/process_close_cov_result.py
2024/09/03 21:40:32 close ask
close ask Output: [fsopen, fspick, read]

2024/09/03 21:40:34 candidates=0 corpus=119 coverage=15459 exec total=4680 (42/sec) fuzzing VMs=1 reproducing=0
2024/09/03 21:40:44 candidates=0 corpus=125 coverage=15468 exec total=5203 (43/sec) fuzzing VMs=1 reproducing=0
2024/09/03 21:40:54 candidates=0 corpus=129 coverage=15496 exec total=5713 (43/sec) fuzzing VMs=1 reproducing=0
2024/09/03 21:41:04 candidates=0 corpus=136 coverage=15538 exec total=6390 (45/sec) fuzzing VMs=1 reproducing=0
2024/09/03 21:41:14 candidates=0 corpus=155 coverage=15934 exec total=7082 (47/sec) fuzzing VMs=1 reproducing=0
2024/09/03 21:41:24 candidates=0 corpus=181 coverage=16073 exec total=7687 (48/sec) fuzzing VMs=1 reproducing=0
2024/09/03 21:41:34 candidates=0 corpus=184 coverage=16089 exec total=7825 (46/sec) fuzzing VMs=1 reproducing=0
2024/09/03 21:41:44 candidates=0 corpus=188 coverage=16126 exec total=7948 (44/sec) fuzzing VMs=1 reproducing=0
2024/09/03 21:41:54 candidates=0 corpus=198 coverage=16151 exec total=8221 (43/sec) fuzzing VMs=1 reproducing=0
2024/09/03 21:42:02 XXXXX REACH
2024/09/03 21:42:02 XXXXX REACH
2024/09/03 21:42:02 XXXXX REACH
2024/09/03 21:42:04 candidates=0 corpus=249 coverage=17847 exec total=9598 (47/sec) fuzzing VMs=1 reproducing=0
2024/09/03 21:42:08 Hit times: 
2024/09/03 21:42:08 process print: /usr/bin/python3 ./scripts/process_close_cov_result.py
2024/09/03 21:42:09 close ask
close ask Output: [fsopen, fspick, kpageflags_read]

2024/09/03 21:42:14 candidates=0 corpus=270 coverage=18398 exec total=10268 (48/sec) fuzzing VMs=1 reproducing=0
2024/09/03 21:42:24 candidates=0 corpus=270 coverage=18398 exec total=10341 (47/sec) fuzzing VMs=1 reproducing=0
2024/09/03 21:42:34 candidates=0 corpus=273 coverage=18406 exec total=10372 (45/sec) fuzzing VMs=1 reproducing=0
2024/09/03 21:42:44 candidates=0 corpus=275 coverage=18406 exec total=10407 (43/sec) fuzzing VMs=1 reproducing=0
2024/09/03 21:42:54 candidates=0 corpus=282 coverage=18416 exec total=10524 (42/sec) fuzzing VMs=1 reproducing=0
2024/09/03 21:43:04 candidates=0 corpus=282 coverage=18416 exec total=10579 (40/sec) fuzzing VMs=1 reproducing=0
2024/09/03 21:43:14 candidates=0 corpus=284 coverage=18557 exec total=10868 (40/sec) fuzzing VMs=1 reproducing=0
2024/09/03 21:43:24 candidates=0 corpus=305 coverage=18656 exec total=11653 (41/sec) fuzzing VMs=1 reproducing=0
2024/09/03 21:43:34 candidates=0 corpus=308 coverage=18665 exec total=11777 (40/sec) fuzzing VMs=1 reproducing=0
2024/09/03 21:43:44 candidates=0 corpus=309 coverage=18674 exec total=11837 (39/sec) fuzzing VMs=1 reproducing=0
2024/09/03 21:43:54 candidates=0 corpus=309 coverage=18674 exec total=11881 (38/sec) fuzzing VMs=1 reproducing=0
2024/09/03 21:44:04 candidates=0 corpus=310 coverage=18688 exec total=11930 (37/sec) fuzzing VMs=1 reproducing=0
SIGINT: shutting down...
2024/09/03 21:44:13 vm-1: running for 5m18.545044646s, restarting
sudo: a password is required
10 changes: 5 additions & 5 deletions pkg/fuzzer/fuzzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func NewFuzzer(ctx context.Context, cfg *Config, rnd *rand.Rand,
// We're okay to lose some of the messages -- if we are already
// regenerating the table, we don't want to repeat it right away.
ctRegenerate: make(chan struct{}),
llmEnabled: true,
llmEnabled: false,
ctLLMReady: true,
llm_comm_sig_file: "/home/clexma/Desktop/fox3/fuzzing/ChatAnalyzer/syz_comm_sig.txt",
llm_comm_content_file: "/home/clexma/Desktop/fox3/fuzzing/ChatAnalyzer/syz_comm_content.txt",
Expand Down Expand Up @@ -374,8 +374,8 @@ func (fuzzer *Fuzzer) choiceTableUpdater() {
return
case <-fuzzer.ctRegenerate:
}
enable_llm := fuzzer.llmEnabled
if enable_llm {
llmEnabled := fuzzer.llmEnabled
if llmEnabled {
fuzzer.updateChoiceTableWithLLM(fuzzer.Config.Corpus.Programs())
} else {
fuzzer.updateChoiceTable(fuzzer.Config.Corpus.Programs())
Expand Down Expand Up @@ -403,8 +403,8 @@ func (fuzzer *Fuzzer) ChoiceTable() *prog.ChoiceTable {
}
}
// LLM reading:
enable_llm := fuzzer.llmEnabled
if enable_llm {
llmEnabled := fuzzer.llmEnabled
if llmEnabled {
identifying_file_name := fuzzer.llm_comm_sig_file
comm_content, err := os.ReadFile(identifying_file_name)
if err != nil {
Expand Down
5 changes: 3 additions & 2 deletions syz-manager/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ type Runner struct {
// llm coverage feedback
llmCovFolderPath string
fileIndex int
fileIndex_lock sync.Mutex
llmEnabled bool
}

type BugFrames struct {
Expand Down Expand Up @@ -596,6 +596,7 @@ func (serv *RPCServer) createInstance(name string, injectExec chan<- bool) {
rnd: rand.New(rand.NewSource(time.Now().UnixNano())),
llmCovFolderPath: "./cov_folder_vm_" + name,
fileIndex: 0,
llmEnabled: false,
}
os.Mkdir(runner.llmCovFolderPath, 0777)
os.Chmod(runner.llmCovFolderPath, 0777)
Expand Down Expand Up @@ -781,7 +782,7 @@ func (runner *Runner) ProcessCovRawFileByLLM() {
}
log.Logf(0, "Hit times: "+strconv.Itoa(hit_num))
os.Remove(runner.llmCovFolderPath + "/*")
if hit_num != 0 {
if hit_num != 0 && runner.llmEnabled {
// the fuzzing actually hit some close functions
llm_analysis_command := exec.Command("python3", "./scripts/process_close_cov_result.py")
log.Logf(0, "process print: "+llm_analysis_command.String())
Expand Down

0 comments on commit d9f6959

Please sign in to comment.