Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752346AbdHNUD0 (ORCPT ); Mon, 14 Aug 2017 16:03:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54682 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752306AbdHNUDY (ORCPT ); Mon, 14 Aug 2017 16:03:24 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 07C9B68812 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=joe.lawrence@redhat.com From: Joe Lawrence To: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Josh Poimboeuf , Jessica Yu , Jiri Kosina , Miroslav Benes , Petr Mladek Subject: [PATCH v4] livepatch: shadow variables Date: Mon, 14 Aug 2017 16:02:42 -0400 Message-Id: <1502740963-31310-1-git-send-email-joe.lawrence@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 14 Aug 2017 20:03:24 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1782 Lines: 45 v4 - klp_shadow_attach(), klp_shadow_get_or_attach(), and klp_shadow_update_or_attach() - fix up return values depending on whether a new_shadow variable was allocated, or an existing one was used - kfree new_shadow, not shadow_data when shadow variable is found under the lock (2nd search try) - refactor away most of the exit labels - move klp_shadow_set() calls outside of the klp_shadow_lock - fix multiline comment format - klp_shadow_attach() - drop unnecessary variable assignment for conditional - s/shadow_match()/klp_shadow_match()/g - klp_shadow_match(), klp_shadow_set(), klp_shadow_add() - add "caller should hold lock" comments - Documentation - remove unnecessary klp_shadow_get() call in use-case - s/its shadow variable lifetimes/their shadow variables lifetimes/ Joe Lawrence (1): livepatch: introduce shadow variable API Documentation/livepatch/shadow-vars.txt | 215 +++++++++++++++++ include/linux/livepatch.h | 10 + kernel/livepatch/Makefile | 2 +- kernel/livepatch/shadow.c | 382 ++++++++++++++++++++++++++++++ samples/Kconfig | 5 +- samples/livepatch/Makefile | 3 + samples/livepatch/livepatch-shadow-fix1.c | 174 ++++++++++++++ samples/livepatch/livepatch-shadow-fix2.c | 167 +++++++++++++ samples/livepatch/livepatch-shadow-mod.c | 224 ++++++++++++++++++ 9 files changed, 1178 insertions(+), 4 deletions(-) create mode 100644 Documentation/livepatch/shadow-vars.txt create mode 100644 kernel/livepatch/shadow.c create mode 100644 samples/livepatch/livepatch-shadow-fix1.c create mode 100644 samples/livepatch/livepatch-shadow-fix2.c create mode 100644 samples/livepatch/livepatch-shadow-mod.c -- 1.8.3.1