aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/symbolizer/nm_test.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-01-22 12:17:20 +0100
committerDmitry Vyukov <dvyukov@google.com>2020-01-22 12:19:53 +0100
commit02754a8f9af246f440492295487282e55dc09cc0 (patch)
tree728b59573a119421b2a5e2b89f965edc9ff6f93a /pkg/symbolizer/nm_test.go
parent8eda0b957e5b39c0c525e74f51d6b39ab8c5b1ac (diff)
tools/syz-check: check netlink policy descriptions
Overall idea of netlink checking. Currnetly we check netlink policies for common detectable mistakes. First, we detect what looks like a netlink policy in our descriptions (these are structs/unions only with nlattr/nlnext/nlnetw fields). Then we find corresponding symbols (offset/size) in vmlinux using nm. Then we read elf headers and locate where these symbols are in the rodata section. Then read in the symbol data, which is an array of nla_policy structs. These structs allow to easily figure out type/size of attributes. Finally we compare our descriptions with the kernel policy description. Update #590
Diffstat (limited to 'pkg/symbolizer/nm_test.go')
-rw-r--r--pkg/symbolizer/nm_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/symbolizer/nm_test.go b/pkg/symbolizer/nm_test.go
index 44a02f3cc..6061608ec 100644
--- a/pkg/symbolizer/nm_test.go
+++ b/pkg/symbolizer/nm_test.go
@@ -8,7 +8,7 @@ import (
)
func TestSymbols(t *testing.T) {
- symbols, err := ReadSymbols("testdata/nm.test.out")
+ symbols, err := ReadTextSymbols("testdata/nm.test.out")
if err != nil {
t.Fatalf("failed to read symbols: %v", err)
}