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] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0610271347320.3849@g5.osdl.org>
Date:	Fri, 27 Oct 2006 13:48:54 -0700 (PDT)
From:	Linus Torvalds <torvalds@...l.org>
To:	Andrew Morton <akpm@...l.org>
cc:	Stephen Hemminger <shemminger@...l.org>,
	Pavel Machek <pavel@....cz>, Greg KH <greg@...ah.com>,
	Matthew Wilcox <matthew@....cx>, Adrian Bunk <bunk@...sta.de>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	linux-pci@...ey.karlin.mff.cuni.cz
Subject: Re: [patch] drivers: wait for threaded probes between initcall levels



On Fri, 27 Oct 2006, Linus Torvalds wrote:

> 
> 	static int do_in_parallel(void *arg)
> 	{
> 		struct thread_exec *p = arg;
> 		int (*fn)(void *) = p->fn;
> 		void *arg = p->arg;
> 		int retval;
> 
> 		/* Tell the caller we are done with the arguments */
> 		complete(&p->completion);
> 
> 		/* Do the actual work in parallel */
> 		retval = p->fn(p->arg);

Duh. The whole reason I copied them was to _not_ do that. That last line 
should obviously be

		retval = fn(arg);

because "p" may gone after we've done the "complete()".

> (And I repeat: the above code is untested, and was written in the email 
> client. It has never seen a compiler, and not gotten a _whole_ lot of 
> thinking).

.. This hasn't changed, I just looked through the code once and found that 
obvious bug.


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