diff options
| author | Du, Changbin <[email protected]> | 2016-05-19 17:09:41 -0700 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2016-05-19 19:12:14 -0700 |
| commit | b9fdac7f660609abb157500e468d2165b3c9cf08 (patch) | |
| tree | 37d3b704f52b46dfb6d9ebb24611870dbb2b93be /include/linux/timerqueue.h | |
| parent | 8bad1cd0e1edd124c0f05f925762ef84e6047586 (diff) | |
debugobjects: insulate non-fixup logic related to static obj from fixup callbacks
When activating a static object we need make sure that the object is
tracked in the object tracker. If it is a non-static object then the
activation is illegal.
In previous implementation, each subsystem need take care of this in
their fixup callbacks. Actually we can put it into debugobjects core.
Thus we can save duplicated code, and have *pure* fixup callbacks.
To achieve this, a new callback "is_static_object" is introduced to let
the type specific code decide whether a object is static or not. If
yes, we take it into object tracker, otherwise give warning and invoke
fixup callback.
This change has paassed debugobjects selftest, and I also do some test
with all debugobjects supports enabled.
At last, I have a concern about the fixups that can it change the object
which is in incorrect state on fixup? Because the 'addr' may not point
to any valid object if a non-static object is not tracked. Then Change
such object can overwrite someone's memory and cause unexpected
behaviour. For example, the timer_fixup_activate bind timer to function
stub_timer.
Link: http://lkml.kernel.org/r/[email protected]
[[email protected]: improve code comments where invoke the new is_static_object callback]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Du, Changbin <[email protected]>
Cc: Jonathan Corbet <[email protected]>
Cc: Josh Triplett <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Christian Borntraeger <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'include/linux/timerqueue.h')
0 files changed, 0 insertions, 0 deletions