Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1396280

Re: [PATCH] debugobjects: insulate non-fixup logic related to static obj from fixup callbacks

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject Re: [PATCH] debugobjects: insulate non-fixup logic related to static obj from fixup callbacks
Date Sat, 07 May 2016 10:30:01 +0200
Message-ID <rw5MB-6pI-1@gated-at.bofh.it> (permalink)
References <rvXm2-6qk-3@gated-at.bofh.it>
User-Agent Alpine 2.11 (DEB 23 2013-08-11)
MIME-Version 1.0
Content-Type TEXT/PLAIN; charset=US-ASCII
X-Linutronix-Spam-Score -1.0
X-Linutronix-Spam-Level -
X-Linutronix-Spam-Status No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 53
Organization linux.* mail to news gateway
X-Original-Cc Andrew Morton <akpm@linux-foundation.org>, "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>, josh@joshtriplett.org, Steven Rostedt <rostedt@goodmis.org>, Mathieu Desnoyers <mathieu.desnoyers@efficios.com>, jiangshanlai@gmail.com, John Stultz <john.stultz@linaro.org>, Tejun Heo <tj@kernel.org>, LKML <linux-kernel@vger.kernel.org>
X-Original-Date Sat, 7 May 2016 10:26:28 +0200 (CEST)
X-Original-Message-ID <alpine.DEB.2.11.1605071024440.3540@nanos>
X-Original-References <1462576157-14539-1-git-send-email-changbin.du@intel.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1396280

Show key headers only | View raw


On Sat, 7 May 2016, changbin.du@intel.com wrote:

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.

> 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.

>  		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.

>  		 */
> -		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

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] debugobjects: insulate non-fixup logic related to static obj from fixup callbacks changbin.du@intel.com - 2016-05-07 01:30 +0200
  Re: [PATCH] debugobjects: insulate non-fixup logic related to static  obj from fixup callbacks kbuild test robot <lkp@intel.com> - 2016-05-07 02:20 +0200
  Re: [PATCH] debugobjects: insulate non-fixup logic related to static  obj from fixup callbacks Thomas Gleixner <tglx@linutronix.de> - 2016-05-07 10:30 +0200
    Re: [PATCH] debugobjects: insulate non-fixup logic related to static  obj from fixup callbacks "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-05-07 14:50 +0200
    RE: [PATCH] debugobjects: insulate non-fixup logic related to  static obj from fixup callbacks "Du, Changbin" <changbin.du@intel.com> - 2016-05-08 09:50 +0200
      RE: [PATCH] debugobjects: insulate non-fixup logic related to static  obj from fixup callbacks Thomas Gleixner <tglx@linutronix.de> - 2016-05-08 18:20 +0200
        RE: [PATCH] debugobjects: insulate non-fixup logic related to  static obj from fixup callbacks "Du, Changbin" <changbin.du@intel.com> - 2016-05-09 05:10 +0200
        [PATCH v2] debugobjects: insulate non-fixup logic related to static obj from fixup callbacks changbin.du@intel.com - 2016-05-09 09:20 +0200

csiph-web