ocstat
Matthew Dillon
dillon at apollo.backplane.com
Wed Jun 4 10:35:53 PDT 2008
:We could enable invariant functions on the objcache, i.e. checking for=20
:conformity on put and get (detects tampering while free and with a flag, =
:
:detects double free). In itself it would be quite hard to detect a doubl=
:e=20
:free, as we are storing typed objects and thus we can't change anything i=
:n=20
:the object to signal "has been freed".
:
:cheers
: simon
I think we could do this fairly easily. Because the structures are
typed the objcache could be 'told' which offset within the structure
it is allowed to use to store its free marker and what value it should
use. Something like this:
objcache_marker(oc, offset_of_marker, marker_flag)
The objcache will set the specified flag at the specified offset
within the object when freeing the object, and clear the flag
upon allocation. The flag is typically a bit and the offset is
typically the offset of an integer flags field within the object.
The flag must not normally be set in an active object.
Objcache will use the flag to detect double-frees.
-Matt
More information about the Kernel
mailing list