Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3571625ybi; Fri, 19 Jul 2019 05:29:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqyJpkJ1yyAlL5AcXqsumwLhDtSoxqS3nUPJFO3E8AegJerXFvbBYmLN6+2V9+r4JVHearb3 X-Received: by 2002:a65:60d3:: with SMTP id r19mr28666099pgv.91.1563539383786; Fri, 19 Jul 2019 05:29:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563539383; cv=none; d=google.com; s=arc-20160816; b=WCNfewQf36klvRzS+2TrXc5CshYOBmAAksNrxl3VKQuXECWXEUT8cZIKet5iK/FRjy Tx9Y1xvjTRJ2RSG7Oa2z+xs7VuImZIzeY+oIlMOOlVaxNFp/ApLWvpo7jtqSjlzJoq6y /Hc/UuBEpKjTNgDxo3kzTMZ1aZ5duW4XhIDHmkoMLIAcMK/e82CCedt/k7FZhlr60HQ4 Wnpy0yU6YkiHDa6jIy8z0fiDmqIBWhrS/UKurOIPsqRSNmY6Vm17Gn1/cdzcuDAnzpB1 MmkJojLe3UAMd1E5PdHiJkXusOCJPa6Z6QxxGbxQhkRpgPCFApOmbqx2GueCbLJCXp1/ G/OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=hVsDmaFoolCfc7hy/eua/dRgOdNJiuX1txC3uhvPm7Y=; b=imwHXVK/t6i7ZCyPFw+ukEY3XeGf8H6dZ7SHs0Cc4DeOtF+n191nywkEaYEMFyLnA2 IxaAreKy0M8xb5jJqSJfuR+W0Vp/vb4tqyfKVU0BnHo1d/S+GENevAyk2bMyy85vkEIj wBR4wEx5bL7NQeHe5u1vZHIJfW5vm4WIsEunaOpLTzSUXmpymkHtsblN2fPYhJAmGcBj OZwGsoQx3Q2MUwRgtUI7H4txmbhQWxMmtyURHwtg4fhfa1OvkjV4adXJepbTK7XiELhT bnm6BixeomACZP+Y7tLUufEptp6N11AGlV7CncM3L8DtZGg09yymNO045YDyHfpv0RWF oIZQ== 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 f61si2533672plf.258.2019.07.19.05.29.28; Fri, 19 Jul 2019 05:29:43 -0700 (PDT) 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 S1728307AbfGSM2o (ORCPT + 99 others); Fri, 19 Jul 2019 08:28:44 -0400 Received: from mx2.suse.de ([195.135.220.15]:49110 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727552AbfGSM2n (ORCPT ); Fri, 19 Jul 2019 08:28:43 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 8591BAF37; Fri, 19 Jul 2019 12:28:42 +0000 (UTC) From: Miroslav Benes To: jikos@kernel.org, jpoimboe@redhat.com, pmladek@suse.com Cc: joe.lawrence@redhat.com, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Miroslav Benes Subject: [RFC PATCH 0/2] livepatch: Clear relocation targets on a module removal Date: Fri, 19 Jul 2019 14:28:38 +0200 Message-Id: <20190719122840.15353-1-mbenes@suse.cz> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The second attempt to resolve the issue reported by Josh last year [1] and also reported earlier this year again [2]. The first attempt [3] tried to deny the patched modules to be removed. It did not solve the issue completely. It would be possible, but we decided to try the arch-specific approach first, which I am sending now. Sending early as RFC, because I am leaving on holiday tomorrow and it would be great if you took a look meanwhile. - I decided not to CC the arch maintainers yet. If we decide that the approach is feasible first on our livepatch side, I will split the second patch and resend properly. - the first patch could go in regardless the rest, I guess. - I am not sure about the placement in klp_cleanup_module_patches_limited(). I think it is the best possible, but I would really appreciate double-checking. - I am also not sure about the naming, so ideas also welcome Lightly tested on both x86_64 and ppc64le and it looked ok. [1] 20180602161151.apuhs2dygsexmcg2@treble [2] 1561019068-132672-1-git-send-email-cj.chengjian@huawei.com [3] 20180607092949.1706-1-mbenes@suse.cz Miroslav Benes (2): livepatch: Nullify obj->mod in klp_module_coming()'s error path livepatch: Clear relocation targets on a module removal arch/powerpc/kernel/Makefile | 1 + arch/powerpc/kernel/livepatch.c | 75 +++++++++++++++++++++++++++++++++ arch/powerpc/kernel/module.h | 15 +++++++ arch/powerpc/kernel/module_64.c | 7 +-- arch/x86/kernel/livepatch.c | 67 +++++++++++++++++++++++++++++ include/linux/livepatch.h | 5 +++ kernel/livepatch/core.c | 18 +++++--- 7 files changed, 177 insertions(+), 11 deletions(-) create mode 100644 arch/powerpc/kernel/livepatch.c create mode 100644 arch/powerpc/kernel/module.h -- 2.22.0