Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5148066imm; Wed, 12 Sep 2018 01:40:40 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYwkuMd3fQlssHAsbTrzdcUvEtIVvYAaBAQvsD4ajlqhBrFF+6xvGh3K0+x+xw+yODLR+Kc X-Received: by 2002:a17:902:c8:: with SMTP id a66-v6mr922052pla.269.1536741640735; Wed, 12 Sep 2018 01:40:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536741640; cv=none; d=google.com; s=arc-20160816; b=bCK9vOYNvzihuh61UR9ww+xwRKriAL5pLGFdT+YVC3B01C9/SxJATMgjMwcYHIqVs4 Y6OIlY7ezwtSyi3noENw2oxqUSXPBapGoWsk0ccdwGjDgRRyJlaZ+eOllmVgB2eDscbw Gut+Ftz23A/qJKTUnX28CGXdNAgUKU6v/9TplbU26SHdTFN9JGiN9q0zTesym4Ov0lOW bAdVGJeLqag6ZMUhbKg9aC4jZjay5I5jW+X3e58n7BUS7L5Lyzh+Kx4fE2jTgc+UCu2X mAeGeL6fjreRG+rmJGvvnWSUTNTzsTDBFU+Osu9yC9etCEA/27WUCRXG3shgXhNqzXzE 2GzA== 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:to :from:date; bh=jefzSQPx7WrzRfczv5Oo5zDFuq5LYbMY8hxKxlX/+Fw=; b=jvCq0Pr9epFw1LOrI3+VQZZrQY0L1aSXpjvyfxf/LM2Sj6xGt2uitKb6gqrH8Hv/MV k9BsNoLNwhp9xRsXe8Fg99Zizi3DVrSaYaDARQ2Uiun6C6ig+cbU4cgL8PDlKJQGysrC tx1Gux+AHqcYWuy9X9zmMBTsRu42yVsi9pAfUFngDbIK92L+9Nhx+aaFa3vET2TFwhze kfPPEPKf7Dq5XPco3X2BWLEJ07s0dpsFnLcrPptgPzsemwSboePfz+EsmVrwM1uvotK7 FQaEDPyB9Ll9e+haznXIb3n7JPsJQWq1WBzZuvlevuhCEJNf0njRdafn9Uqncx4VoTZM mQXQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o20-v6si477683pgk.120.2018.09.12.01.40.25; Wed, 12 Sep 2018 01:40:40 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727746AbeILNmR (ORCPT + 99 others); Wed, 12 Sep 2018 09:42:17 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:59590 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726624AbeILNmR (ORCPT ); Wed, 12 Sep 2018 09:42:17 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 94CB18011309; Wed, 12 Sep 2018 08:38:47 +0000 (UTC) Received: from ws.net.home (ovpn-117-57.ams2.redhat.com [10.36.117.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6D3D0FA984; Wed, 12 Sep 2018 08:38:46 +0000 (UTC) Date: Wed, 12 Sep 2018 10:38:44 +0200 From: Karel Zak To: Eugene Korenevsky , Davidlohr Bueso , linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, Ard Biesheuvel Subject: Re: [PATCH v2] efi: take size of partition entry from GPT header Message-ID: <20180912083844.iegei2kobcz4b7ag@ws.net.home> References: <20180911161527.GA30689@vnote> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180911161527.GA30689@vnote> User-Agent: NeoMutt/20170912-66-504cd9 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 12 Sep 2018 08:38:47 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 12 Sep 2018 08:38:47 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kzak@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 11, 2018 at 07:15:27PM +0300, Eugene Korenevsky wrote: > +static gpt_entry *get_gpt_entry(gpt_header *gpt_hdr, gpt_entry *ptes, u32 index) > +{ > + return (gpt_entry *)((u8 *)ptes + gpt->sizeof_partition_entry * index); I guess header use LE, so you need: le32_to_cpu(gpt_hdr->sizeof_partition_entry) Karel -- Karel Zak http://karelzak.blogspot.com