Received: by 10.223.176.5 with SMTP id f5csp2758483wra; Thu, 1 Feb 2018 05:43:18 -0800 (PST) X-Google-Smtp-Source: AH8x2250PpXEDV42TZWFmMhoyy5tlMtwBRurxXy8k/esam5qD6iXvQMs53RVOYOUs1yMIeH33S/T X-Received: by 10.98.17.193 with SMTP id 62mr36863514pfr.126.1517492598107; Thu, 01 Feb 2018 05:43:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517492598; cv=none; d=google.com; s=arc-20160816; b=A0uuoKm0CUrXnTUioDPuFFgaAKP2qoP2v9YEpigCtspmWti+LdJhNJMkV9Oa6ISsB2 GizbK46ViSmxrBk7NASIX0zL3NBQtiMhpwX3M2hEPhAw2zh36xUODjG2PbfbNVUwYjZ4 gJ9Z8iM/Nh79x0jUIS+dr4yzlKwi4Mqxk/OXBa2u8/SngtIiW8NLr+jFOIaFsb7Ho8ux r/0eGuWLzYoevyxS5GSwk0kpen7bowaTDL6/0nRpuuvK0kmCPRC3LeZReEPduJBobEzN uqX3iR7ZIT1tTrN1fN2wOUnw+qq4JJcSLNMlnfPcpHiUkR+MzBsVtELP4qksh3cwpHOM zGtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=B6ykHRGpaNSLIcOdscqQCR4DJ/z7rPD7CiY37mrsLEU=; b=e+U6duR0q/xtmiFDDX8J+nkIysnfNtsDc1RttrVPUathrKRKH038VylOL0psD+/kjE 2DAKiaro6iP+jDirIgJHnY57uHUKXRcwlf6vJQ2ljvUsHK9JSEwkhAy0T3h/5r++Kov9 WO7Q/BfTTrBnG3wnTeQz+CQJVuXkWup6zKTeoGMuU6FWwUriTu9uS9srpqWqg+o4k6P6 K0U2Dutxrs9Hz4Qh79+o2TanWDX3xq76ihyyDClrY5chjA95YYV59jXVYEQpjeQZD3ev hQJbBYUNDPes9mFmlF2Z0Cdo3pT5l2NyGRn+gAma6q6VgENr37jNZ0zfKyue5ePQcrNp rJIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t5si1678804pgb.595.2018.02.01.05.43.02; Thu, 01 Feb 2018 05:43:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752111AbeBANm3 (ORCPT + 99 others); Thu, 1 Feb 2018 08:42:29 -0500 Received: from mx2.suse.de ([195.135.220.15]:42184 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751522AbeBANm1 (ORCPT ); Thu, 1 Feb 2018 08:42:27 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id A8213AD00; Thu, 1 Feb 2018 13:42:25 +0000 (UTC) Date: Thu, 1 Feb 2018 14:42:25 +0100 From: Petr Mladek To: Joe Lawrence Cc: Evgenii Shatokhin , Jason Baron , linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, jpoimboe@redhat.com, jeyu@kernel.org, jikos@kernel.org, mbenes@suse.cz Subject: Re: [PATCH v5 0/3] livepatch: introduce atomic replace Message-ID: <20180201134225.p657ev4cdz4pvzxu@pathway.suse.cz> References: <86cac2eb-0de4-bae7-f633-5ad03297880d@akamai.com> <20180126102326.u5jscbbgburrzatp@pathway.suse.cz> <20180130140303.6xmjgnbdemovzif5@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 2018-01-31 17:09:21, Joe Lawrence wrote: > On 01/30/2018 09:03 AM, Petr Mladek wrote: > > On Fri 2018-01-26 14:29:36, Evgenii Shatokhin wrote: > >> > >> In my experience, it was quite convenient sometimes to just "replace all > >> binary patches the user currently has loaded with this single one". No > >> matter what these original binary patches did and where they came from. > > > > To be honest, I would feel better if the livepatch framework is > > more safe. It should prevent breaking the system by a patch > > that atomically replaces other random patches that rely on callbacks. > > > > Well, combining random livepatches from random vendors is a call > > for troubles. It might easily fail when two patches add > > different changes to the same function. > > > > I wonder if we should introduce some tags, keys, vendors. I mean > > to define an identification or dependencies that would say that some > > patches are compatible or incompatible. > > > > We could allow to livepatch one function by two livepatches > > only if they are from the same vendor. But then the order still > > might be important. Also I am not sure if this condition is safe > > enough. > > > > One the other hand, we could handle callbacks like the shadow > > variables. Every shadow variable has an ID. We have an API to > > add/read/update/remove them. We might allow to have more > > callbacks with different IDs. Then we could run callbacks > > only for IDs that are newly added or removed. Sigh, this would > > be very complex implementation as well. But it might make > > these features easier to use and maintain. > > Interesting ideas, but I wonder if this could be accomplished at the > livepatch module level? ie, leave it to kpatch-build (or a livepatch > equivalent) to produce a module that does this automatically. I guess > it would then be completely opt-in checking, but transfers the > complexity out of the kernel livepatching core. > > I don't see a simple way to provide flexibility of when/if calling > redundant callbacks without making the code even more complicated. I > don't have any use-cases off hand that would require such features, but > I guess if I did absolutely needed them, I might be inclined to say > prepare ahead of time and write callbacks so that they may be disabled > externally -- either by a new livepatch module's init() or some other > means. Then whatever crazy policy I need is contained to my modules, > not provided or enforced by the kernel. This all sounds reasonable. I think that we simply need to get some more experience with all these features. Then we will see if a better support from kernel would be needed or helpful. I'll try to come up with some documentation for the atomic replace and describe the potential problems and approaches there. Best Regards, Petr