Page MenuHomeFreeBSD

Fix memguard(9) when INVARIANTS is enabled.
ClosedPublic

Authored by markj on May 25 2016, 7:09 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 16, 11:49 AM
Unknown Object (File)
Oct 24 2024, 8:17 AM
Unknown Object (File)
Oct 5 2024, 5:01 AM
Unknown Object (File)
Sep 27 2024, 10:28 AM
Unknown Object (File)
Sep 27 2024, 10:28 AM
Unknown Object (File)
Sep 27 2024, 10:23 AM
Unknown Object (File)
Sep 26 2024, 6:46 AM
Unknown Object (File)
Sep 24 2024, 4:14 PM
Subscribers

Details

Summary

With r284861, zones use the trash ctor and dtor by default. This is
incompatible with memguard. Modify the UMA debug functions to be
no-ops if the item was allocated from memguard. This also fixes ctors
such as mb_ctor_pack(), which invokes the trash ctor in addition to
performing some initialization.

Test Plan

Added a sysctl-controlled use-after-free to the filedesc0 zone and verified that memguard caught it when enabled, and that the trash ctor caught it otherwise.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj retitled this revision from to Fix memguard(9) when INVARIANTS is enabled..
markj edited the test plan for this revision. (Show Details)
markj updated this object.
markj added a reviewer: glebius.

I missed the r284861. I don't like it, since it creates extra CPU cycles for non-INVARIANTS kernel. First I'd like to see that addressed, and then get bug to MEMGUARD issue.

Of course my previous comment was wrong. I need to spend more time reviewing before commenting. Sorry.

I missed the r284861. I don't like it, since it creates extra CPU cycles for non-INVARIANTS kernel. First I'd like to see that addressed, and then get bug to MEMGUARD issue.

How does it affect a non-INVARIANTS kernel?

glebius edited edge metadata.
This revision is now accepted and ready to land.Jun 1 2016, 6:04 PM
This revision was automatically updated to reflect the committed changes.