From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755760Ab1HCTxJ (ORCPT ); Wed, 3 Aug 2011 15:53:09 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:43053 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755604Ab1HCTxE (ORCPT ); Wed, 3 Aug 2011 15:53:04 -0400 Date: Wed, 3 Aug 2011 23:52:58 +0400 From: Vasiliy Kulikov To: Andrew Morton Cc: Linus Torvalds , Manuel Lauss , linux-kernel@vger.kernel.org, Richard Weinberger , Marc Zyngier , Ingo Molnar , kernel-hardening@lists.openwall.com, "Paul E. McKenney" , Kay Sievers Subject: Re: [kernel-hardening] Re: [PATCH] shm: fix a race between shm_exit() and shm_init() Message-ID: <20110803195258.GA7063@albatros> References: <20110801180151.GA26686@albatros> <20110801112021.25ec9041.akpm@linux-foundation.org> <20110801190341.GA6898@albatros> <20110802124530.GA2543@albatros> <20110803123352.88670c9c.akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110803123352.88670c9c.akpm@linux-foundation.org> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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