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:	Fri, 17 Jul 2009 18:43:46 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	Catalin Marinas <catalin.marinas@....com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	"Paul E. McKenney" <paulmck@...ibm.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH] kmemleak: Scan all thread stacks


* Catalin Marinas <catalin.marinas@....com> wrote:

> This patch changes the for_each_process() loop with the
> do_each_thread()/while_each_thread() pair. It also replaces the
> read_lock(&tasklist_lock) with rcu_read_lock() and task_lock(p).
> 
> Signed-off-by: Catalin Marinas <catalin.marinas@....com>
> ---
> 
> My questions:
> 
> 1. Is it correct that for_each_process() used currently by kmemleak may
>    not loop through all the possible kernel thread stacks?

yes. You need the full, all tasks variant:

        do_each_thread(g, p) {
        ...
        } while_each_thread(g, p);


> 2. Is it safe to use rcu_read_lock() and task_lock() when scanning the
>    corresponding kernel stack (thread_info structure)? The loop doesn't
>    do any modification to the task list. The reason for this is to
>    allow kernel preemption when scanning the stacks.

you cannot generally preempt while holding the RCU read-lock.

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