From: Ian Jackson Subject: Re: [PATCH v4 1/6] libelf: rewrite symtab/strtab loading for Dom0 Date: Thu, 21 Jan 2016 17:29:52 +0000 Message-ID: <22177.5520.10709.9657@mariner.uk.xensource.com> References: <1453395092-88090-1-git-send-email-roger.pau@citrix.com> <1453395092-88090-2-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aMJ3V-0002Lc-HI for xen-devel@lists.xenproject.org; Thu, 21 Jan 2016 17:29:57 +0000 In-Reply-To: <1453395092-88090-2-git-send-email-roger.pau@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Roger Pau Monne Cc: xen-devel@lists.xenproject.org, Keir Fraser , Ian Campbell , Jan Beulich , Tim Deegan List-Id: xen-devel@lists.xenproject.org Roger Pau Monne writes ("[PATCH v4 1/6] libelf: rewrite symtab/strtab loading for Dom0"): > Current implementation of elf_load_bsdsyms is broken when loading inside of > a HVM guest, because it assumes elf_memcpy_safe is able to write into guest > memory space, which it is not. > > Take the oportunity to do some cleanup and properly document how > elf_{parse/load}_bsdsyms works. The new implementation uses elf_load_image > when dealing with data that needs to be copied to the guest memory space. > Also reduce the number of section headers copied to the minimum necessary. ... > #define elf_hdr_elm(_elf, _hdr, _elm, _val) \ > do { \ > if ( elf_64bit(_elf) ) \ > - elf_store_field(_elf, _hdr, e64._elm, _val); \ > + (_hdr).e64._elm = _val; \ This seems to bypass the safe store mechanism which was introduced to fix XSA-55. Ian.