From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753346AbbCDWql (ORCPT ); Wed, 4 Mar 2015 17:46:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54861 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751062AbbCDWqi (ORCPT ); Wed, 4 Mar 2015 17:46:38 -0500 Date: Wed, 4 Mar 2015 16:45:58 -0600 From: Josh Poimboeuf To: Jiri Kosina Cc: Petr Mladek , Seth Jennings , Vojtech Pavlik , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Rusty Russell , Miroslav Benes , Masami Hiramatsu , mingo@kernel.org, mathieu.desnoyers@efficios.com, oleg@redhat.com, paulmck@linux.vnet.ibm.com, andi@firstfloor.org, rostedt@goodmis.org, tglx@linutronix.de Subject: Re: [PATCH 2/2] livepatch: fix patched module loading race Message-ID: <20150304224558.GE5464@treble.hsd1.ky.comcast.net> References: <297cb260437910c43bf0ec85f53578f6cfef6d88.1425423640.git.jpoimboe@redhat.com> <20150304131752.GD15177@pathway.suse.cz> <20150304153415.GB5464@treble.hsd1.ky.comcast.net> <20150304163611.GF15177@pathway.suse.cz> <20150304175712.GD5464@treble.hsd1.ky.comcast.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 04, 2015 at 11:02:59PM +0100, Jiri Kosina wrote: > On Wed, 4 Mar 2015, Josh Poimboeuf wrote: > > > Well, we could just get a reference on all patched modules to prevent them > > from being unloaded. > > Is that really a solution for cases where you are unloading a module (it > has "just" been switched to MODULE_STATE_GOING) and enable a patch which > patches one of its functions directly after it got switched to > MODULE_STATE_GOING? Ah, right. try_module_get() fails, we don't patch the module, and we end up in the same mod->exit() race. Never mind, again :-) -- Josh