aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/report/linux_test.go
Commit message (Collapse)AuthorAgeFilesLines
* pkg/report: refactor Linux report symbolizationAleksandr Nogikh2025-06-181-3/+6
| | | | | | | | Parse and assemble Linux backtrace lines independently of whether vmlinux is present. Refactor the code to make it easier to insert more postprocessing actions.
* pkg: use kernelDir instead of 3 parametersTaras Madan2025-03-271-1/+3
| | | | It allows to reduce parameters count for some functions.
* all: remove loop variables scopingTaras Madan2025-02-171-1/+0
|
* pkg/report: support module format with stacktrace_build_idJoey Jiao2024-09-031-0/+6
| | | | | Call trace can have line like below printed by %pSb: func_name+0x254/0x5f0 [module_name b31b29679ab712c360bddd861f655ab24898b4db]
* pkg/report: remove args which already in ctxJoey Jiao2024-07-231-1/+1
|
* pkg/report: support to symbolize line with module+offsetJoey Jiao2024-07-231-11/+72
|
* tools/syz-linter: check t.Logf/Errorf/Fatalf messagesDmitry Vyukov2024-04-171-5/+5
| | | | | Fix checking of Logf, it has string in 0-th arg. Add checking of t.Errorf/Fatalf.
* all: ioutil is deprecated in go1.19 (#3718)Taras Madan2023-02-231-5/+5
|
* pkg/report: don't decompile opcodes for hanged reportsAleksandr Nogikh2022-07-121-15/+23
| | | | | | | It doesn't bring any extra value and only makes the reports bigger. Don't do such decompilation for hang-related reports. Refactor the opcode tests to rely more on the more generic NewReporter constructor.
* pkg/report: return more information from opcode decompilerAleksandr Nogikh2021-08-191-1/+6
| | | | | | | | Let decompiler also parse the exact command name. Perform right trim on the full output line, as it may contain tabs and spaces at the end. Introduce an "-update" flag to facilitate mass updating of opcode decompilation tests after changes to this functionality.
* pkg/report: run objdump-related tests only under LinuxAleksandr Nogikh2021-08-121-0/+5
| | | | | Restrict TestDisassemblyInReports from running on OSes other than Linux, as the exact resulting disassembly is dependent on that.
* pkg/report: decompile opcodes from reportsAleksandr Nogikh2021-08-121-0/+196
| | | | | | | | | | | Improve Linux reports quality by decompiling "Code: " descriptions. As that line of opcodes is not guaranteed to begin at the boundary of an instruction, try to find the right boundary. Handle the cases of multiple "Code: ..." lines by only decompiling the first one. In most cases the last such line shows user-space bytes, which is usually not of great importance.
* pkg/mgrconfig: move derived fields into separate structDmitry Vyukov2020-11-301-2/+4
| | | | | | Users should not be concerned with the internal derived fields. Move all derived fields into a separate struct before adding more. This leaves config.go as a better documentation for end users.
* sys/targets: add OS/Arch name constsDmitry Vyukov2020-10-261-2/+3
| | | | | | | | | | | | We use strings to identify OS/Arch. These strings are duplicated throughout the code base massively. golangci-lint points to possiblity of typos and duplication. We already had to define these names in pkg/csource and disable checking for prog package. A future change triggers such warnings in another package. Add OS/Arch name consts to sys/targets so that they can be used to refer to OS/Arch. Use the consts everywhere.
* pkg/report: fix linux path prefix trimmingDmitry Vyukov2019-07-231-1/+1
| | | | | | | | | | After f613a7c4 ("pkg/cover: fix prefix computation") we stopped trimming starting "/" from linux path names. This broke get_maintainers.pl script which is now given non-existent absolute paths (e.g. "/mm/mmap.c"), as the result syzbot can't find any maintainers for bug reports and mails them into lkml limbo. Trim starting slashes and dots. Extend tests for catch this.
* pkg/report: fix RIP line symbolizationDmitry Vyukov2018-12-151-1/+8
| | | | | | Don't subtract 1 for RIP lines. Fixes #361
* pkg/report: pass the target to each OS report constructorAnton Lindqvist2018-12-081-1/+2
| | | | | In order to use the already defined kernel name in sys/targets to reduce duplications.
* pkg/mgrconfig: move from syz-manager/mgrconfigDmitry Vyukov2018-08-021-1/+1
| | | | | | | | mgrconfig was used only by syz-manager initially, but now it's used by a dozen of packages and it's weird to import from under a binary dir. pkg/ is much more reasonable dir for a widely used helper package.
* .gometalinter.json: enable gofmtDmitry Vyukov2018-07-311-3/+3
| | | | | | | The part that we want from gofmt is simplify (-s). Fix all code that needs fixing. Update #538
* pkg/report: allow to specify suppressions per OSDmitry Vyukov2018-06-221-17/+11
| | | | | | | | | | | | | Currently all (linux-specific) suppressions are hardcoded in mgrconfig. This is very wrong. Move them to pkg/report and allow to specify per OS. Add gvisor-specific suppressions. This required a bit of refactoring. Introduce mgrconfig.KernelObj finally. Make report.NewReporter and vm.Create accept mgrconfig directly instead of passing it as multiple scattered args. Remove tools/syz-parse and it always did the same as tools/syz-symbolize. Simplify global vars in syz-manager/cover.go. Create reporter eagerly in manager. Use sort.Slice more. Overall -90 lines removed.
* pkg/report: pass vm type to NewReporterDmitry Vyukov2018-06-221-4/+4
| | | | | For the case when VM type affects output. Will be needed for gvisor. It is kinda linux, but kinda not.
* pkg/report: merge TestLinuxParseLog into TestParseDmitry Vyukov2017-12-121-154/+0
| | | | | | | | That was the last test that used inline input data. Merge it into TestParse. Test Output for all crashes in TestParse. Support multiple oopes in crash Add more test cases for start/end line.
* pkg/report: move guilty file test data to testdir/Dmitry Vyukov2017-12-121-861/+4
| | | | | | | | linux_test.go is total mess and very hard to work with. Turns out we had 2 tests that do exactly the same (verify Report), but nobody ever noticed. Move all test data to testdir/. One file per crash.
* pkg/report: move test data to testdir/Dmitry Vyukov2017-12-121-2501/+0
| | | | | | | | linux_test.go is total mess and very hard to work with. Turns out we had 2 tests that do exactly the same (verify Report), but nobody ever noticed. Move all test data to testdir/. One file per crash.
* pkg/report: bad unlock balance can be a WARNINGAndrey Konovalov2017-12-111-0/+43
|
* pkg/report: detect corrupted old-style KASAN reportsAndrey Konovalov2017-12-111-0/+76
|
* pkg/report: better detect corrupted stack tracesAndrey Konovalov2017-12-111-0/+40
| | | | | We may find stack frames from the second stack trace in a report when searching from frames of the first one.
* pkg/report: improve report header extractionAndrey Konovalov2017-12-111-49/+212
| | | | | | | | Allow stack traces to be intermixed with random kernel messages that don't start with a ' ' char (all frames in a stack trace do). Also improve report headers for BUGs from mm/usercopy.c, as we get quite a lot of those.
* pkg/report: fix corrupted call trace detectionAndrey Konovalov2017-12-081-0/+50
| | | | | linuxSymbolizeRe can match "IP: depot_fetch_stack+0x11/0x40", which is not part of the call stack trace. Add another regexp that only matches frames.
* pkg/report: add arch/*/mm/fault.c to guilty file blacklistAndrey Konovalov2017-12-081-0/+36
|
* pkg/report: fix report extractionAndrey Konovalov2017-12-081-55/+99
| | | | | | | | | | | Try extracting report from console output only first. If that doesn't work, try extracting it from the whole log. Add regexp for executor printed BUGs. Optimize regexps for rcu detected stalls. Update rep.StartPos and rep.EndPos in vm/vm.go as well as rep.Output.
* pkg/report: add proper oops format for kernel rebootDmitry Vyukov2017-12-051-22/+38
|
* pkg/report: add log parsing testAndrey Konovalov2017-12-051-0/+155
|
* pkg/report: fix out-of-bounds accessDmitry Vyukov2017-12-041-0/+7
| | | | Update #457
* pkg/report: extinguish panicsDmitry Vyukov2017-12-041-49/+56
| | | | | | | We see panic during report parsing as in #457. This does not really fix them, but should stop managers crashing. Update #457
* pkg/report: improve task hung report headersAndrey Konovalov2017-11-301-1/+133
|
* pkg/report: improve trying to register non-static key headerAndrey Konovalov2017-11-301-0/+48
|
* pkg/report: include Maintainers into reportDmitry Vyukov2017-11-291-1/+2
| | | | | | | | | | | | | | | | | | Currently getting a complete report requires a complex, multi-step dance (including getting information that external users are not interested in -- guilty file). Simplify interface down to 2 functions: Parse and Symbolize. Parse does what it did before, Symbolize symbolizes report and fills in maintainers. This simplifies both implementations of Reporter interface and all users of the interface. Potentially we could get this down to 1 function Parse that does everything. However, (1) Symbolize can fail, while Parse cannot, (2) usually we want to ignore (log) Symbolize errors, but otherwise proceed with the report, (3) repro does not need symbolization for all but the last report.
* pkg/report: improve bad unlock balance corruption detectionAndrey Konovalov2017-11-291-0/+63
|
* pkg/report: detect suspicious RCU usage report corruptionAndrey Konovalov2017-11-291-0/+44
|
* pkg/report: add sl*b.c to guilty blacklistAndrey Konovalov2017-11-291-1/+29
|
* pkg/report: fix corrupted stack trace detectionAndrey Konovalov2017-11-281-0/+61
| | | | Look for stack frames in the next 10 lines after 'Call Trace' instead of 3.
* pkg/report: various corrupted report detection improvementsAndrey Konovalov2017-11-231-7/+163
|
* pkg/report: fix corrupted reports detectionAndrey Konovalov2017-11-221-162/+112
| | | | | Add another regexp to oopses that should match the whole report. Report is considered corrupted when it doesn't.
* pkg/report: fix corrupted KASAN reports detectionAndrey Konovalov2017-11-221-0/+40
| | | | KASAN report might not have Allocated or Freed stack traces at all.
* pkg/report: corrupted report detection fixesAndrey Konovalov2017-11-221-4/+4
|
* pkg/report, pkg/repro, syz-manager: name crash attributes consistentlyDmitry Vyukov2017-11-141-12/+12
| | | | | | | | | We currently have several names for crash attributes, which is disturbing. E.g. crash title is called "Title" or "Desc". Name them consistently. Title - single line bug identity. Report - whole crash text. Log - whole fuzzer/kernel output.
* pkg/report: combine report data into a structDmitry Vyukov2017-11-141-28/+28
| | | | | Parse returns 5 variables now. Later we may want to add crash "priority". Introduce Report struct that holds all report data.
* pkg/report: add corrupted report detectionAndrey Konovalov2017-11-131-467/+873
| | | | | This change makes pkg/report try to detect corrupted reports by using some heuristics.
* pkg/report: more linux spinlock oops messagesDmitry Vyukov2017-10-221-0/+26
|