From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932180AbcBHUes (ORCPT ); Mon, 8 Feb 2016 15:34:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34256 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753142AbcBHUeq (ORCPT ); Mon, 8 Feb 2016 15:34:46 -0500 Date: Mon, 8 Feb 2016 15:34:42 -0500 From: Jessica Yu To: Josh Poimboeuf Cc: Rusty Russell , Seth Jennings , Jiri Kosina , Vojtech Pavlik , Jonathan Corbet , Miroslav Benes , linux-api@vger.kernel.org, live-patching@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: module: preserve Elf information for livepatch modules Message-ID: <20160208203441.GB27290@packer-debian-8-amd64.digitalocean.com> References: <1454548271-24923-1-git-send-email-jeyu@redhat.com> <1454548271-24923-3-git-send-email-jeyu@redhat.com> <20160208201039.GC23106@treble.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20160208201039.GC23106@treble.redhat.com> X-OS: Linux eisen.io 3.16.0-4-amd64 x86_64 User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +++ Josh Poimboeuf [08/02/16 14:10 -0600]: >On Wed, Feb 03, 2016 at 08:11:07PM -0500, Jessica Yu wrote: >> For livepatch modules, copy Elf section, symbol, and string information >> from the load_info struct in the module loader. Persist copies of the >> original symbol table and string table. >> >> Livepatch manages its own relocation sections in order to reuse module >> loader code to write relocations. Livepatch modules must preserve Elf >> information such as section indices in order to apply livepatch relocation >> sections using the module loader's apply_relocate_add() function. >> >> In order to apply livepatch relocation sections, livepatch modules must >> keep a complete copy of their original symbol table in memory. Normally, a >> stripped down copy of a module's symbol table (containing only "core" >> symbols) is made available through module->core_symtab. But for livepatch >> modules, the symbol table copied into memory on module load must be exactly >> the same as the symbol table produced when the patch module was compiled. >> This is because the relocations in each livepatch relocation section refer >> to their respective symbols with their symbol indices, and the original >> symbol indices (and thus the symtab ordering) must be preserved in order >> for apply_relocate_add() to find the right symbol. > >This patch didn't apply clean to linux-next/master. I didn't >investigate why, but maybe it depends on the other patch set which >removes the notifiers? (If so, that should be mentioned in the cover >letter.) A very recent commit (8244062ef) introduced some changes kernel/module.c that intersect with this patch, so I think this is why the patch didn't apply cleanly to today's tree...Anyhow I will rebase again before sending out v5. Thanks for the comments :-) Jessica