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)
Mar 16 2024, 7:18 AM
Unknown Object (File)
Feb 1 2024, 2:24 AM
Unknown Object (File)
Dec 26 2023, 11:00 PM
Unknown Object (File)
Nov 22 2023, 2:23 PM
Unknown Object (File)
Nov 22 2023, 2:21 PM
Unknown Object (File)
Nov 22 2023, 2:21 PM
Unknown Object (File)
Nov 21 2023, 4:15 PM
Unknown Object (File)
Nov 13 2023, 11:03 AM
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.