Received: by 10.223.176.5 with SMTP id f5csp1950030wra; Wed, 31 Jan 2018 14:10:04 -0800 (PST) X-Google-Smtp-Source: AH8x226hgCNWeP8UFetttNRy3IDrzoqEIZ4qMGKkNfrRlyF4NUBkALpQ70kt7FhEdPSHkqpxc60d X-Received: by 10.99.96.199 with SMTP id u190mr27259527pgb.290.1517436604016; Wed, 31 Jan 2018 14:10:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517436603; cv=none; d=google.com; s=arc-20160816; b=KlA8CjyQL+eV2VU9VfNkyqCwCiseRGti5hjx1De9rqsYucaWTgWu0eNQZNTQ+ZvKVx EZKP0aYGZtd4uCIWy09VFTls6poyXErHegF2TdcAglRnii25OofPGUfVolGkjnSvhed+ rbQuNJoiUMPzoELpuqXsMtpGe6k48uV+bnWWw8nv9rfTGFpzHgCY3w7v8HlE44kEpZAx AyYbGVrWCYkbNo/4rb0QY27mwchZjkDk+DoCIFnKb7IJP9O7XlATgqhp61TnGkIi3u0s zTOmt94QUhItx5jOT3lmx0eCMNS2ufXBBL9lMgOJ9PHYRYNb+l6daqOzagg2j0liJgOu MHDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :arc-authentication-results; bh=eXWI2vaA10kStca6AU/qgQr9fA5aQsbyCM5W1H+C4U0=; b=h4RFI35s272Yg3JcSD2tLeEkO+sS+mEqqfMOELRJNRH5x4D45whL6YZjgs4EZxBK7+ 9fm9jJyArVGjHwM4CoLspBemOWG23tfFjrbH5y3Y+YerVjhaMEpvYWtWbdoCSUisJXIB NKVLY1PsNarnSIi63QaHr4PuRoOH9KCLlFJHhsi4G9bOX+a+528YRlH2bN2V05zFKy8x pwcSImW5K/MHEYdNzYWd9j4DS/1yKjBdA7+cCtZ12AwJIVWS9V04F4eg1TGkszj/zsI+ 3qA9YzpBC+4CMaKINqffAJAyr4jQHf78UYQTeJt7uwGRHch3/FqXrt/FS+/X78+J1rvg K8ZQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bd7-v6si2806585plb.321.2018.01.31.14.09.48; Wed, 31 Jan 2018 14:10:03 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753155AbeAaWJ0 (ORCPT + 99 others); Wed, 31 Jan 2018 17:09:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60524 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751980AbeAaWJY (ORCPT ); Wed, 31 Jan 2018 17:09:24 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 84E4228121; Wed, 31 Jan 2018 22:09:24 +0000 (UTC) Received: from jlaw-desktop.bos.csb (dhcp-17-208.bos.redhat.com [10.18.17.208]) by smtp.corp.redhat.com (Postfix) with ESMTP id 135655D6A5; Wed, 31 Jan 2018 22:09:21 +0000 (UTC) Subject: Re: [PATCH v5 0/3] livepatch: introduce atomic replace To: Petr Mladek , Evgenii Shatokhin Cc: Jason Baron , linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, jpoimboe@redhat.com, jeyu@kernel.org, jikos@kernel.org, mbenes@suse.cz References: <86cac2eb-0de4-bae7-f633-5ad03297880d@akamai.com> <20180126102326.u5jscbbgburrzatp@pathway.suse.cz> <20180130140303.6xmjgnbdemovzif5@pathway.suse.cz> From: Joe Lawrence Organization: Red Hat Message-ID: Date: Wed, 31 Jan 2018 17:09:21 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20180130140303.6xmjgnbdemovzif5@pathway.suse.cz> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 31 Jan 2018 22:09:24 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- Joe