diff options
author | Dean Deng <deandeng@google.com> | 2020-10-19 18:07:38 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-10-19 18:09:39 -0700 |
commit | dcc1b71f1ba47646808f61cc86e560179c233af2 (patch) | |
tree | 3e5c56a972f7d8ea96ead15b7b8404f0a6b2a1b8 /pkg/sentry/kernel/kcov_unsafe.go | |
parent | 2a4ec9cf765608de6c11b9a68ea3a0dfea533967 (diff) |
Fix reference counting on kcov mappings.
Reported-by: syzbot+078580ce5dd6d607fcd8@syzkaller.appspotmail.com
Reported-by: syzbot+2096681f6891e7bf8aed@syzkaller.appspotmail.com
PiperOrigin-RevId: 337973519
Diffstat (limited to 'pkg/sentry/kernel/kcov_unsafe.go')
-rw-r--r-- | pkg/sentry/kernel/kcov_unsafe.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/sentry/kernel/kcov_unsafe.go b/pkg/sentry/kernel/kcov_unsafe.go index 6f64022eb..6f8a0266b 100644 --- a/pkg/sentry/kernel/kcov_unsafe.go +++ b/pkg/sentry/kernel/kcov_unsafe.go @@ -20,9 +20,9 @@ import ( "gvisor.dev/gvisor/pkg/safemem" ) -// countBlock provides a safemem.BlockSeq for k.count. +// countBlock provides a safemem.BlockSeq for kcov.count. // // Like k.count, the block returned is protected by k.mu. -func (k *Kcov) countBlock() safemem.BlockSeq { - return safemem.BlockSeqOf(safemem.BlockFromSafePointer(unsafe.Pointer(&k.count), int(unsafe.Sizeof(k.count)))) +func (kcov *Kcov) countBlock() safemem.BlockSeq { + return safemem.BlockSeqOf(safemem.BlockFromSafePointer(unsafe.Pointer(&kcov.count), int(unsafe.Sizeof(kcov.count)))) } |