Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp165031ybd; Sat, 22 Jun 2019 00:28:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqxaUdS/iz4iNWi7yv9/a5U4xJLz4cXArd48hJP0GbBUQRyuDMXV8JMFvqY2sYjAJZansDcz X-Received: by 2002:a63:1952:: with SMTP id 18mr18798224pgz.334.1561188521896; Sat, 22 Jun 2019 00:28:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561188521; cv=none; d=google.com; s=arc-20160816; b=hE2lhKn1g7MYr0lPUb5QuSr2CG7Z0ZzkVEXAta4Cyr4EO9tki0UhkygK6FnEh159Ao c+u857u+uIaEyXURXaZTr4xSy6P2L6OGCbg5cn69HknMXibBh/LIjGLUtmA7vaYHbbqE 4hLWms8+QMrZXTs9DBpHE9V0+2RRe2t0pynLGOLbvFXZ3+YbDiYMAHe0tMcUu6/joQ1j 1b1RlWciCKncPQJ0v207jXA5K6/Js7D3krPJIfPLAX1/DPblDhDBBpW0GELXNYZ96GaS nlbwfu8J28E8bkKCOdBi7QODD3mi/jzdy6iGt02VM5QWRc1AjGVardyimmE6mSxiI0uH R9sg== 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=K3hZ3cpoLF95LIrxsLAc7x0HQu/qhffSwbgyc/NabCU=; b=wdiFxXIlcmvXAMWYD6aJ5cpL2Lg9cEokSmCUkOhf6jwzvD/M9S/Cxb2hDZlobauo3b 1SCxSGE/F2CWrW1EUQkvzUZRBkmVEIX8T1GP3xRteOhkv0YbDzcNvHVcX6yoSUUnftnV dFD/+LdWANZeWCYTpmMkRVcN0K5t0Tz86SJvhY4eiWtVg1ajitAyx7X+WgdfARfUaq/E K1qY3CsSvGuyh+1dbHgAQqZYIjsIkLFsHrMao2wgGS5HKnKRjn6vp6J8Qt7q2P2Ri+L5 nX9Y0bbBnC1BoHTuBtP7FR5DYj3SKQ9RK8dMzwvuj7wcxmKYfIwmyZ44lSzf5RmzIli7 g9uQ== 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 h17si375210pgi.547.2019.06.22.00.28.25; Sat, 22 Jun 2019 00:28:41 -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 S1726100AbfFVH2W (ORCPT + 99 others); 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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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