google / syzkaller

syzkaller is an unsupervised coverage-guided kernel fuzzer
Apache License 2.0
5.35k stars 1.23k forks source link

tools/syz-trace2syz: tool is outdated, cannot parse traces #3508

Open nrb547 opened 1 year ago

nrb547 commented 1 year ago

Description

I wanted to try trace2syz, but it seems like the tool is outdated, for instance it cannot deal with rt_sigaction calls, <wait4 resumed...> logs, and apparently some buffer type.

Reproduction

I used your example (tools/syz-trace2syz/trace2syz.go) to invoke strace: strace -o trace -a 1 -s 65500 -v -xx -f -Xraw ./a.out

I ran it on a simple script which enables the loopback interface (with raised privileges): #!/bin/sh ip link set dev lo up

Running trace2-syz for this trace made it log parsing errors, such as:

$ ./bin/syz-trace2syz -file ~/trace
2022/11/06 10:33:10 parsing 1 traces
error: syntax error
2022/11/06 10:33:10 SYZFATAL: failed to parse line: 34400 <... wait4 resumed>[{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 34402

I decided to minimize the trace by hand, so I deleted the wait4, ELF/libc handling lines. Also, I deleted everything until I saw the actual program invoked related to opening sockets, etc.

Then this issue occurred:

2022/11/06 10:40:31 parsing 1 traces
2022/11/06 10:40:31 SYZFATAL: unsupported type for buffer: &parser.GroupType{Elems:[]parser.IrType{0x1}}

Trace:

34402 brk(NULL) = 0x555859e83000
34402 access("\x2f\x65\x74\x63\x2f\x6c\x64\x2e\x73\x6f\x2e\x70\x72\x65\x6c\x6f\x61\x64", 0x4) = -1 ENOENT (No such file or directory)
34402 openat(-100, "\x2f\x65\x74\x63\x2f\x6c\x64\x2e\x73\x6f\x2e\x63\x61\x63\x68\x65", 0x80000) = 3
34402 fstat(3, {st_dev=0xfe00, st_ino=4199488, st_mode=0100644, st_nlink=1, st_uid=65534, st_gid=65534, st_blksize=4096, st_blocks=168, st_size=82397, st_atime=1667665953 /* 2022-11-05T17:32:33.635140481+0100 */, st_atime_nsec=635140481, st_mtime=1667578606 /* 2022-11-04T17:16:46.523228134+0100 */, st_mtime_nsec=523228134, st_ctime=1667578606 /* 2022-11-04T17:16:46.532228252+0100 */, st_ctime_nsec=532228252}) = 0
34402 mmap(NULL, 82397, 0x1, 0x2, 3, 0) = 0x7f8ae8e83000
34402 close(3) = 0
34402 openat(-100, "\x2f\x75\x73\x72\x2f\x6c\x69\x62\x2f\x6c\x69\x62\x6d\x6e\x6c\x2e\x73\x6f\x2e\x30", 0x80000) = 3
34402 read(3, "\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x3e\x00\x01\x00\x00\x00\x70\x22\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x40\x61\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x38\x00\x09\x00\x40\x00\x1c\x00\x1b\x00\x01\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x1a\x00\x00\x00\x00\x00\x00\x28\x1a\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x05\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x69\x17\x00\x00\x00\x00\x00\x00\x69\x17\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x24\x0e\x00\x00\x00\x00\x00\x00\x24\x0e\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x06\x00\x00\x00\x10\x5c\x00\x00\x00\x00\x00\x00\x10\x6c\x00\x00\x00\x00\x00\x00\x10\x6c\x00\x00\x00\x00\x00\x00\xf8\x03\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x06\x00\x00\x00\xa0\x5c\x00\x00\x00\x00\x00\x00\xa0\x6c\x00\x00\x00\x00\x00\x00\xa0\x6c\x00\x00\x00\x00\x00\x00\x10\x02\x00\x00\x00\x00\x00\x00\x10\x02\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x04\x00\x00\x00\x38\x02\x00\x00\x00\x00\x00\x00\x38\x02\x00\x00\x00\x00\x00\x00\x38\x02\x00\x00\x00\x00\x00\x00\x24\x00\x00\x00\x00\x00\x00\x00\x24\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x50\xe5\x74\x64\x04\x00\x00\x00\x00\x42\x00\x00\x00\x00\x00\x00\x00\x42\x00\x00\x00\x00\x00\x00\x00\x42\x00\x00\x00\x00\x00\x00\x5c\x02\x00\x00\x00\x00\x00\x00\x5c\x02\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x51\xe5\x74\x64\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x52\xe5\x74\x64\x04\x00\x00\x00\x10\x5c\x00\x00\x00\x00\x00\x00\x10\x6c\x00\x00\x00\x00\x00\x00\x10\x6c\x00\x00\x00\x00\x00\x00\xf0\x03\x00\x00\x00\x00\x00\x00\xf0\x03\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x14\x00\x00\x00\x03\x00\x00\x00\x47\x4e\x55\x00\xcd\x1b\x1d\x25\x27\xc4\x74\x3a\xcd\xb2\xcd\xd6\xb1\x05\xe5\x2c\xcd\x0b\xd4\x46\x00\x00\x00\x00\x43\x00\x00\x00\x18\x00\x00\x00\x08\x00\x00\x00\x09\x00\x00\x00\x20\x20\x66\x50\x48\xf0\x40\x40\x10\x80\x0e\x02\x00\xc0\x45\x00\x31\x90\xa5\x68\x00\x46\xc0\x10\x18\x00\x80\x00\x40\x00\x42\x18\x90\x10\x28\x40\x90\x00\x01\x81\x40\x82\x40\x0c\x18\x00\x40\x18\x85\x11\x50\x00\x40\x62\x10\x40\x83\xa4\x47\x2f\x07\x2a\xcd\x41\x18\x00\x00\x00\x00\x00\x00\x00\x1a\x00\x00\x00\x1b\x00\x00\x00\x1d\x00\x00\x00\x1e\x00\x00\x00\x1f\x00\x00\x00\x00\x00\x00\x00\x23\x00\x00\x00\x24\x00\x00\x00\x26\x00\x00\x00\x27\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x29\x00\x00\x00\x00\x00\x00\x00\x2a\x00\x00\x00\x2c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2f\x00\x00\x00\x00\x00\x00\x00\x32\x00\x00\x00\x35\x00\x00\x00\x36\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x38\x00\x00\x00\x39\x00\x00\x00\x3b\x00\x00\x00\x00\x00\x00\x00", 832) = 832
34402 fstat(3, {st_dev=0xfe00, st_ino=2233085, st_mode=0100755, st_nlink=1, st_uid=65534, st_gid=65534, st_blksize=4096, st_blocks=56, st_size=26688, st_atime=1667665953 /* 2022-11-05T17:32:33.781140476+0100 */, st_atime_nsec=781140476, st_mtime=1649594150 /* 2022-04-10T14:35:50+0200 */, st_mtime_nsec=0, st_ctime=1653064558 /* 2022-05-20T18:35:58.966766232+0200 */, st_ctime_nsec=966766232}) = 0
34402 mmap(NULL, 8192, 0x3, 0x22, -1, 0) = 0x7f8ae8e81000
34402 mmap(NULL, 28688, 0x1, 0x802, 3, 0) = 0x7f8ae8e79000
34402 mprotect(0x7f8ae8e7b000, 16384, 0) = 0
34402 mmap(0x7f8ae8e7b000, 8192, 0x5, 0x812, 3, 0x2000) = 0x7f8ae8e7b000
34402 mmap(0x7f8ae8e7d000, 4096, 0x1, 0x812, 3, 0x4000) = 0x7f8ae8e7d000
34402 mmap(0x7f8ae8e7f000, 8192, 0x3, 0x812, 3, 0x5000) = 0x7f8ae8e7f000
34402 close(3) = 0
34402 openat(-100, "\x2f\x75\x73\x72\x2f\x6c\x69\x62\x2f\x6c\x69\x62\x64\x6c\x2e\x73\x6f\x2e\x32", 0x80000) = 3
34402 read(3, "\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x3e\x00\x01\x00\x00\x00\x30\x11\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\xe0\x30\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x38\x00\x09\x00\x40\x00\x25\x00\x24\x00\x01\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x70\x0f\x00\x00\x00\x00\x00\x00\x70\x0f\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x05\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x51\x10\x00\x00\x00\x00\x00\x00\x51\x10\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00\x30\x00\x00\x00\x00\x00\x00\x30\x05\x00\x00\x00\x00\x00\x00\x30\x05\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x06\x00\x00\x00\xd0\x3c\x00\x00\x00\x00\x00\x00\xd0\x4c\x00\x00\x00\x00\x00\x00\xd0\x4c\x00\x00\x00\x00\x00\x00\x38\x03\x00\x00\x00\x00\x00\x00\xc0\x03\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x06\x00\x00\x00\xf0\x3c\x00\x00\x00\x00\x00\x00\xf0\x4c\x00\x00\x00\x00\x00\x00\xf0\x4c\x00\x00\x00\x00\x00\x00\x30\x02\x00\x00\x00\x00\x00\x00\x30\x02\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x04\x00\x00\x00\x38\x02\x00\x00\x00\x00\x00\x00\x38\x02\x00\x00\x00\x00\x00\x00\x38\x02\x00\x00\x00\x00\x00\x00\x44\x00\x00\x00\x00\x00\x00\x00\x44\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x50\xe5\x74\x64\x04\x00\x00\x00\xa4\x30\x00\x00\x00\x00\x00\x00\xa4\x30\x00\x00\x00\x00\x00\x00\xa4\x30\x00\x00\x00\x00\x00\x00\xd4\x00\x00\x00\x00\x00\x00\x00\xd4\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x51\xe5\x74\x64\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x52\xe5\x74\x64\x04\x00\x00\x00\xd0\x3c\x00\x00\x00\x00\x00\x00\xd0\x4c\x00\x00\x00\x00\x00\x00\xd0\x4c\x00\x00\x00\x00\x00\x00\x30\x03\x00\x00\x00\x00\x00\x00\x30\x03\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x14\x00\x00\x00\x03\x00\x00\x00\x47\x4e\x55\x00\x3f\x08\x57\x58\xa6\xe1\x5d\xdb\xa4\x6b\xcd\xb9\x2e\xdb\x8d\x18\x75\xbb\x4f\x85\x04\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x00\x47\x4e\x55\x00\x00\x00\x00\x00\x03\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x41\x00\x00\x00\x2b\x00\x00\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x1d\x00\x00\x00\x26\x00\x00\x00\x12\x00\x00\x00\x21\x00\x00\x00\x0f\x00\x00\x00\x00\x00\x00\x00\x1f\x00\x00\x00\x00\x00\x00\x00\x24\x00\x00\x00\x25\x00\x00\x00\x1a\x00\x00\x00\x15\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x00\x00\x11\x00\x00\x00\x13\x00\x00\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0d\x00\x00\x00\x29\x00\x00\x00\x00\x00\x00\x00\x16\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x27\x00\x00\x00\x2a\x00\x00\x00\x10\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x00\x00", 832) = 832
34402 fstat(3, {st_dev=0xfe00, st_ino=2228504, st_mode=0100755, st_nlink=1, st_uid=65534, st_gid=65534, st_blksize=4096, st_blocks=288, st_size=145952, st_atime=1667669919 /* 2022-11-05T18:38:39.055373446+0100 */, st_atime_nsec=55373446, st_mtime=1621620226 /* 2021-05-21T20:03:46+0200 */, st_mtime_nsec=0, st_ctime=1648973166 /* 2022-04-03T10:06:06.902855727+0200 */, st_ctime_nsec=902855727}) = 0
34402 mmap(NULL, 20624, 0x1, 0x802, 3, 0) = 0x7f8ae8e73000
34402 mmap(0x7f8ae8e74000, 8192, 0x5, 0x812, 3, 0x1000) = 0x7f8ae8e74000
34402 mmap(0x7f8ae8e76000, 4096, 0x1, 0x812, 3, 0x3000) = 0x7f8ae8e76000
34402 mmap(0x7f8ae8e77000, 8192, 0x3, 0x812, 3, 0x3000) = 0x7f8ae8e77000
34402 close(3) = 0
34402 openat(-100, "\x2f\x75\x73\x72\x2f\x6c\x69\x62\x2f\x6c\x69\x62\x63\x2e\x73\x6f\x2e\x36", 0x80000) = 3
34402 read(3, "\x7f\x45\x4c\x46\x02\x01\x01\x03\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x3e\x00\x01\x00\x00\x00\x40\x7f\x02\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x48\xef\xc5\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x38\x00\x0c\x00\x40\x00\x45\x00\x44\x00\x06\x00\x00\x00\x04\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\xa0\x02\x00\x00\x00\x00\x00\x00\xa0\x02\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x04\x00\x00\x00\x00\x4e\x19\x00\x00\x00\x00\x00\x00\x4e\x19\x00\x00\x00\x00\x00\x00\x4e\x19\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x78\x50\x02\x00\x00\x00\x00\x00\x78\x50\x02\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x05\x00\x00\x00\x00\x60\x02\x00\x00\x00\x00\x00\x00\x60\x02\x00\x00\x00\x00\x00\x00\x60\x02\x00\x00\x00\x00\x00\xfc\x95\x14\x00\x00\x00\x00\x00\xfc\x95\x14\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x00\x00\x17\x00\x00\x00\x00\x00\x00\x00\x17\x00\x00\x00\x00\x00\x00\x00\x17\x00\x00\x00\x00\x00\xf3\xb3\x04\x00\x00\x00\x00\x00\xf3\xb3\x04\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x06\x00\x00\x00\x18\xb4\x1b\x00\x00\x00\x00\x00\x18\xc4\x1b\x00\x00\x00\x00\x00\x18\xc4\x1b\x00\x00\x00\x00\x00\x78\x50\x00\x00\x00\x00\x00\x00\x88\x8e\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x06\x00\x00\x00\xc0\xd9\x1b\x00\x00\x00\x00\x00\xc0\xe9\x1b\x00\x00\x00\x00\x00\xc0\xe9\x1b\x00\x00\x00\x00\x00\xe0\x01\x00\x00\x00\x00\x00\x00\xe0\x01\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x04\x00\x00\x00\xe0\x02\x00\x00\x00\x00\x00\x00\xe0\x02\x00\x00\x00\x00\x00\x00\xe0\x02\x00\x00\x00\x00\x00\x00\x44\x00\x00\x00\x00\x00\x00\x00\x44\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x04\x00\x00\x00\x18\xb4\x1b\x00\x00\x00\x00\x00\x18\xc4\x1b\x00\x00\x00\x00\x00\x18\xc4\x1b\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x88\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x50\xe5\x74\x64\x04\x00\x00\x00\x20\x4e\x19\x00\x00\x00\x00\x00\x20\x4e\x19\x00\x00\x00\x00\x00\x20\x4e\x19\x00\x00\x00\x00\x00\x94\x62\x00\x00\x00\x00\x00\x00\x94\x62\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x51\xe5\x74\x64\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x52\xe5\x74\x64\x04\x00\x00\x00\x18\xb4\x1b\x00\x00\x00\x00\x00\x18\xc4\x1b\x00\x00\x00\x00\x00\x18\xc4\x1b\x00\x00\x00\x00\x00\xe8\x2b\x00\x00\x00\x00\x00\x00\xe8\x2b\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x14\x00\x00\x00\x03\x00\x00\x00\x47\x4e\x55\x00\xfc\x56\xaa\x4d\xd3\x46\x3b\x55\x47\x08\x05\x1b\x5c\x1a\x86\xd8\x1b\x93\x74\x9b\x04\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x00\x47\x4e\x55\x00\x00\x00\x00\x00\x03\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf9\x03\x00\x00\x63\x09\x00\x00\xfa\x01\x00\x00\x44\x03\x00\x00\x24\x09\x00\x00\x4b\x04\x00\x00", 832) = 832
34402 fstat(3, {st_dev=0xfe00, st_ino=2291325, st_mode=0100755, st_nlink=1, st_uid=65534, st_gid=65534, st_blksize=4096, st_blocks=25352, st_size=12976264, st_atime=1667665953 /* 2022-11-05T17:32:33.635140481+0100 */, st_atime_nsec=635140481, st_mtime=1621620226 /* 2021-05-21T20:03:46+0200 */, st_mtime_nsec=0, st_ctime=1648973166 /* 2022-04-03T10:06:06.922855834+0200 */, st_ctime_nsec=922855834}) = 0
34402 mmap(NULL, 1856160, 0x1, 0x802, 3, 0) = 0x7f8ae8cad000
34402 mmap(0x7f8ae8cd3000, 1351680, 0x5, 0x812, 3, 0x26000) = 0x7f8ae8cd3000
34402 mmap(0x7f8ae8e1d000, 311296, 0x1, 0x812, 3, 0x170000) = 0x7f8ae8e1d000
34402 mmap(0x7f8ae8e69000, 24576, 0x3, 0x812, 3, 0x1bb000) = 0x7f8ae8e69000
34402 mmap(0x7f8ae8e6f000, 12960, 0x3, 0x32, -1, 0) = 0x7f8ae8e6f000
34402 close(3) = 0
34402 mmap(NULL, 12288, 0x3, 0x22, -1, 0) = 0x7f8ae8caa000
34402 arch_prctl(0x1002, 0x7f8ae8caa740) = 0
34402 mprotect(0x7f8ae8e69000, 12288, 0x1) = 0
34402 mprotect(0x7f8ae8e77000, 4096, 0x1) = 0
34402 mprotect(0x7f8ae8e7f000, 4096, 0x1) = 0
34402 mprotect(0x5558599e2000, 12288, 0x1) = 0
34402 mprotect(0x7f8ae8ec2000, 4096, 0x1) = 0
34402 munmap(0x7f8ae8e83000, 82397) = 0
34402 socket(0x10, 0x3|0x80000, 0) = 3
34402 setsockopt(3, 0x1, 0x7, [32768], 4) = 0
34402 setsockopt(3, 0x1, 0x8, [1048576], 4) = 0
34402 setsockopt(3, 0x10e, 0xb, [1], 4) = 0
34402 bind(3, {sa_family=0x10, nl_pid=0, nl_groups=00000000}, 12) = 0
34402 getsockname(3, {sa_family=0x10, nl_pid=34402, nl_groups=00000000}, [12]) = 0
34402 setsockopt(3, 0x10e, 0xc, [1], 4) = 0
34402 sendto(3, [{nlmsg_len=32, nlmsg_type=0x10, nlmsg_flags=0x5, nlmsg_seq=0, nlmsg_pid=0}, {ifi_family=0, ifi_type=0, ifi_index=0, ifi_flags=0, ifi_change=0}], 32, 0, NULL, 0) = 32
34402 recvmsg(3, {msg_name={sa_family=0x10, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=[{nlmsg_len=52, nlmsg_type=0x2, nlmsg_flags=0, nlmsg_seq=0, nlmsg_pid=34402}, {error=-19, msg=[{nlmsg_len=32, nlmsg_type=0x10, nlmsg_flags=0x5, nlmsg_seq=0, nlmsg_pid=0}, {ifi_family=0, ifi_type=0, ifi_index=0, ifi_flags=0, ifi_change=0}]}], iov_len=16384}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 52
34402 socket(0x10, 0x3|0x80000, 0) = 4
34402 setsockopt(4, 0x1, 0x7, [32768], 4) = 0
34402 setsockopt(4, 0x1, 0x8, [1048576], 4) = 0
34402 setsockopt(4, 0x10e, 0xb, [1], 4) = 0
34402 bind(4, {sa_family=0x10, nl_pid=0, nl_groups=00000000}, 12) = 0
34402 getsockname(4, {sa_family=0x10, nl_pid=-1148710972, nl_groups=00000000}, [12]) = 0
34402 sendmsg(4, {msg_name={sa_family=0x10, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=[{nlmsg_len=48, nlmsg_type=0x12, nlmsg_flags=0x1, nlmsg_seq=1667727161, nlmsg_pid=0}, {ifi_family=0, ifi_type=0, ifi_index=0, ifi_flags=0, ifi_change=0}, [[{nla_len=8, nla_type=0x1d}, 0x9], [{nla_len=7, nla_type=0x3}, "\x6c\x6f\x00"...]]], iov_len=48}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 48
34402 recvmsg(4, {msg_name={sa_family=0x10, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=NULL, iov_len=0}], msg_iovlen=1, msg_controllen=0, msg_flags=0x20}, 0x22) = 1012
34402 brk(NULL) = 0x555859e83000
34402 brk(0x555859ea4000) = 0x555859ea4000
34402 recvmsg(4, {msg_name={sa_family=0x10, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=[{nlmsg_len=1012, nlmsg_type=0x10, nlmsg_flags=0, nlmsg_seq=1667727161, nlmsg_pid=-1148710972}, {ifi_family=0, ifi_type=0x304, ifi_index=1, ifi_flags=0x8, ifi_change=0}, [[{nla_len=7, nla_type=0x3}, "\x6c\x6f\x00"...], [{nla_len=8, nla_type=0xd}, 1000], [{nla_len=5, nla_type=0x10}, 2], [{nla_len=5, nla_type=0x11}, 0], [{nla_len=8, nla_type=0x4}, 65536], [{nla_len=8, nla_type=0x32}, 0], [{nla_len=8, nla_type=0x33}, 0], [{nla_len=8, nla_type=0x1b}, 0], [{nla_len=8, nla_type=0x1e}, 0], [{nla_len=8, nla_type=0x1f}, 1], [{nla_len=8, nla_type=0x28}, 65535], [{nla_len=8, nla_type=0x29}, 65536], [{nla_len=8, nla_type=0x3a}, 65536], [{nla_len=8, nla_type=0x3b}, 524280], [{nla_len=8, nla_type=0x3c}, 65535], [{nla_len=8, nla_type=0x20}, 1], [{nla_len=5, nla_type=0x21}, 1], [{nla_len=9, nla_type=0x6}, "\x6e\x6f\x6f\x70\x00"...], [{nla_len=8, nla_type=0x23}, 0], [{nla_len=8, nla_type=0x2f}, 0], [{nla_len=8, nla_type=0x30}, 0], [{nla_len=5, nla_type=0x27}, 0], [{nla_len=36, nla_type=0xe}, {mem_start=0, mem_end=0, base_addr=0, irq=0, dma=0, port=0}], [{nla_len=10, nla_type=0x1}, "\x00\x00\x00\x00\x00\x00"], [{nla_len=10, nla_type=0x2}, "\x00\x00\x00\x00\x00\x00"], [{nla_len=204, nla_type=0x17}, {rx_packets=0, tx_packets=0, rx_bytes=0, tx_bytes=0, rx_errors=0, tx_errors=0, rx_dropped=0, tx_dropped=0, multicast=0, collisions=0, rx_length_errors=0, rx_over_errors=0, rx_crc_errors=0, rx_frame_errors=0, rx_fifo_errors=0, rx_missed_errors=0, tx_aborted_errors=0, tx_carrier_errors=0, tx_fifo_errors=0, tx_heartbeat_errors=0, tx_window_errors=0, rx_compressed=0, tx_compressed=0, rx_nohandler=0, rx_otherhost_dropped=0}], [{nla_len=100, nla_type=0x7}, {rx_packets=0, tx_packets=0, rx_bytes=0, tx_bytes=0, rx_errors=0, tx_errors=0, rx_dropped=0, tx_dropped=0, multicast=0, collisions=0, rx_length_errors=0, rx_over_errors=0, rx_crc_errors=0, rx_frame_errors=0, rx_fifo_errors=0, rx_missed_errors=0, tx_aborted_errors=0, tx_carrier_errors=0, tx_fifo_errors=0, tx_heartbeat_errors=0, tx_window_errors=0, rx_compressed=0, tx_compressed=0, rx_nohandler=0}], [{nla_len=12, nla_type=0x2b}, [{nla_len=5, nla_type=0x2}, 0]], [{nla_len=424, nla_type=0x1a}, [[{nla_len=12, nla_type=0x2d}, [{nla_len=8, nla_type=0x1}, 1]], [{nla_len=140, nla_type=0x2}, [{nla_len=136, nla_type=0x1}, [[0] = 1, [1] = 0, [2] = 0, [3] = 1, [4] = 1, [5] = 1, [6] = 1, [7] = 0, [8] = 1, [9] = 0, [10] = 0, [11] = 0, [12] = 0, [13] = 0, [14] = 1, [15] = 1, [16] = 0, [17] = 0, [18] = 0, [19] = 0, [20] = 0, [21] = 0, [22] = 0, [23] = 0, [24] = 0, [25] = 0, [26] = 10000, [27] = 1000, [28] = 0, [29] = 0, [30] = 0, [31] = 0, [32] = 1]]], [{nla_len=268, nla_type=0xa}, [[{nla_len=8, nla_type=0x1}, 0], [{nla_len=20, nla_type=0x5}, {max_reasm_len=65535, tstamp=328391, reachable_time=21208, retrans_time=1000}], [{nla_len=236, nla_type=0x2}, [[0] = 0, [1] = 64, [2] = 65536, [3] = 1, [4] = 1, [5] = 1, [6] = 1, [7] = -1, [8] = 4000, [9] = 1000, [10] = -1, [11] = 604800, [12] = 86400, [13] = 3, [14] = 600, [15] = 16, [16] = 0, [17] = 1, [18] = 1, [19] = 1, [20] = 60000, [21] = 0, [22] = 0, [23] = 0, [24] = 0, [25] = 0, [26] = 0, [27] = -1, [28] = 0, [29] = 0, [30] = 10000, [31] = 1000, [32] = 1, [33] = 0, [34] = 0, [35] = 1, [36] = 0, [37] = 0, [38] = 1, [39] = 0, [40] = 0, [41] = 0, [42] = 0, [43] = 3600000, [44] = 0, [45] = 0, [46] = 1, [47] = 0, [48] = 0, [49] = 0, [50] = 0, [51] = 0, [52] = 1024, [53] = 0, [54] = 65535, [55] = -1, [56] = 1, [57] = 0]]]]]]]], iov_len=32768}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 1012
34402 close(4) = 0
34402 sendmsg(3, {msg_name={sa_family=0x10, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=[{nlmsg_len=32, nlmsg_type=0x10, nlmsg_flags=0x5, nlmsg_seq=1667727161, nlmsg_pid=0}, {ifi_family=0, ifi_type=0, ifi_index=1, ifi_flags=0x1, ifi_change=0x1}], iov_len=32}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 32
34402 recvmsg(3, {msg_name={sa_family=0x10, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=NULL, iov_len=0}], msg_iovlen=1, msg_controllen=0, msg_flags=0x20}, 0x22) = 36
34402 recvmsg(3, {msg_name={sa_family=0x10, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=[{nlmsg_len=36, nlmsg_type=0x2, nlmsg_flags=0x100, nlmsg_seq=1667727161, nlmsg_pid=34402}, {error=0, msg={nlmsg_len=32, nlmsg_type=0x10, nlmsg_flags=0x5, nlmsg_seq=1667727161, nlmsg_pid=0}}], iov_len=32768}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 36
34402 exit_group(0) = ?
34402 +++ exited with 0 +++
34400 --- SIGCHLD {si_signo=17, si_code=0x1, si_pid=34402, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
34400 rt_sigreturn({mask=[]}) = 34402
34400 read(10, "", 8192) = 0
34400 exit_group(0) = ?
34400 +++ exited with 0 +++
heyzzqq0103 commented 1 year ago

this tool syz-trace2syz's status is outdated now .

I used your example (tools/syz-trace2syz/trace2syz.go) to invoke strace:

strace -o trace -a 1 -s 65500 -v -xx -f -Xraw ls

Running trace2-syz for this trace made it log parsing errors, such as:

`panic: unknown target: linux/amd64 (supported: [])

goroutine 1 [running]: github.com/google/syzkaller/tools/syz-trace2syz/proggen.glob..func1() /root/syzkaller/tools/syz-trace2syz/proggen/fuzz.go:18 +0x105 github.com/google/syzkaller/tools/syz-trace2syz/proggen.init() /root/syzkaller/tools/syz-trace2syz/proggen/fuzz.go:25 +0x81d `

a-nogikh commented 1 year ago

To avoid the panic: unknown target: linux/amd64 (supported: []) problem, first compile syzkaller itself before compiling its individual tools. It auto-generates some necessary .go files as a part of its build process.

Or make sure you build the tool via make trace2syz rather than go build.