Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1424931imu; Thu, 13 Dec 2018 15:08:06 -0800 (PST) X-Google-Smtp-Source: AFSGD/V3ICuBpdS39kXggzQoPAU6wRtdhOWRKOgx+o5SfJtXaIERJtXCEMqdASlfNrn+pFfvpoGs X-Received: by 2002:a17:902:4c85:: with SMTP id b5mr625708ple.226.1544742486357; Thu, 13 Dec 2018 15:08:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544742486; cv=none; d=google.com; s=arc-20160816; b=DcWAHTHcgRKUs/o46Y1//TmUuGL3DOXCveQhDS+vJbqDFftKubAlT+cyh2hVm639Qc RJTarj2fjiAycz7LrnMVenRb/6L0ei1A1Nr0+q1CG9GJX3dEzfWUGjccn9tyCoqJZc7E 3FP0dPBe4nqfUvVtxGlW+kCDQuYzad2A5WdUVXwUg/PO/xVLozdAdde+6mr8ecIEWrtJ K1fMcM69qCrGGfInN+XTfniclqRKdftzE2sckcqVYnm2m9Oy7UA1XUsx1204KVb0h0zJ 2AkGGrJ+n3rSrVOtKDswrYfik4tg4fNyz16MfmLJRjldcVOjq0mGWrM75Wn1pD/TmmgZ qWAw== 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; bh=tUTlPHzEx1oVqs+01MY6U9Fm4Wtf3AVcHPZT/Ut5Gao=; b=A7S8uYdqZCesnR6KOZa9eQGilpTkCCwmo8I+W87+sbqGkkEnV1CBBDTcLBbs9tbouF kAzaqMbvkLiPEmbqFI1J9SrEfauaTc48jximGtoQqypBSD7Awj2i+j2quJqDBGzTz56H Kq0b2mVBDXI19zbI4RiVLqT2HfiACQ9OuYf2OhNGhoF4L26ECCBWwkVSzykKhKTClac0 48jMFzUevNdIO9KN1CoYCWq1o20DrRCo0Q3/8JcGzxPfdPazMf/ZJ4KDquE8sOY2tZxY zP9//0r0Yt8E2jYKqIkfNguha4lpYuKgyeOI45SpVcvuDIJKFpJ7o6zgHshrlq8THTHB BaYQ== 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 s19si2433747plp.151.2018.12.13.15.07.49; Thu, 13 Dec 2018 15:08:06 -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 S1728021AbeLMXHA (ORCPT + 99 others); Thu, 13 Dec 2018 18:07:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48448 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726813AbeLMXHA (ORCPT ); Thu, 13 Dec 2018 18:07:00 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E096531256A8; Thu, 13 Dec 2018 23:06:59 +0000 (UTC) Received: from treble (ovpn-120-195.rdu2.redhat.com [10.10.120.195]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5507D26355; Thu, 13 Dec 2018 23:06:55 +0000 (UTC) Date: Thu, 13 Dec 2018 17:06:52 -0600 From: Josh Poimboeuf To: Petr Mladek Cc: Jiri Kosina , Miroslav Benes , Jason Baron , Joe Lawrence , Evgenii Shatokhin , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v14 10/11] livepatch: Remove ordering and refuse loading conflicting patches Message-ID: <20181213230652.e2vn27qvqhumtaog@treble> References: <20181129094431.7801-1-pmladek@suse.com> <20181129094431.7801-11-pmladek@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20181129094431.7801-11-pmladek@suse.com> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Thu, 13 Dec 2018 23:07:00 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 29, 2018 at 10:44:30AM +0100, 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. > > This patch removes the stack of patches. The list of enabled patches > is still needed but the ordering is not longer enforced. > > Note that it is not possible to catch all possible dependencies. It is > the responsibility of the livepatch authors to decide. > > Nevertheless this patch prevents having two patches for the same function > enabled at the same time after the transition finishes. It might help > to catch obvious mistakes. But more importantly, we do not need to > handle situation when a patch in the middle of the function stack > (ops->func_stack) is being removed. I'm not sure about this patch. I like the removal of the stacking. But do we really want to enforce no dependencies between non-cumulative patches? It can be done correctly if the user is careful. Maybe we should just let users do it if they want to. And then that also would mean less code for us to maintain. And as usual, I apologize if I'm either contradicting or repeating past versions of myself. :-) -- Josh