Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753204AbbELHYS (ORCPT ); Tue, 12 May 2015 03:24:18 -0400 Received: from mail-wg0-f49.google.com ([74.125.82.49]:36749 "EHLO mail-wg0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753137AbbELHYO (ORCPT ); Tue, 12 May 2015 03:24:14 -0400 Date: Tue, 12 May 2015 15:24:19 +0800 From: Minfei Huang To: Jiri Kosina Cc: Miroslav Benes , Minfei Huang , jpoimboe@redhat.com, sjenning@redhat.com, Vojtech Pavlik , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] livepatch: Prevent to enable uninitialized patch Message-ID: <20150512072419.GA41877@dhcp-129-218.nay.redhat.com> References: <1431313066-3102-1-git-send-email-mhuang@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1849 Lines: 47 On 05/12/15 at 12:49P, Jiri Kosina wrote: > On Mon, 11 May 2015, Minfei Huang wrote: > > > 1) Patched a patch to fix the issue for module A. > > 2) livepatch will try to enable the patch, while the corresponding > > module is loaded ( call klp_module_notify_coming ) > > 3) Firstly, livepatch will do the instruction "obj->mod = mod", whatever > > the result of klp_module_notify_coming is. > > 4) livepatch may fail to call the klp_init_object_loaded or > > klp_enable_object > > 5) klp_module_notify_coming returns > > > > 6) For the userspace, we can enable the patch again ( disable the patch > > firstly, then enable the patch from the sysfs ) > > 7) In order to enable the patch, livepatch will call __klp_enable_patch > > 8) we can pass the limitation (klp_is_object_loaded), because the value > > of obj->mod is not NULL ( the obj->mod obtains the value from the step 3 ) > > 9) the patch may be applied, although the patch is not initialized, if > > the value of func->old_addr is not NULL > > > > From the above description, we can see the uninitialized patch ( the > > patch should be initialized by the klp_init_object_loaded in general ) > > can be applied to the kernel. > > This indeed looks like a valid breakage scenario. > > Could you please resend v2 of this patch with much more detailed > description in the changelog? (i.e. some reformulated variation on the > text above). Your original submission didn't describe the problem your > patch is fixing at all. > > Thanks, Thanks for your review. I will repost a new patch. Thanks Minfei > > -- > Jiri Kosina > SUSE Labs -- 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/