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: <200803041221.05434.rusty@rustcorp.com.au>
Date:	Tue, 4 Mar 2008 12:21:05 +1100
From:	Rusty Russell <rusty@...tcorp.com.au>
To:	Andi Kleen <andi@...stfloor.org>
Cc:	Max Krasnyanskiy <maxk@...lcomm.com>, Tejun Heo <htejun@...il.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Kathy Staples <kathy.staples@....ibm.com>
Subject: Re: Module loading/unloading and "The Stop Machine"

On Friday 22 February 2008 22:53:50 Andi Kleen wrote:
> Max Krasnyanskiy <maxk@...lcomm.com> writes:
> > static struct module *load_module(void __user *umod,
> >                                  unsigned long len,
> >                                  const char __user *uargs)
> > {
> >      ...
> >
> >      /* Now sew it into the lists so we can get lockdep and oops
> >         * info during argument parsing.  Noone should access us, since
> >         * strong_try_module_get() will fail. */
> >        stop_machine_run(__link_module, mod, NR_CPUS);
> >      ...
> > }
>
> Wow you found some really bad code. I bet it wouldn't be that
> difficult to fix the code to allow oops safe list insertion
> without using the big stop machine overkill hammer.

Yes it's overkill and it's becoming more noticable with larger machines.  
(Also, stop_machine is heavier than it should be, Kathy is working on fixing 
that though).

Most obvious is to add __ "lockless, but I'm in trouble anyway" accessors, but 
last I looked they'd have to be plumbed through a fair bit of code.

>From a quick reading of the code, a lockless add is possible, but it's fragile 
if one of the readers does something more complex in future.

Thanks,
Rusty.

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