Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752462AbbKKQ2N (ORCPT ); Wed, 11 Nov 2015 11:28:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57326 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750818AbbKKQ2L (ORCPT ); Wed, 11 Nov 2015 11:28:11 -0500 Date: Wed, 11 Nov 2015 10:28:10 -0600 From: Josh Poimboeuf To: Miroslav Benes Cc: Jessica Yu , Rusty Russell , Seth Jennings , Jiri Kosina , Vojtech Pavlik , linux-api@vger.kernel.org, live-patching@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 0/5] Arch-independent livepatch Message-ID: <20151111162809.GD5331@treble.redhat.com> References: <1447130755-17383-1-git-send-email-jeyu@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1622 Lines: 30 On Wed, Nov 11, 2015 at 03:00:44PM +0100, Miroslav Benes wrote: > > Background: Why does livepatch need to write its own relocations? > > == > > A typical livepatch module contains patched versions of functions that can > > reference non-exported global symbols and non-included local symbols. > > Relocations referencing these types of symbols cannot be left in as-is > > since the kernel module loader cannot resolve them and will therefore > > reject the livepatch module. Furthermore, we cannot apply relocations that > > affect modules not loaded yet at run time (e.g. a patch to a driver). The > > current kpatch build system therefore solves this problem by embedding > > special "dynrela" (dynamic reloc) sections in the resulting patch module > > elf output. Using these dynrela sections, livepatch can correctly resolve > > symbols while taking into account its scope and what module the symbol > > belongs to, and then manually apply the dynamic relocations. > > I'll only add that we solve the problem with kallsyms calls in kGraft. It > can get really cumbersome from time to time, so this work would simplify > our effort as well. I haven't yet reviewed the code in-depth, but overall I think this patch set is a good idea. It simplifies livepatch itself as well as the patch creation process (for both kGraft and kpatch-build), so it's a win-win. -- Josh -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/