Received: by 10.223.176.5 with SMTP id f5csp1467809wra; Wed, 31 Jan 2018 06:56:17 -0800 (PST) X-Google-Smtp-Source: AH8x227q+9q6k/xj0rAtVvkFOw3x4Fbd4XHbU8j26nZcdMT/jDLdEKJZ6iw/rWV8jQ8sMuY8F2KB X-Received: by 10.98.75.146 with SMTP id d18mr34211324pfj.11.1517410576947; Wed, 31 Jan 2018 06:56:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517410576; cv=none; d=google.com; s=arc-20160816; b=J2ENn20TMb7tC+bLLVfKK3OtTnRRLCINCOSe1VAGzh0Ze4u2oNNpQGMLG2pCVxfQR1 rt7KRq7KVZ9zv2hwFTNH6paRDLg3fkbMOdoX0yI8NTHVKxd9CZ1pDD3JNceFyPhEq8l6 yu2+hh8ZIrKbo/e89l5TBW0T3sVRylEIYNf9BKdGzueMrj8H5XwbUEjcAG0lO0ngG/gr 1mkWT+Ji/khES8FNBN8ygKg74ayvtD/3xYpv0o2s4YoTwrxAgXqPqjaEbPllemxjoAEU LZtc+j0ichswoNv/pOBOIMVPMDNZFdB6qQp7v+4AX70s7Eq1DmQYvRp1CSC429qls306 xPIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=yXP6P4kC46hUko7OnwjYSYpcxXzmCeCZe997sA+twCc=; b=CKtXDoTx+8vzxfXJvquBAFLjY82cQvsHqdA6LkRn93UT79q8Rp+2md8ViemOcIV8dr U0OyOFoIV99FxbFrTCwOaLnobATfg0e+dsti4QVUFVltWdHZIWKLpsUHQqkdbpfJ9t8g b/H0RLjBjGNfwiwWbardbXdldanvc6kSHm3mI2lhot4fW0yjIZqQGU0nOGR+UOTPnlf+ lOSIgsofpH6PV1W1eDCzZ8EN/KTPvbrwh3ojSYWsWPhP3wNmj9XSyEnxSl1/40SKm6ht jItyG7crwQuHxdW8/zB8Gbnnnt8Q8xE/rbHRsKcLRj5CwZMdfdYC7l0ZWba324Z5htgl 5laA== 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 p11si11112145pgc.816.2018.01.31.06.56.02; Wed, 31 Jan 2018 06:56:16 -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 S1753486AbeAaOfW (ORCPT + 99 others); Wed, 31 Jan 2018 09:35:22 -0500 Received: from mx2.suse.de ([195.135.220.15]:33211 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751899AbeAaOfU (ORCPT ); Wed, 31 Jan 2018 09:35:20 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 79988AC64; Wed, 31 Jan 2018 14:35:18 +0000 (UTC) Date: Wed, 31 Jan 2018 15:35:17 +0100 (CET) From: Miroslav Benes To: Petr Mladek cc: Jason Baron , Evgenii Shatokhin , linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, jpoimboe@redhat.com, jeyu@kernel.org, jikos@kernel.org, joe.lawrence@redhat.com Subject: Re: [PATCH v5 0/3] livepatch: introduce atomic replace In-Reply-To: <20180126102326.u5jscbbgburrzatp@pathway.suse.cz> Message-ID: References: <86cac2eb-0de4-bae7-f633-5ad03297880d@akamai.com> <20180126102326.u5jscbbgburrzatp@pathway.suse.cz> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > IMHO, it might be easier to run just the callbacks from > the new patch. In reality, the author should always know > what it might be replacing and what needs to be done. I agree. I don't see a good solution to the problem. Imagine a crazy situation in which someone would like to patch the entry code. Callbacks would be non-empty, because of the need to write to MSR and IDT. Then there might be an atomic replace cumulative patch. You don't want to run callbacks of the previous patches, because that would make the system vulnerable again. On the other hand, callbacks in the replace patch could do what is necessary. It is not only entry patching of course. I think it is valid everytime you need to write a value to a global system variable of some sort. > By other words, it might be much easier to handle all > situations in a single script in the new patch. Alternative > would be doing crazy hacks to prevent the older scripts from > destroying what we would like to keep. We would need to > keep in mind interactions between the scripts and > the order in which they are called. Crazy, yes. > Or do you plan to use cumulative patches to simply > get rid of any other "random" livepatches with something > completely different? In this case, it might be much more > safe to disable the older patches a normal way. > > I would suggest to just document the current behavior. > We should create Documentation/livepatch/cummulative-patches.txt > anyway. Agreed. Regards, Miroslav