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: <87k42pz66x.fsf@rustcorp.com.au>
Date:	Tue, 13 Mar 2012 11:07:58 +1030
From:	Rusty Russell <rusty@...tcorp.com.au>
To:	Eric Dumazet <eric.dumazet@...il.com>,
	Cong Wang <xiyou.wangcong@...il.com>
Cc:	linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Subject: Re: [PATCH 1/2] module: use rcu to protect module list read

On Sat, 10 Mar 2012 07:25:57 -0800, Eric Dumazet <eric.dumazet@...il.com> wrote:
> Le samedi 10 mars 2012 à 22:20 +0800, Cong Wang a écrit :
> > Now the read of module list is protected by preempt disable + *_rcu
> > list operations, this is odd, as RCU read lock should be able to
> > protect it directly. This patch makes the read of module list
> > protected by RCU read lock and the write still protected by
> > module_mutex.
> > 
> 
> Problem is that your patch does more than that.
> 
> In set_all_modules_text_rw() and set_all_modules_text_ro() you removed
> the mutex in favor of rcu_read_lock()
> 
> Also, module code uses synchronize_sched(), not synchronize_rcu()

Yes, but only for paranoia.  Really, it's vs. stop_machine().

> Take a look at Documentation/RCU/whatisRCU.txt and see that
> preempt_disable() / preempt_enable() are documented as a right protect
> code, in line 333.
> 
> You added races in /proc/modules as well.

I'm surprised that patch didn't warn... CONFIG_DEBUG_ATOMIC_SLEEP=y
might help here....

Cheers,
Rusty.
-- 
  How could I marry someone with more hair than me?  http://baldalex.org
--
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