From 02754a8f9af246f440492295487282e55dc09cc0 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 22 Jan 2020 12:17:20 +0100 Subject: 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 --- pkg/report/linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/report/linux.go') diff --git a/pkg/report/linux.go b/pkg/report/linux.go index ac9a78ee5..968bc1692 100644 --- a/pkg/report/linux.go +++ b/pkg/report/linux.go @@ -38,7 +38,7 @@ func ctorLinux(cfg *config) (Reporter, []string, error) { if cfg.kernelObj != "" { vmlinux = filepath.Join(cfg.kernelObj, cfg.target.KernelObject) var err error - symbols, err = symbolizer.ReadSymbols(vmlinux) + symbols, err = symbolizer.ReadTextSymbols(vmlinux) if err != nil { return nil, nil, err } -- cgit mrf-deployment