Skip to content

Commit 6e50d07

Browse files
committed
pkg/vminfo: fix up _etext symbol parsing
_etext symbol points to the _next_ section, so it has type of the next section. It can be at least T, D, or R in some cases: https://groups.google.com/g/syzkaller/c/LSx6YIK_Eeo
1 parent 6352fa4 commit 6e50d07

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/vminfo/linux.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ func linuxParseCoreKernel(files filesystem) (uint64, uint64, error) {
120120
if err != nil {
121121
return 0, 0, fmt.Errorf("address parsing error in /proc/kallsyms for _stext: %w", err)
122122
}
123-
re = regexp.MustCompile(`([a-fA-F0-9]+) [DT] _etext\n`)
123+
// _etext symbol points to the _next_ section, so it has type of the next section.
124+
// It can be at least T, D, or R in some cases:
125+
// https://groups.google.com/g/syzkaller/c/LSx6YIK_Eeo
126+
re = regexp.MustCompile(`([a-fA-F0-9]+) . _etext\n`)
124127
m = re.FindSubmatch(_Text)
125128
if m == nil {
126129
return 0, 0, fmt.Errorf("failed to get _etext symbol")

0 commit comments

Comments
 (0)