Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp3395870imd; Mon, 29 Oct 2018 06:33:47 -0700 (PDT) X-Google-Smtp-Source: AJdET5ccCUZEtxIDgbaDqw52ytO4eXxZlOITcRc4tUcxt9HJEG/wBcA/hTBdEZgcUiusH04fbzmf X-Received: by 2002:a63:5949:: with SMTP id j9-v6mr13862198pgm.210.1540820027060; Mon, 29 Oct 2018 06:33:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540820027; cv=none; d=google.com; s=arc-20160816; b=kjCBZf0T3GYkKuC60i9RdYlfoPlCp6eMgDnK2/LYd9D4QIwBWC5yUBn+XBrdx9Hnxv rPEeirLm2fGfmUlsblsNVcWp0aFKi3npVDnAjMNhWEf2sodZV0pX5ULuDRswQkCehUyq b4k93abypK/c+sSehncjJi817Gr0VOHUqsi7xI93Xbfo7l0a4yh9RtXy1/4GQp6VsHaj +78MoRe3TNcFFs2HK9y72v2o3SLUZ3buNih09x1bJ68JzyZ0zpTnlfhHrTJViFQYofFo l0F/ooNhVMnH8iExA52cy6cxYL7uou8XgFS4upEJoFSNfB+gaJXQyMt6pVVWEi18cS4g jA7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RS4blY6q3VTrqJq1FA4YfjGHjfFoPIG3L5WChatf5xQ=; b=nSDuqK4y/ZJHTAf7vMGaMlGI9RS/KhNESyDUG1Mjl1drjtHf8pIhrCt3KP+KberccP gC1y0+19My7lRZ5p73mpMpCpVVQWeE3nMu6zyjop5ULW3esv9J9XNkNLYqob2gjjr1H8 PLN1Hr9N5YXB9iyfLb7hAlfpVcEDIK7nCbTKuUBXQJFCWASb4Aqf7gTRDK8yDthEvUrL /L7fZ421uofacfN0aMApbP20mVKZhFRqsqfRPNDU6/WP0T7rZNoZ2HVr2z4vHa4M5Lrd 82YjSgxe4llX+su/IHiOhd0QU0KFqY/fZTKN7+x13QNgBom+Eq/3YP36bu0HPvYdQT1F mzTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jFYySMpa; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 4-v6si21153346pff.140.2018.10.29.06.33.31; Mon, 29 Oct 2018 06:33:47 -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; dkim=pass header.i=@kernel.org header.s=default header.b=jFYySMpa; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726219AbeJ2WVf (ORCPT + 99 others); Mon, 29 Oct 2018 18:21:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:39724 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725930AbeJ2WVf (ORCPT ); Mon, 29 Oct 2018 18:21:35 -0400 Received: from linux-8ccs (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C7A3E2082D; Mon, 29 Oct 2018 13:32:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540819973; bh=JNjwaXEZHdP4jeYASYZxaJhf42ltJbSy71S5GRmFAOw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jFYySMpaBEqE7wIn0FpKSiIeHIW70WvYYH8eUMyou6OHHtVWiqOGplLQA17P81kuU JlkH4H/reyaxZv5bPmIGpViDdYeJwEOS+YHEd/BzSBLyrWTTr3RtlNC0GbfVjODisd 2eTI/lddY+1iN3LFe1AcFvgwGrfFh5m69YqdyX74= Date: Mon, 29 Oct 2018 14:32:43 +0100 From: Jessica Yu To: Miroslav Benes Cc: Torsten Duwe , Will Deacon , Catalin Marinas , Julien Thierry , Steven Rostedt , Josh Poimboeuf , Ingo Molnar , Ard Biesheuvel , Arnd Bergmann , AKASHI Takahiro , Petr Mladek , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org Subject: Re: [PATCH v2] arm64/module: use mod->klp_info section header information for livepatch modules Message-ID: <20181029133243.wjrwnwgnqszojwpi@linux-8ccs> References: <20181001140910.086E768BC7@newverein.lst.de> <20181001141652.5478C68BE1@newverein.lst.de> <20181023175553.gaobskk26koft6s2@linux-8ccs> <20181026172500.g65bl2p7cvey3qsx@linux-8ccs> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: X-OS: Linux linux-8ccs 4.12.14-lp150.12.16-default x86_64 User-Agent: NeoMutt/20170912 (1.9.0) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +++ Miroslav Benes [29/10/18 14:24 +0100]: > >> diff --git a/arch/arm64/kernel/module.c b/arch/arm64/kernel/module.c >> index dd23655fda3a..490e56070a7e 100644 >> --- a/arch/arm64/kernel/module.c >> +++ b/arch/arm64/kernel/module.c >> @@ -461,5 +461,15 @@ int module_finalize(const Elf_Ehdr *hdr, >> #endif >> } >> >> +#ifdef CONFIG_LIVEPATCH >> + /* >> + * For livepatching, switch to the saved section header info for .plt >> + * stored in mod->klp_info. This is needed so that livepatch is able to >> + * call apply_relocate_add() after patch module load. >> + */ >> + if (is_livepatch_module(me)) >> + me->arch.core.plt = me->klp_info->sechdrs + me->arch.core.plt_shndx; >> +#endif > >I missed it before, but the hunk should be under "#ifdef >CONFIG_ARM64_MODULE_PLTS" protection similarly to ftrace_trampoline just >above. me->arch.core.plt may not exist otherwise. Gah! Yes you are right, will fix. Thanks, Jessica