Page MenuHomeFreeBSD

memstat_kvm_uma: fix reading of uma_zone_domain structures
ClosedPublic

Authored by vangyzen on Aug 27 2020, 3:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 25, 5:35 PM
Unknown Object (File)
Mar 22 2024, 9:28 PM
Unknown Object (File)
Mar 22 2024, 9:28 PM
Unknown Object (File)
Mar 22 2024, 9:28 PM
Unknown Object (File)
Mar 8 2024, 8:32 AM
Unknown Object (File)
Mar 7 2024, 8:17 PM
Unknown Object (File)
Feb 23 2024, 6:12 AM
Unknown Object (File)
Jan 4 2024, 10:07 PM
Subscribers

Details

Summary

Coverity flagged the scaling by sizeof(uzd). That is the type
of the pointer, so the scaling was already done by pointer arithmetic.
However, this was also passing a stack frame pointer to kvm_read,
so it was doubly wrong.

Move ZDOM_GET into the !_KERNEL section and use it in libmemstat.

Reported by: Coverity

Test Plan

I ran this against a vmcore file and it still printed some garbage
stats, but the printf I added for debugging no longer complained.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 33195
Build 30542: arc lint + arc unit

Event Timeline

markj added inline comments.
sys/vm/uma_int.h
531

Fix the indent to be consistent while you're here?

This revision is now accepted and ready to land.Aug 27 2020, 3:39 PM