Received: by 10.223.185.116 with SMTP id b49csp1022775wrg; Wed, 21 Feb 2018 10:43:47 -0800 (PST) X-Google-Smtp-Source: AH8x224tYIOORyUbR2oNPPb3uiW+4FZrJAH170YoZE/rORgzFntBUEbfjcTB3apgAYPLmCunLYDY X-Received: by 2002:a17:902:6805:: with SMTP id h5-v6mr4006742plk.46.1519238627061; Wed, 21 Feb 2018 10:43:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519238627; cv=none; d=google.com; s=arc-20160816; b=dpd8qgLZ5MJOZUioTQJ66N5hjwaZ5m33g5fn8IMc7n1JaT37eb1rByTx0kRjADZ/DX h1gaI6gm2Sc9PsCOMUdYahPFvj0Eq+plDrXk9oM8p2UB+W9nzUo+NWM+hYkgCKIxJiig CiocJVvqSTgzirSNOHr5eFua0goBIVnI5aa9M2L/BkSiOp6yYvsW+MuUlStey5q3nLoS mggbCcLdDtldAmz2R9LsdAzJI1L0BbZleFOpZGEaa3HCEv8qjCWcaNa9Tut3UiXhD7Ty k5KnXbqnHiaa/haJwNmeEyTLqnJCwx2dA1cJrVLTgup8nZtZ7DOdKKGHyDZez0I1jq7p I6JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=o59eCBaMHhccy1LB2sbxPGt0q5gYBcqb/G5nqXGJD+w=; b=UliNyDODI4KyOi6Px34QXfJDkOrYypFvnboYQ4nkpENkwYMX/sezux/yri4i0qEkn+ NV9/JQMozk+ST2qw2fYvAwwrxZtgcUZg8vTIfdlBj1JqUYnKzrJr6Ga5gqfgnZsNctln TLX+cjVPJHV/yCLqZbLYU1DSsdNv2eTZjp9t5ijxUyHxixewNncsNUVvuXXXnxI1j11T LmX3Mtxd2s3ONqc64QRZkqarDZw3QmN7DHSyc4A1JTtnhpLB9burH1bk5tmiZAq8rDKF AKRxRRA5Pkh69vhmw0XC33RdrrQECDz6O0QQAGLJvr8+DjJg2i2/R80QgQMYvlS/wro3 bykA== 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 c17si7986101pgp.809.2018.02.21.10.43.32; Wed, 21 Feb 2018 10:43:47 -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 S936771AbeBUN3d (ORCPT + 99 others); Wed, 21 Feb 2018 08:29:33 -0500 Received: from mx2.suse.de ([195.135.220.15]:49047 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934599AbeBUN3c (ORCPT ); Wed, 21 Feb 2018 08:29:32 -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 33348AC79; Wed, 21 Feb 2018 13:29:30 +0000 (UTC) From: Petr Mladek To: Jiri Kosina , Josh Poimboeuf , Miroslav Benes Cc: Jason Baron , Joe Lawrence , Jessica Yu , Evgenii Shatokhin , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Petr Mladek Subject: [PATCH v8 0/8] livepatch: Atomic replace feature Date: Wed, 21 Feb 2018 14:29:06 +0100 Message-Id: <20180221132914.4809-1-pmladek@suse.com> X-Mailer: git-send-email 2.13.6 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The atomic replace allows to create cumulative patches. They are useful when you maintain many livepatches and want to remove one that is lower on the stack. In addition it is very useful when more patches touch the same function and there are dependencies between them. I have found one bug in v7. We were not able to initialize NOP struct klp_func when the patches module is not loaded. It was because func->new_func was NULL. I have fixed it in separate patch for an easier review. Note that the original Jason's patch did not have this problem because func->new_func was always NULL there. But this required NOP-specific handling also on other locations, namely klp_ftrace_handler() and klp_check_stack_func(). Changes against v7: + Fixed handling of NOPs for not-yet-loaded modules + Made klp_replaced_patches list static [Mirek] + Made klp_free_object() public later [Mirek] + Fixed several reported typos [Mirek, Joe] + Updated documentation according to the feedback [Joe] + Added some Acks [Mirek] Changes against v6: + used list_move when disabling replaced patches [Jason] + renamed KLP_FUNC_ORIGINAL -> KLP_FUNC_STATIC [Mirek] + used klp_is_func_type() in klp_unpatch_object() [Mirek] + moved static definition of klp_get_or_add_object() [Mirek] + updated comment about synchronization in forced mode [Mirek] + added user documentation + fixed several typos Jason Baron (5): livepatch: Use lists to manage patches, objects and functions livepatch: Initial support for dynamic structures livepatch: Allow to unpatch only functions of the given type livepatch: Support separate list for replaced patches. livepatch: Add atomic replace Petr Mladek (3): livepatch: Free only structures with initialized kobject livepatch: Correctly handle atomic replace for not yet loaded modules livepatch: Atomic replace and cumulative patches documentation Documentation/livepatch/cumulative-patches.txt | 83 ++++++ include/linux/livepatch.h | 59 +++- kernel/livepatch/core.c | 394 ++++++++++++++++++++++--- kernel/livepatch/core.h | 4 + kernel/livepatch/patch.c | 31 +- kernel/livepatch/patch.h | 4 +- kernel/livepatch/transition.c | 41 ++- 7 files changed, 566 insertions(+), 50 deletions(-) create mode 100644 Documentation/livepatch/cumulative-patches.txt -- 2.13.6