mirror of
https://github.com/reactos/syzkaller.git
synced 2024-11-24 03:49:45 +00:00
pkg/report: fix crash during output parsing
The test case causes rep.StartPos == secondReportPos, which then makes extraction of description fail, because report is empty.
This commit is contained in:
parent
d50edb7e5c
commit
7166783e9b
@ -133,10 +133,12 @@ func (ctx *linux) Parse(output []byte) *Report {
|
||||
}
|
||||
continue
|
||||
}
|
||||
rep.EndPos = next
|
||||
if oops == nil {
|
||||
oops = oops1
|
||||
rep.StartPos = pos
|
||||
rep.Title = string(output[pos+match : next])
|
||||
break
|
||||
} else if secondReportPos == 0 {
|
||||
ignored := false
|
||||
for _, ignore := range ctx.reportStartIgnores {
|
||||
@ -149,7 +151,6 @@ func (ctx *linux) Parse(output []byte) *Report {
|
||||
secondReportPos = pos
|
||||
}
|
||||
}
|
||||
rep.EndPos = next
|
||||
}
|
||||
if oops == nil {
|
||||
logReportPrefix = append(logReportPrefix, append([]byte{}, line...))
|
||||
@ -221,7 +222,10 @@ func (ctx *linux) Parse(output []byte) *Report {
|
||||
reportPrefix = logReportPrefix
|
||||
title, corrupted, format = extractDescription(report, oops, linuxStackParams)
|
||||
if title == "" {
|
||||
panic(fmt.Sprintf("non matching oops for %q in:\n%s", oops.header, report))
|
||||
panic(fmt.Sprintf("non matching oops for %q in:\n%s\n\nconsole:\n%s\n"+
|
||||
"output [range:%v-%v]:\n%s\n",
|
||||
oops.header, report, consoleReport[:firstReportEnd],
|
||||
rep.StartPos, secondReportPos, output))
|
||||
}
|
||||
}
|
||||
rep.Title = title
|
||||
|
9
pkg/report/testdata/linux/report/217
vendored
Normal file
9
pkg/report/testdata/linux/report/217
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
TITLE: BUG: unable to handle kernel paging request in foo_ioctl
|
||||
CORRUPTED: Y
|
||||
|
||||
foo
|
||||
|
||||
[ 76.470085] syz-executor7: vmalloc: allocation failure: 34359738352 bytes[ 76.471107] BUG: unable to handle kernel paging request at ffffffffa4493138
|
||||
[ 76.471114] IP: [<ffffffff824164eb>] foo_ioctl+0x129b/0x2280
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user