From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF6AFC43613 for ; Sat, 22 Jun 2019 07:28:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A0DF22075E for ; Sat, 22 Jun 2019 07:28:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726075AbfFVH2W (ORCPT ); Sat, 22 Jun 2019 03:28:22 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:57515 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726070AbfFVH2W (ORCPT ); Sat, 22 Jun 2019 03:28:22 -0400 Received: from p5b06daab.dip0.t-ipconnect.de ([91.6.218.171] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1heaRd-0003tp-O9; Sat, 22 Jun 2019 09:28:17 +0200 Date: Sat, 22 Jun 2019 09:28:16 +0200 (CEST) From: Thomas Gleixner To: Miroslav Benes cc: Cheng Jian , linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, jpoimboe@redhat.com, mingo@redhat.com, huawei.libin@huawei.com, xiexiuqi@huawei.com, yangyingliang@huawei.com, bobo.shaobowang@huawei.com Subject: Re: [PATCH] Revert "x86/module: Detect and skip invalid relocations" In-Reply-To: Message-ID: References: <1561019068-132672-1-git-send-email-cj.chengjian@huawei.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: live-patching-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: live-patching@vger.kernel.org Miroslav, On Thu, 20 Jun 2019, Miroslav Benes wrote: > On Thu, 20 Jun 2019, Cheng Jian wrote: > > > This reverts commit eda9cec4c9a12208a6f69fbe68f72a6311d50032. > > > > Since commit (eda9cec4c9a1 'x86/module: Detect and skip invalid > > relocations') add some sanity check in apply_relocate_add, borke > > re-insmod a kernel module which has been patched before, > > > > The relocation informations of the livepatch module have been > > overwritten since first patched, so if we rmmod and insmod the > > kernel module, these values are not zero anymore, when > > klp_module_coming doing, and that commit marks them as invalid > > invalid_relocation. > > > > Then the following error occurs: > > > > module: x86/modules: Skipping invalid relocation target, existing value is nonzero for type 2, loc (____ptrval____), val ffffffffc000236c > > livepatch: failed to initialize patch 'livepatch_0001_test' for module 'test' (-8) > > livepatch: patch 'livepatch_0001_test' failed for module 'test', refusing to load module 'test' > > Oh yeah. First reported here 20180602161151.apuhs2dygsexmcg2@treble (LP ML > only and there is no archive on lore.kernel.org yet. Sorry about that.). I > posted v1 here > https://lore.kernel.org/lkml/20180607092949.1706-1-mbenes@suse.cz/ and > even started to work on v2 in March with arch-specific nullifying, but > then I got sidetracked again. I'll move it up my todo list a bit. so we need to revert it for now, right? Thanks, tglx