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: <20100412183251.GA13391@redhat.com>
Date:	Mon, 12 Apr 2010 20:32:51 +0200
From:	Oleg Nesterov <oleg@...hat.com>
To:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Cc:	Valdis.Kletnieks@...edu, Andrew Morton <akpm@...ux-foundation.org>,
	Ingo Molnar <mingo@...e.hu>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	linux-kernel@...r.kernel.org
Subject: Re: mmotm 2010-04-05 - another RCU whinge (not network this time)

On 04/09, Paul E. McKenney wrote:
>
> > Oleg, looks like proc-make-collect_sigign_sigcatch-rcu-safe.patch is the
> > offender here, it added the line that causes the whinge.
>
> If collect_sigign_sigcatch() is OK to call by updaters as well as
> readers, we need something like:
>
> 	struct sighand_struct *sighand;
> 	
> 	sighand = rcu_dereference_check(p->sighand,
> 					rcu_read_lock_held() ||
> 					lockdep_is_held(&???));
>
> Where the "???" is replaced with whichever of the two locks is protecting
> updates.  My guess would be the sighand lock, but I would not rely on
> my guesses in this case.  ;-)

Yes, it should be p->sighand->siglock.

Actually, I was going to change another caller, do_task_stat(), to call
collect_sigign_sigcatch() without ->siglock too, but now I am not sure
when/if this will happen.

OK, thanks, I'll send the patch to make rcu_dereference_check() happy.




While we are here... __exit_signal() does

	sighand = rcu_dereference_check(tsk->sighand,
					rcu_read_lock_held() ||
					lockdep_tasklist_lock_is_held());

What is the point? We know that the single caller must hold tasklist,
otherwise everything is broken. Perhaps it would be better to
use rcu_dereference_raw() ?

In fact, I don't really understand why __exit_signal() needs
rcu_dereference() at all.

Oleg.

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