Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2048462imj; Sun, 17 Feb 2019 22:05:19 -0800 (PST) X-Google-Smtp-Source: AHgI3IZRNMsqHbahZhXM92j6pRuTgWdMM1szGrfRpN41CEqZreNtxKuYk65RWOKbPfoLh1kIH5Lz X-Received: by 2002:a62:57d7:: with SMTP id i84mr22841597pfj.125.1550469919673; Sun, 17 Feb 2019 22:05:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550469919; cv=none; d=google.com; s=arc-20160816; b=O/C5jyfDO8ulXHw3HtWB+sA2Gr8GKCkiGXvmJYd9XxztOvH2a5cC12WR6iWpbRr1Io t8iHVhklBXIkwQ94iate4SbTAz2Lsv39VXehGJHkRgSIQpwvFY/YtD8KBmLOZfNoomKw ZySR5y/T/Y8Szpsg6SAe/VuV9tVvwiQ4x0GP/ESXwuiY8oy95X+1cbwtR1IMeP0gdxrf fksIXp2KSUx9aTgRdUWeL6rD4KL8RaTDnKxl1SgxWyqKuNQ9cnvws/sGZD1GlTfcw4wp RCEE2XuE5sxzzpDZTPah+I9la2gbnY8Dmjfym7eAu3SdWf7vzBHfU/kIttlYmB6OepVv lRSQ== 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:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=lCi5FslURSGg6M2okaiNhp2YQmwUp4+VaJPmasrP8nQ=; b=svgbVCnsR0EtulZsD9yv1VZrtcGJmhVHzbAYWVJjD/XY1QLIHcZYQH0nto7W00q5n4 cbHEcWcKtFHRThX39JQ+xaxqATBwPHk0mUXIl/dsa956LJrRDTTJJX8vhd70aCNjZYi6 2QcoFpWxDhEafk22j3ADNT9p11AIKnEBm/hkDYLKsJA8ciMTx8LY4lbZHnvvP0IQObAk +CF/uBg4AwuWFJMeCT2cL4QONGXjCvS+wV7Y63rwljZq07grZKDv2shnEEyFjuuvua/H EZ0VrREbYwlQUrzS+nyjtnf+b9Qney+jWMMrucbzrUIWssjlkJdFDErQ6JKmdHroATWy 8aWQ== 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 g63si4600235pgc.382.2019.02.17.22.05.04; Sun, 17 Feb 2019 22:05:19 -0800 (PST) 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 S1727423AbfBRFb7 (ORCPT + 99 others); Mon, 18 Feb 2019 00:31:59 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:47898 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725730AbfBRFb6 (ORCPT ); Mon, 18 Feb 2019 00:31:58 -0500 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 8E1CE8CD8F587F0E1B95; Mon, 18 Feb 2019 13:31:56 +0800 (CST) Received: from [127.0.0.1] (10.184.38.59) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.408.0; Mon, 18 Feb 2019 13:31:48 +0800 Subject: Re: [PATCH] x86: livepatch: Treat R_X86_64_PLT32 as R_X86_64_PC32 To: Jiri Kosina , "chenzefeng (A)" CC: "hjl.tools@gmail.com" , "jpoimboe@redhat.com" , "sjenning@redhat.com" , "vojtech@suse.com" , "tglx@linutronix.de" , "mingo@redhat.com" , "hpa@zytor.com" , "gregkh@linuxfoundation.org" , "x86@kernel.org" , "live-patching@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Xiexiuqi (Xie XiuQi)" References: <79A62BFA453EFB42B7A4E40AD8F3A2264F2A872D@DGGEMA503-MBX.china.huawei.com> From: "chengjian (D)" Message-ID: Date: Mon, 18 Feb 2019 13:29:11 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.184.38.59] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi??Jiri This patch should be merged into 4.4 stable, which still use klp_write_module_reloc. https://elixir.bootlin.com/linux/v4.4.174/source/arch/x86/kernel/livepatch.c ZeFeng may have sent a stable(4.4-y) patch to the wrong mail-list(mainline). Thanks. On 2019/2/15 15:28, Jiri Kosina wrote: > On Fri, 15 Feb 2019, chenzefeng (A) wrote: > >> On x86-64, for 32-bit PC-relacive branches, we can generate PLT32 >> relocation, instead of PC32 relocation. and R_X86_64_PLT32 can be >> treated the same as R_X86_64_PC32 since linux kernel doesn't use PLT. >> >> In linux 4.4 commit b21ebf2fb4cd ("x86: Treat R_X86_64_PLT32 as >> R_X86_64_PC32") been fixed for the module loading, but not fixed for >> livepatch relocation, which will fail to load livepatch with the error >> message as follow: relocation failed for symbol at > address> >> >> Signed-off-by: chenzefeng > What kernel version is this patch based on? We've got rid of x86-specific > module loading stub and offloaded all the relocation handling to generic > kmod loader long time ago. >