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=-6.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, PDS_BAD_THREAD_QP_64,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 73701C433E0 for ; Thu, 28 Jan 2021 17:13:46 +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 0826E64E24 for ; Thu, 28 Jan 2021 17:13:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0826E64E24 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 list by lists.xenproject.org with outflank-mailman.77287.139887 (Exim 4.92) (envelope-from ) id 1l5ArF-0001MX-06; Thu, 28 Jan 2021 17:13:25 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 77287.139887; Thu, 28 Jan 2021 17:13:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l5ArE-0001MQ-TB; Thu, 28 Jan 2021 17:13:24 +0000 Received: by outflank-mailman (input) for mailman id 77287; Thu, 28 Jan 2021 17:13:22 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l5ArC-0001MK-Mh for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 17:13:22 +0000 Received: from mail-wr1-x42a.google.com (unknown [2a00:1450:4864:20::42a]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 1c1569a8-a2fd-4ce5-ba11-b5781c416f8b; Thu, 28 Jan 2021 17:13:21 +0000 (UTC) Received: by mail-wr1-x42a.google.com with SMTP id c12so6176623wrc.7 for ; Thu, 28 Jan 2021 09:13:21 -0800 (PST) Received: from CBGR90WXYV0 ([2a00:23c5:5785:9a01:ad9a:ab78:5748:a7ec]) by smtp.gmail.com with ESMTPSA id x81sm7022901wmg.40.2021.01.28.09.13.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jan 2021 09:13:20 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 1c1569a8-a2fd-4ce5-ba11-b5781c416f8b 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:thread-index :content-language; bh=9488a2P3fJlNgPE67Bm5Bf5hZKojmQ6UAk6SR91FpXg=; b=l20VkycDneWvyXDNlwjvtzZTICcXsA7gaZzdUmnO6Ine2fK997yUQr4adxnfyIbkuf TBwwDLDOcy1aPvjoYNqSeiUxomN76Vk6BBpou8gLg6hhcnqJUVIy839/81lY+qFsArL3 JUSPH7raNKSan6/KzfZ9RHjR9S0Kr7E9ZqCcLbKT4xtx1Ew04IPiAzmh4q/0WlEWIm5I m5zHPc6b7YPeNdvKVJ5x1GQO/HUNXVYzs7FCAtBKXxE81FC5E9hU8TaEUkx6hrJk1lTR TZktU25LMcqyPkG+T5TXGV/AgKODHspFz4Kvefnaf7naQLUdulRvfiivcaIWryuzIk2r U9Fg== 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 :thread-index:content-language; bh=9488a2P3fJlNgPE67Bm5Bf5hZKojmQ6UAk6SR91FpXg=; b=mTzyPn1qa13c+1avPEXLooLxgqCsFFa2lwgAKHsNcGXqBeleTZXt7k1uwew1aSCyVW ja1FyqHx+B3mcmQtzxrlF6To728x9iMTbruJZ7hP14ZFbE1K1+Q9qmCSHQzk9CRiOZZ+ 4DFJcDjmX5pNII+YDqbXidtlY8btxjXj89ilqLs6r+iLo4clVOFBWqTwa6bqQiyUEL+M VDnKQixM6xY8r/lS1bje5lCYGtgERLly++0oNkHcXq8I4s2vIhr4qKlKweScI80M0DEW Vl7h9/b215czKYH+Trgnn3DxaZHG+rnP9k3m/GWS7SefVhwKbs+/YtJi0NQRk9jLz25L sLPQ== X-Gm-Message-State: AOAM5329Zdds/28K9EEJiCipUkxn1iC3FU0tNy1ZArCpqFK6ewyuL/Tq vVOsE8LpmtwNLk+wJ2werVo= X-Google-Smtp-Source: ABdhPJzR2CHSnBbdTSiHdnD0qat4VVIQL/P+8rSIOh2bDxWEqQbOZcC8QbNPzgXHGXMI1N60izv3Vg== X-Received: by 2002:adf:e50e:: with SMTP id j14mr102488wrm.162.1611854001023; Thu, 28 Jan 2021 09:13:21 -0800 (PST) From: Paul Durrant X-Google-Original-From: "Paul Durrant" Reply-To: To: "'Andrew Cooper'" , "'Xen-devel'" Cc: "'Jan Beulich'" , =?utf-8?Q?'Roger_Pau_Monn=C3=A9'?= , "'Wei Liu'" , "'Stefano Stabellini'" , "'Julien Grall'" , "'Volodymyr Babchuk'" , "'Oleksandr Tyshchenko'" References: <20210128160616.17608-1-andrew.cooper3@citrix.com> In-Reply-To: <20210128160616.17608-1-andrew.cooper3@citrix.com> Subject: RE: [PATCH] xen/memory: Reject out-of-range resource 'frame' values Date: Thu, 28 Jan 2021 17:13:17 -0000 Message-ID: <02b601d6f598$e01d9ec0$a058dc40$@xen.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQI3XV/tj1LXdZgysUfBsteFhT3rcKl8dfqA Content-Language: en-gb > -----Original Message----- > From: Andrew Cooper > Sent: 28 January 2021 16:06 > To: Xen-devel > Cc: Andrew Cooper ; Jan Beulich = ; Roger Pau Monn=C3=A9 > ; Wei Liu ; Stefano Stabellini = ; Julien > Grall ; Volodymyr Babchuk = ; Paul Durrant ; > Oleksandr Tyshchenko > Subject: [PATCH] xen/memory: Reject out-of-range resource 'frame' = values >=20 > The ABI is unfortunate, and frame being 64 bits leads to all kinds of = problems > performing correct overflow checks. >=20 > Furthermore, the mixed use of unsigned int and unsigned long in the = call tree > is buggy on arm32 where the two are the same size, and certain = out-of-range > combinations will truncated and be permitted. >=20 > Signed-off-by: Andrew Cooper > --- > CC: Jan Beulich > CC: Roger Pau Monn=C3=A9 > CC: Wei Liu > CC: Stefano Stabellini > CC: Julien Grall > CC: Volodymyr Babchuk > CC: Paul Durrant > CC: Oleksandr Tyshchenko >=20 > Posted ahead of my full v8 series, in the hope that it catches some = people > before the end of the day. Reviewed-by: Paul Durrant