Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752070AbdGRLKy (ORCPT ); Tue, 18 Jul 2017 07:10:54 -0400 Received: from mx2.suse.de ([195.135.220.15]:54019 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751691AbdGRLKw (ORCPT ); Tue, 18 Jul 2017 07:10:52 -0400 Date: Tue, 18 Jul 2017 13:10:50 +0200 (CEST) From: Miroslav Benes To: Josh Poimboeuf cc: Joe Lawrence , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Jessica Yu , Jiri Kosina , Petr Mladek , Chris J Arges Subject: Re: [PATCH] livepatch: add (un)patch hooks In-Reply-To: <20170714134650.6jzb5utzfq6muvxo@treble> Message-ID: References: <1499868600-10176-1-git-send-email-joe.lawrence@redhat.com> <1499868600-10176-2-git-send-email-joe.lawrence@redhat.com> <20170714014640.nhoowbrleu6kdka2@treble> <20170714132329.54f763zbc7erlm5h@redhat.com> <20170714134650.6jzb5utzfq6muvxo@treble> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) 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: 1234 Lines: 28 > > > For the enable case, I think it would be a nice feature if we checked > > > the return code and aborted the patching operation on error. I think > > > that should be easy enough. > > > > Yeah, that should be easy. To be specific, you're only talking about > > the patching operation on the associated klp_object, not the entire > > klp_patch right? > > Oh, right, I forgot about modules. We can't stop the module from > loading, so forget that. Maybe the load hook should just return void. We can. We can stop a patch module from being loaded if there is an error coming from a hook, or we can stop a patched module (patch module is loaded) from being loaded. The latter case is not very user-friendly. We have force_load_module sysfs attribute for exactly these cases (if an admin is sure he can safely do that). It is not nice though. > > > For the unload case, it's too late to do anything, so I'd say a void > > > return code would be better. Otherwise it implies that we actually do > > > something about it. Maybe in that case we can leave it up to the user > > > to decide whether to print an error or WARN() or whatever. > > > > Good point. I can change that in v2. I agree with this point. Miroslav