diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2024-12-05 11:55:49 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-12-05 12:40:35 +0000 |
| commit | 6e50d07bee3b03370f797eaf024fa41ce74da61b (patch) | |
| tree | 50e2194f577fb74e349bed7b2fbe93fd31960a70 /pkg | |
| parent | 6352fa41a008e032412d094aeda8602d406ae464 (diff) | |
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
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/vminfo/linux.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/vminfo/linux.go b/pkg/vminfo/linux.go index 52f6982b2..d32823c29 100644 --- a/pkg/vminfo/linux.go +++ b/pkg/vminfo/linux.go @@ -120,7 +120,10 @@ func linuxParseCoreKernel(files filesystem) (uint64, uint64, error) { if err != nil { return 0, 0, fmt.Errorf("address parsing error in /proc/kallsyms for _stext: %w", err) } - re = regexp.MustCompile(`([a-fA-F0-9]+) [DT] _etext\n`) + // _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 + re = regexp.MustCompile(`([a-fA-F0-9]+) . _etext\n`) m = re.FindSubmatch(_Text) if m == nil { return 0, 0, fmt.Errorf("failed to get _etext symbol") |
