diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2024-06-28 16:33:04 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-07-01 13:48:43 +0000 |
| commit | a6f99ace4014896f81a2f101416fd5413579f2bd (patch) | |
| tree | c6ace6c5a8736261fd462e83e19bbb88bd1a2ee3 /sys/targets | |
| parent | 1f0ee43044bc8fc00bc1eccc85a93bf2b9972dd1 (diff) | |
pkg/rpcserver: move kernel test/data range checks from executor
We see some errors of the form:
SYZFAIL: coverage filter is full
pc=0x80007000c0008 regions=[0xffffffffbfffffff 0x243fffffff 0x143fffffff 0xc3fffffff] alloc=156
Executor shouldn't send non kernel addresses in signal,
but somehow it does. It can happen if the VM memory is corrupted,
or if the test program does something very nasty (e.g. discovers
the output region and writes to it).
It's not possible to reliably filter signal in the tested VM.
Move all of the filtering logic to the host.
Fixes #4942
Diffstat (limited to 'sys/targets')
| -rw-r--r-- | sys/targets/targets.go | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/sys/targets/targets.go b/sys/targets/targets.go index fd5d6f10c..a623dbfb6 100644 --- a/sys/targets/targets.go +++ b/sys/targets/targets.go @@ -42,6 +42,7 @@ type Target struct { HostEndian binary.ByteOrder SyscallTrampolines map[string]string Addr2Line func() (string, error) + KernelAddresses KernelAddresses init *sync.Once initOther *sync.Once @@ -50,6 +51,16 @@ type Target struct { timeouts Timeouts } +// KernelAddresses contain approximate rounded up kernel text/data ranges +// that are used to filter signal and comparisons for bogus/unuseful entries. +// Zero values mean no filtering. +type KernelAddresses struct { + TextStart uint64 + TextEnd uint64 + DataStart uint64 + DataEnd uint64 +} + func (target *Target) HasCallNumber(callName string) bool { return target.SyscallNumbers && !strings.HasPrefix(callName, "syz_") } @@ -259,6 +270,15 @@ var List = map[string]map[string]*Target{ // (added after commit 8a1ab3155c2ac on 2012-10-04). return nr >= 313 }, + KernelAddresses: KernelAddresses{ + // Text/modules range for x86_64. + TextStart: 0xffffffff80000000, + TextEnd: 0xffffffffff000000, + // This range corresponds to the first 1TB of the physical memory mapping, + // see Documentation/arch/x86/x86_64/mm.rst. + DataStart: 0xffff880000000000, + DataEnd: 0xffff890000000000, + }, }, I386: { VMArch: AMD64, @@ -655,6 +675,15 @@ func init() { if runtime.GOOS == OpenBSD { target.BrokenCompiler = "can't build TestOS on OpenBSD due to missing syscall function." } + // These are used only for pkg/runtest tests, executor also knows about these values. + target.KernelAddresses.TextStart = 0xc0dec0dec0000000 + target.KernelAddresses.TextEnd = 0xc0dec0dec1000000 + if target.PtrSize == 4 { + target.KernelAddresses.TextStart = uint64(uint32(target.KernelAddresses.TextStart)) + target.KernelAddresses.TextEnd = uint64(uint32(target.KernelAddresses.TextEnd)) + } + target.KernelAddresses.DataStart = 0xda1a0000 + target.KernelAddresses.DataEnd = 0xda1a1000 } } |
