Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754714AbbLPK67 (ORCPT ); Wed, 16 Dec 2015 05:58:59 -0500 Received: from mx2.suse.de ([195.135.220.15]:51364 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751087AbbLPK64 (ORCPT ); Wed, 16 Dec 2015 05:58:56 -0500 Date: Wed, 16 Dec 2015 11:58:53 +0100 (CET) From: Miroslav Benes To: Jessica Yu cc: Rusty Russell , Josh Poimboeuf , Seth Jennings , Jiri Kosina , Vojtech Pavlik , Jonathan Corbet , linux-api@vger.kernel.org, live-patching@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [RFC PATCH v2 2/6] module: preserve Elf information for livepatch modules In-Reply-To: <1448943679-3412-3-git-send-email-jeyu@redhat.com> Message-ID: References: <1448943679-3412-1-git-send-email-jeyu@redhat.com> <1448943679-3412-3-git-send-email-jeyu@redhat.com> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 963 Lines: 28 On Mon, 30 Nov 2015, Jessica Yu wrote: > @@ -3530,6 +3614,16 @@ static int load_module(struct load_info *info, const char __user *uargs, > if (err < 0) > goto bug_cleanup; > > + /* > + * Save sechdrs, indices, and other data from info > + * in order to patch to-be-loaded modules. > + * Do not call free_copy() for livepatch modules. > + */ > + if (mod->klp) > + err = copy_module_elf(mod, info); > + if (err < 0) > + goto bug_cleanup; > + I think goto bug_cleanup is not sufficient. Just before this hunk sysfs is created. So in case of error here we should call mod_sysfs_teardown() or something before going to bug_cleanup. That is new error label is needed before bug_cleanup. Correct? Miroslav -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/