Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2F15C433E1 for ; Thu, 30 Jul 2020 08:25:15 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BCDA2204EA for ; Thu, 30 Jul 2020 08:25:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mGPBjbxe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BCDA2204EA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k13s2-0007wf-Ml; Thu, 30 Jul 2020 08:24:58 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k13s1-0007wa-C3 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2020 08:24:57 +0000 X-Inumbo-ID: 263902b0-d23e-11ea-8d1a-bc764e2007e4 Received: from mail-wm1-x343.google.com (unknown [2a00:1450:4864:20::343]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 263902b0-d23e-11ea-8d1a-bc764e2007e4; Thu, 30 Jul 2020 08:24:56 +0000 (UTC) Received: by mail-wm1-x343.google.com with SMTP id 184so5397644wmb.0 for ; Thu, 30 Jul 2020 01:24:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:reply-to:to:cc:references:in-reply-to:subject:date:message-id :mime-version:content-transfer-encoding:content-language :thread-index; bh=gkmi/TXVs4ZmKvtSxhf+eynPuMipQNvbn+uYn5T7hX0=; b=mGPBjbxeVfIIOf9/V1Yn2FIMYIDBTMV1k45ZZcvJJTGvAVB94XRRsXKPOQCEsTMb/5 /HU7hhf70aafn211z/rC3xrygc1Zr1K/knCZMEdXWVamLndWBXjacNBiZiFj0gpK1rYg HTaWLW1Ndccf5xxnH6+awGVC7MOCeB/8/px2eLQ/8azzppDUUP29FWZ8lTgsG5qACR8t BGYEM4GEj/L5eHY5s0ASe9iwmfJMV42svTqer06nVhYUcfPxVpzmuslF3L1ZXTZtL01R y9+rmS2g0vfmK9i+vGw587QiE9//Rl20x1GYEil3p68Xlx6qipl5Nx372jSCKEEbMux6 fS3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:reply-to:to:cc:references:in-reply-to :subject:date:message-id:mime-version:content-transfer-encoding :content-language:thread-index; bh=gkmi/TXVs4ZmKvtSxhf+eynPuMipQNvbn+uYn5T7hX0=; b=oohbu0H9OHSXgf4WZXxIcRm5ZkZj27FGU5hyPrEtAZ58xcYP7fHA6pRB4bYJVFG6hO 60pIUApp2h2TAJd7dS8IaDRfuuRQ95tAw7C/xkzPyA6WmoBKvy+BwkIkygfXUZyoMFZc x6I5TiN/aIDfbxA1KomUl5ujac2SlP6YCpHY2YZuzPzVz3wvoW/bfcVKcuc84MuHR5dj Ec/sPaENvzsp3/haSo4LE/VYwXtCI+jo5Z464GEot48zLdkAG39VYzgg/rfzjB0FYcoe /74wwrBjRpwPqCsX5KquLL6nNsUqGfTWoR6adRbGU3ER5bfAu28GnypPPC6GHZv7u3xK w8ng== X-Gm-Message-State: AOAM532G16eyKzn53LdL+e5U4Ya+VOauSvcQYgRxgUZvQlZOpfFuZ1LV GQmBhgT1PXb/KuuCZYnb2Q8= X-Google-Smtp-Source: ABdhPJziACfL7t1vVPOuUiwQWcV38y2I8CeaCYe9vYcHrqlz6OymBOEMRcAAd5Q8S1Vj9yPaSt0reQ== X-Received: by 2002:a1c:5459:: with SMTP id p25mr12679563wmi.85.1596097495637; Thu, 30 Jul 2020 01:24:55 -0700 (PDT) Received: from CBGR90WXYV0 ([2a00:23c5:5785:9a01:ad9a:ab78:5748:a7ec]) by smtp.gmail.com with ESMTPSA id a123sm8884260wmd.28.2020.07.30.01.24.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Jul 2020 01:24:55 -0700 (PDT) From: Paul Durrant X-Google-Original-From: "Paul Durrant" To: "'Andrew Cooper'" , "'Xen-devel'" References: <20200728113712.22966-1-andrew.cooper3@citrix.com> <20200728113712.22966-4-andrew.cooper3@citrix.com> In-Reply-To: <20200728113712.22966-4-andrew.cooper3@citrix.com> Subject: RE: [PATCH 3/5] xen/memory: Fix compat XENMEM_acquire_resource for size requests Date: Thu, 30 Jul 2020 09:19:42 +0100 Message-ID: <002a01d6664a$2d6d28f0$88477ad0$@xen.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Content-Language: en-gb Thread-Index: AQF6ExwjYkgZ+OK4ROtT1vtJIEnjiAJEb1e+qcZJK6A= X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Reply-To: paul@xen.org Cc: 'Hubert Jasudowicz' , 'Stefano Stabellini' , 'Julien Grall' , 'Wei Liu' , 'Konrad Rzeszutek Wilk' , 'George Dunlap' , =?utf-8?Q?'Micha=C5=82_Leszczy=C5=84ski'?= , 'Jan Beulich' , 'Ian Jackson' Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" > -----Original Message----- > From: Andrew Cooper > Sent: 28 July 2020 12:37 > To: Xen-devel > Cc: Andrew Cooper ; George Dunlap = ; Ian > Jackson ; Jan Beulich ; = Konrad Rzeszutek Wilk > ; Stefano Stabellini ; = Wei Liu ; Julien > Grall ; Paul Durrant ; Micha=C5=82 = Leszczy=C5=84ski ; > Hubert Jasudowicz > Subject: [PATCH 3/5] xen/memory: Fix compat XENMEM_acquire_resource = for size requests >=20 > Copy the nr_frames from the correct structure, so the caller doesn't > unconditionally receive 0. >=20 > Signed-off-by: Andrew Cooper Reviewed-by: Paul Durrant > --- > CC: George Dunlap > CC: Ian Jackson > CC: Jan Beulich > CC: Konrad Rzeszutek Wilk > CC: Stefano Stabellini > CC: Wei Liu > CC: Julien Grall > CC: Paul Durrant > CC: Micha=C5=82 Leszczy=C5=84ski > CC: Hubert Jasudowicz > --- > xen/common/compat/memory.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c > index 3851f756c7..ed92e05b08 100644 > --- a/xen/common/compat/memory.c > +++ b/xen/common/compat/memory.c > @@ -599,7 +599,7 @@ int compat_memory_op(unsigned int cmd, = XEN_GUEST_HANDLE_PARAM(void) compat) > if ( __copy_field_to_guest( > guest_handle_cast(compat, > = compat_mem_acquire_resource_t), > - &cmp.mar, nr_frames) ) > + nat.mar, nr_frames) ) > return -EFAULT; > } > else > -- > 2.11.0