Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 3 Aug 2011 23:52:58 +0400
From: Vasiliy Kulikov <segoon@...nwall.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
	Manuel Lauss <manuel.lauss@...glemail.com>,
	linux-kernel@...r.kernel.org, Richard Weinberger <richard@....at>,
	Marc Zyngier <maz@...terjones.org>, Ingo Molnar <mingo@...e.hu>,
	kernel-hardening@...ts.openwall.com,
	"Paul E. McKenney" <paul.mckenney@...aro.org>,
	Kay Sievers <kay.sievers@...y.org>
Subject: Re: Re: [PATCH] shm: fix a race between
 shm_exit() and shm_init()

On Wed, Aug 03, 2011 at 12:33 -0700, Andrew Morton wrote:
> > > +       /*
> > > +        * For init_ipc_ns shm_ids().rw_mutex is statically initialized
> > > +        * as kernel threads should be able to use it in do_exit() before
> > > +        * shm_init(), which is called on do_initcall()
> > > +        */
> > > +       if (ns == &init_ipc_ns)
> > > +                ipc_init_ids(&shm_ids(ns));
> > > +       else
> > > +               ipc_init_ids(&shm_ids(ns));
> 
> afacit init_ipc_ns.ids[0].rw_mutex and init_ipc_ns.ids[1].rw_mutex
> never get initialised with this patch?

No, these .rw_mutex are initialized in runtime, as before.


This patch should fix the specific oops (not a dependency issue):

https://lkml.org/lkml/2011/8/3/256


> Still.  It seems that the real bug is that driver_init() is trying to
> invoke userspace helpers before the kernel is ready to run userspace.

What if declare a completion, trigger it after all ns init code is
finished, and wait on the completion inside of
call_usermodehelper_exec()?

Thanks,

-- 
Vasiliy Kulikov
http://www.openwall.com - bringing security into open computing environments

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.