lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0C18FE92A7765D4EB9EE5D38D86A563A01C9356F@SHSMSX103.ccr.corp.intel.com>
Date:	Tue, 10 Mar 2015 13:20:02 +0000
From:	"Du, Changbin" <changbin.du@...el.com>
To:	Tejun Heo <tj@...nel.org>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] workqueue: detect uninitated work_struct and BUG() if
 true

> -----Original Message-----
> From: Tejun Heo [mailto:htejun@...il.com] On Behalf Of Tejun Heo
> Sent: Monday, March 9, 2015 2:23 PM
> To: Du, Changbin
> Cc: linux-kernel@...r.kernel.org
> Subject: Re: [PATCH] workqueue: detect uninitated work_struct and BUG() if
> true
> > @@ -1295,6 +1295,9 @@ static void __queue_work(int cpu, struct
> workqueue_struct *wq,
> >  	 */
> >  	WARN_ON_ONCE(!irqs_disabled());
> >
> > +	if (!work->func)
> > +		BUG();
> > +
> >  	debug_work_activate(work);
> 
> Can't this be part of the debug_work mechanism?  I'm a bit wary of adding
> essentially arbitrary checks.  I'd much prefer if it gets gated by debug config
> somehow.
> 
> Thanks.
> Tejun

Yes, I found there already have this checking and print a warning in work_fixup_activate.
So this patch can be droped. Thanks for point out.

static int work_fixup_activate(void *addr, enum debug_obj_state state)
{
	struct work_struct *work = addr;

	switch (state) {

	case ODEBUG_STATE_NOTAVAILABLE:
		/*
		 * This is not really a fixup. The work struct was
		 * statically initialized. We just make sure that it
		 * is tracked in the object tracker.
		 */
		if (test_bit(WORK_STRUCT_STATIC_BIT, work_data_bits(work))) {
			debug_object_init(work, &work_debug_descr);
			debug_object_activate(work, &work_debug_descr);
			return 0;
		}
		WARN_ON_ONCE(1);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ