From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1fIfSs-0000Mt-NP for mharc-grub-devel@gnu.org; Tue, 15 May 2018 15:18:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38138) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIfSq-0000Ma-NJ for grub-devel@gnu.org; Tue, 15 May 2018 15:18:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fIfSn-0006XF-C5 for grub-devel@gnu.org; Tue, 15 May 2018 15:18:24 -0400 Received: from genode.genode-labs.com ([94.130.141.228]:48118) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fIfSn-0006Wf-4E for grub-devel@gnu.org; Tue, 15 May 2018 15:18:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=genode-labs.com; s=2018-03; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:References:To:From:Subject:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ay7x3DCbtZ2SZj6D6LQlOO0zyZ0YJKHcd6q6Fx+88mM=; b=tQBYoNZdikorOXhrBLPJ/Z3sTg WP7v3FHpjkfG3jo+YcO3iD7iXlmq2VaT2w8bVo3SIjB16paUjSfau8ZFYRs+bgfpxWLxMidq+e+xn 9ApHezUD29sJvQcr9c/7Ul5VkJRNYe9TX/ygq7j6m7yhElY9Os3SiSg0uC1mkiXHfHyy+BrBMdu7j AVk0vtI2ERxcY9DU/pS6VNwa0YwgMMJPSeQoSsTv17PvbwvcPUessv8ePg+8KfQ8fz9Vt+6DbVT0E dvPlgtNducap/oE5MLtdI4ownAJux932A+sPhW7ZtFGWzN5z/X0D/MHNeO+GQo8rkvL7kIWDb9tfE thnax2Uw==; Received: by genode.genode-labs.com (Exim 4.89) with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (envelope-from ) id 1fIfSk-0003ln-TE ; Tue, 15 May 2018 21:18:19 +0200 Subject: Re: [PATCH] mbi: use per segment a separate relocator chunk From: Alexander Boettcher To: The development of GNU GRUB , Daniel Kiper References: <20180515134229.GC16845@router-fw-old.local.net-space.pl> Message-ID: Date: Tue, 15 May 2018 21:18:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam_score: 0.0 X-Spam_score_int: 0 X-Spam_bar: / X-Spam_report: NO_RELAYS=-0.001,URIBL_BLOCKED=0.001 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 94.130.141.228 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 May 2018 19:18:26 -0000 On 15.05.2018 21:10, Alexander Boettcher wrote: >> I assume that a given ELF PHDR address/size does not cover VGA memory or >> anything like that, > > No. > >> so, I am not sure what exactly overwrites this region. >> grub_memset() in current line 161 at some point? > > No. During grub_relocator_prepare_reloc the overwrite happens, if i'm > not wrong. > > An (artificial) example, imagine two ELF PHDRs, e.g. > >  [0x8000-0x9000) and >  [0x2000000-0x2100000). > > Without this patch grub calculates one relocator chunk of size 0x20f8000 > (0x2100000 - 0x8000) and places it at some higher memory, e.g. > [0x3000000 - 0x30f8000). During the invocation of Must be [0x3000000-0x50f8000) > grub_relocator_prepare_reloc the memory gets copied from > > [0x3000000-0x30f8000) to [0x8000-0x2100000) Must be [0x3000000-0x50f8000) to [0x8000-0x2100000) Sorry. -- Alexander Boettcher Genode Labs http://www.genode-labs.com - http://www.genode.org Genode Labs GmbH - Amtsgericht Dresden - HRB 28424 - Sitz Dresden Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth