From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753347AbbCQB7M (ORCPT ); Mon, 16 Mar 2015 21:59:12 -0400 Received: from ozlabs.org ([103.22.144.67]:42832 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751076AbbCQB7F (ORCPT ); Mon, 16 Mar 2015 21:59:05 -0400 From: Rusty Russell To: Jiri Kosina , Petr Mladek Cc: Seth Jennings , Josh Poimboeuf , Miroslav Benes , Masami Hiramatsu , mingo@kernel.org, mathieu.desnoyers@efficios.com, oleg@redhat.com, paulmck@linux.vnet.ibm.com, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, andi@firstfloor.org, rostedt@goodmis.org, Thomas Gleixner Subject: Re: [PATCH v4] livepatch/module: Correctly handle coming and going modules In-Reply-To: References: <1426161313-6474-1-git-send-email-pmladek@suse.cz> User-Agent: Notmuch/0.17 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) Date: Tue, 17 Mar 2015 12:22:43 +1030 Message-ID: <873854mluc.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jiri Kosina writes: > On Thu, 12 Mar 2015, Petr Mladek wrote: > >> There is a notifier that handles live patches for coming and going modules. >> It takes klp_mutex lock to avoid races with coming and going patches but >> it does not keep the lock all the time. Therefore the following races are >> possible: > [ ... snip ... ] >> diff --git a/include/linux/module.h b/include/linux/module.h >> index b653d7c0a05a..7232fde6a991 100644 >> --- a/include/linux/module.h >> +++ b/include/linux/module.h >> @@ -344,6 +344,10 @@ struct module { >> unsigned long *ftrace_callsites; >> #endif >> >> +#ifdef CONFIG_LIVEPATCH >> + bool klp_alive; >> +#endif >> + > > Rusty, are you okay with this please? I'd like to have the race fixed in > 4.0 still, but don't want to be making changes to struct module without > your ack. I look at the amount of explanation and discussion around these patches and I fear the complexity of what you're doing. But not enough to rewrite it myself, so: Acked-by: Rusty Russell Good luck! Rusty.