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]
Date:	Wed, 11 Apr 2007 10:22:58 -0600
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	Oleg Nesterov <oleg@...sign.ru>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Davide Libenzi <davidel@...ilserver.org>,
	Jan Engelhardt <jengelh@...ux01.gwdg.de>,
	Ingo Molnar <mingo@...e.hu>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Robin Holt <holt@....com>, Roland McGrath <roland@...hat.com>,
	"Serge E. Hallyn" <serge@...lyn.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kthread: Don't depend on work queues

Oleg Nesterov <oleg@...sign.ru> writes:

> On 04/10, Eric W. Biederman wrote:
>> 
>>  static int kthread(void *_create)
>>  {
>>  	struct kthread_create_info *create = _create;
>>  	int (*threadfn)(void *data);
>>  	void *data;
>> -	sigset_t blocked;
>>  	int ret = -EINTR;
>>  
>> -	kthread_exit_files();
>> -
>> -	/* Copy data: it's on keventd's stack */
>> +	/* Copy data: it's on kthread's stack */
>>  	threadfn = create->threadfn;
>>  	data = create->data;
>>  
>> -	/* Block and flush all signals (in case we're not from keventd). */
>> -	sigfillset(&blocked);
>> -	sigprocmask(SIG_BLOCK, &blocked, NULL);
>> -	flush_signals(current);
>> -
>> -	/* By default we can run anywhere, unlike keventd. */
>> -	set_cpus_allowed(current, CPU_MASK_ALL);
>
> The above is OK, but I believe you should add set_cpus_allowed() to
> kthreadd_setup(). Note that kthreadd() is forked after init_idle().

init_idle()?  Yep in sched_init.  I wondered where that happened
for the initial idle thread.  Ugh. That is the first thing that
we fix after we fork init as well.  So yes it would be a good
idea to fix that...

I was expecting init_idle() to happen after we forked kthreadd. I almost
wonder if I should move init_idle....

Anyway that is one bug caught.

Eric

-
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