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:	Thu, 02 Feb 2012 13:20:18 +0400
From:	Dmitry Antipov <dmitry.antipov@...aro.org>
To:	Eric Dumazet <eric.dumazet@...il.com>
CC:	linux-kernel@...r.kernel.org
Subject: Re: Module/kthread/printk question/problem

On 02/02/2012 11:45 AM, Eric Dumazet wrote:

> Remove the wait_for_completion(), this brings nothing at all, as you
> already discovered.

I want to get the module 'locked' until all threads are completed.

> Then you need cooperation from worker threads : they must wait for
> kthread_should_stop(), or else your kthread_stop(arg) pass an already
> freed "arg" memory block.

I designed the cooperation in another way: after each successful call
of X = kthread_run(...), I do get_task_struct(X), and the module exit
code is something like:

...
wait_for_completion(&done);
for (i = 0; i < nrthreads; i++) {
	kthread_stop(threads[i]);
	put_task_struct(threads[i]);
}
kfree(threads);
...

The crash is go away, so I believe this is reasonable. Anyway, it would
be nice to have a debug option to detect such a suspicious errors.

Thanks,
Dmitry
--
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