Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1950991imu; Thu, 10 Jan 2019 05:59:20 -0800 (PST) X-Google-Smtp-Source: ALg8bN6BN6hEHthtjWy6bB8mzZXqFFWsRaqlUlFwN5nPw7CsrVYYsHITDcfpxN7kFUPowThnQhih X-Received: by 2002:a17:902:bd92:: with SMTP id q18mr10475078pls.167.1547128760770; Thu, 10 Jan 2019 05:59:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547128760; cv=none; d=google.com; s=arc-20160816; b=pFIaajbbMaYYibM0Ot+klsuvLrgcbl6IU9RovmKSFLvfDKlJIzXEuBsG40/X2524Lh v2RHMpo9g3frvQTCLJqpiYnjkw+3IqAi3KLX3EbEO1LVVc/0636mnnwPj4c0oyOSN8gM r5fIS5fALm0sF1TnRU4GeSizIXvSgKUvHszbDl+YKX2ZD0FAPzIBukkROzTPoT+L0+o8 AAlVjcBtrbqxuoeHVJMDjgbQ9i/sfXoDk/jx7WaBxED1VYN9rtDiOxJvRTD9jmjKJPTW 2b4gfvCcsKc92ldLe6oz5GtpW22shrLL4ZHB8PZOABw5R3jqWHiFgSpQr7FiyFG7wdgo 64tQ== 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; bh=BvNo7zomlKGn57P5oTSlI77tQUIm7ioOr72zcVfYb2E=; b=m+MV7BLWYGWtSDqZqoyaUbZeGYqOIMWYLIy+qd2d5LBb3FEPArkv8RovSPU+9uVM8d WoNRDNYflMQa7cqJPc2zHy6IFHy58IRg4qRlpTTNuhxfTShx7XUPSdN0xXEEAssyZ93G +P3+daPxljr6cPj8TQtUAWBsfQKAWwmmLQ8ZwFE75E6jCF8Oqau3VSoYEygrsaIDk54M X/syTE/vu6aHLMGPmX+Olp0gb+w+/7cPyLnhHw8Kf5UTJvmbbQ2CGSdHp3YyTYtEWvks kJksyOjUHG4U44+N1MfkN2Yg6abmyBfOtmfXRKqg3YCNmFKqgP5FRsR9mPem/6vDnjMb ZVTA== 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 d69si3226652pga.184.2019.01.10.05.59.05; Thu, 10 Jan 2019 05:59:20 -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 S1728751AbfAJN4d (ORCPT + 99 others); Thu, 10 Jan 2019 08:56:33 -0500 Received: from mx2.suse.de ([195.135.220.15]:41882 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727753AbfAJN4d (ORCPT ); Thu, 10 Jan 2019 08:56:33 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 10440ACBC; Thu, 10 Jan 2019 13:56:32 +0000 (UTC) Date: Thu, 10 Jan 2019 14:56:31 +0100 (CET) From: Miroslav Benes To: Petr Mladek cc: Jiri Kosina , Josh Poimboeuf , Jason Baron , Joe Lawrence , Evgenii Shatokhin , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v15 10/11] livepatch: Remove ordering (stacking) of the livepatches In-Reply-To: <20190109124329.21991-11-pmladek@suse.com> Message-ID: References: <20190109124329.21991-1-pmladek@suse.com> <20190109124329.21991-11-pmladek@suse.com> 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 On Wed, 9 Jan 2019, Petr Mladek wrote: > The atomic replace and cumulative patches were introduced as a more secure > way to handle dependent patches. They simplify the logic: > > + Any new cumulative patch is supposed to take over shadow variables > and changes made by callbacks from previous livepatches. > > + All replaced patches are discarded and the modules can be unloaded. > As a result, there is only one scenario when a cumulative livepatch > gets disabled. > > The different handling of "normal" and cumulative patches might cause > confusion. It would make sense to keep only one mode. On the other hand, > it would be rude to enforce using the cumulative livepatches even for > trivial and independent (hot) fixes. > > However, the stack of patches is not really necessary any longer. > The patch ordering was never clearly visible via the sysfs interface. > Also the "normal" patches need a lot of caution anyway. > > Note that the list of enabled patches is still necessary but the ordering > is not longer enforced. > > Otherwise, the code is ready to disable livepatches in an random order. > Namely, klp_check_stack_func() always looks for the function from > the livepatch that is being disabled. klp_func structures are just > removed from the related func_stack. Finally, the ftrace handlers > is removed only when the func_stack becomes empty. > > Signed-off-by: Petr Mladek Acked-by: Miroslav Benes Miroslav