Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1667662ybi; Thu, 20 Jun 2019 01:34:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqz6g32XWNesKhiGUtghlqok3mBoi15lgLediUxoTEitMQaEM2G6G87o96N18tw4Sk4nTufK X-Received: by 2002:a17:902:8543:: with SMTP id d3mr1127780plo.78.1561019663562; Thu, 20 Jun 2019 01:34:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561019663; cv=none; d=google.com; s=arc-20160816; b=gc3os3KLII2ovSXFmLL7LVjyDG2q0dPGHOFpFiH8jGl9kAoHsHlru3pPfQY+c+CYmv YEAdyn7V8o1KQ3VsI41jiVHQRP/x77eOZ9LZ4tBmoNKLtkVE1PYQxEKBIRc2QxWF6K4d eZanRrAQOAi2gp6bZt1kRSAUteO/QjKPSk94ozHtFyuxReQxZNkapRATD9ru792mRXUm NLsGj7+oujxDz1YouPApwlb2VT1MGGHPsYw4Llq2kQHt+rcLfAKDnz3GxwSnKnl5wd1I amqBEUDt1HhaI8oxycLDxUP1MIsFWwgtmtX3ItUaIBmefJKIwPgheVCK6iszEl7aes5m GeDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=LGRNoJYZHtV2b8hJRg4aUp0/v9uzl1Lo2MlYwclwQOc=; b=VXUUZgRawlkSl8nylqQiFwjY2UFTCV3bqNECrifKIuKcvwmmtXTTUpvZ8rEbH7TwjP KPfLPYHAxLiFDu56qw9hjSIG4IP7FO/OYJurYsOdUzgeQ9rEtUd8oL4DIA/JSfOfUgok crZwG0F+USTr9ezvw+9GvkEUf6/dcKL2aiuoFjR8JlCJl3zXV2OnmLTwZgFCxMlt2ii4 MfCpldrEpk4Twjaf409dHBeKLDPKBwT6BoDh+dtVh9jeDJyY9uBIZcPmPtqBt+kr3AKu IRovIyNWbkZA1cKjDrM4DCFfsIJNvOUdsK+P6UXgu+4rlGipm2BIFvlC9RH6QiYMALyE vzDw== 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 j18si18593220pfe.235.2019.06.20.01.34.07; Thu, 20 Jun 2019 01:34:23 -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 S1730872AbfFTIdd (ORCPT + 99 others); Thu, 20 Jun 2019 04:33:33 -0400 Received: from mx2.suse.de ([195.135.220.15]:35564 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725875AbfFTIdd (ORCPT ); Thu, 20 Jun 2019 04:33:33 -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 521A5AF22; Thu, 20 Jun 2019 08:33:32 +0000 (UTC) Date: Thu, 20 Jun 2019 10:33:31 +0200 (CEST) From: Miroslav Benes To: Cheng Jian cc: linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, jpoimboe@redhat.com, tglx@linutronix.de, 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: <1561019068-132672-1-git-send-email-cj.chengjian@huawei.com> Message-ID: References: <1561019068-132672-1-git-send-email-cj.chengjian@huawei.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Miroslav