Skip to content

Commit 17d36e5

Browse files
markjdba-nogikh
authored andcommitted
sys/targets: add a kernel address range for FreeBSD/amd64 kernels
After some time, my FreeBSD fuzzing runs start to hit frequent "coverage filter is full" SYZFAILs, caused by garbage PC values. Some assertions in kcov convinced me that PC values exported by the kernel are in the expected range, so it appears that the executor is corrupting them somehow. In particular, we leave the first page of each kcov mapping writeable since the interface to clear the trace buffer involves overwriting the first quadword. Sanitize kernel PC values so that we don't fill up the coverage filter with bogus values.
1 parent 1e7a43e commit 17d36e5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sys/targets/targets.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,12 @@ var List = map[string]map[string]*Target{
357357
// freebsd_12_shm_open, shm_open2, shm_rename, __realpathat, close_range, copy_file_range
358358
return nr == 482 || nr >= 569
359359
},
360+
KernelAddresses: KernelAddresses{
361+
// On amd64 the kernel and KLDs are loaded into the top
362+
// 2GB of the kernel address space.
363+
TextStart: 0xffffffff80000000,
364+
TextEnd: 0xffffffffffffffff,
365+
},
360366
},
361367
ARM64: {
362368
PtrSize: 8,

0 commit comments

Comments
 (0)