lkml.org 
[lkml]   [2016]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] debugobjects: insulate non-fixup logic related to static obj from fixup callbacks
Date
> From: Thomas Gleixner [mailto:tglx@linutronix.de]
> Can you please fix your mail client. Every mail you send has:
>
> Cc: .....
> "Du, Changbin" <changbin.du@intel.com>,
> Du
>
> And that stray 'Du' is just broken.
>
Yes, I should add "" around my name or fix the git-sendemail perl script.
The script may add a "" auto. :)

> > 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.
>
> Well, you have the choice of:
>
> 1) Leave the object uninitialized and watch the resulting explosion
>
> 2) Assume that the pointer is a valid object and initialize it
>
> The latter has been chosen as the lesser of two evils.
>
Hmm, seems nothing more we can do to reduce further damage.

> > raw_spin_unlock_irqrestore(&db->lock, flags);
> > /*
> > - * Maybe the object is static. Let the type specific
> > + * Maybe the object is static. Let the type specific
> > * code decide what to do.
>
> Instead of doing white space changes you really want to explain the logic
> here.
>
Comments is in following code.

> > */
> > - if (debug_object_fixup(descr->fixup_assert_init, addr,
> > - ODEBUG_STATE_NOTAVAILABLE))
> > + if (descr->is_static_object && descr->is_static_object(addr))
> {
> > + /* Make sure that it is tracked in the object tracker */
> > + debug_object_init(addr, descr);
> > + } else {
> > debug_print_object(&o, "assert_init");
> > + debug_object_fixup(descr->fixup_assert_init, addr,
> > + ODEBUG_STATE_NOTAVAILABLE);
> > + }
> > return;
> > }
>
> Other than the missing comment this looks good.
>
> Thanks,
>
> tglx

Thanks for reviewing.
Du, Changbin

\
 
 \ /
  Last update: 2016-05-08 10:01    [W:0.067 / U:2.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site