Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp4778325rwn; Sun, 11 Sep 2022 21:37:31 -0700 (PDT) X-Google-Smtp-Source: AA6agR5s9dTXgtQQ2XjehZDLs9QUu5WSWxFSNO+6mheM8MYraniq6yVSbSxfGWHIR74APyBzZC72 X-Received: by 2002:a05:6402:26d4:b0:451:280d:3533 with SMTP id x20-20020a05640226d400b00451280d3533mr10001107edd.316.1662957451171; Sun, 11 Sep 2022 21:37:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662957451; cv=none; d=google.com; s=arc-20160816; b=FXfKsW9phdrPFvJfw6pZ++uWHaIYzkVKZq4g0YN0TUNjba4o7VJ9lRMEI05WM52WRg eYcAA0pgADjsblH5MU5XvVz1WgsCJ/z2OJE2YnA06yhHOYe9XHUDgKd3ZOYkid03my/3 yn5+80gESL1w8ba9jmNSaI6+MNQP3BfFho3ccVUjkO9BGLo8HbknVsc5k6SLy1dcHI/e eAIvXz8diELdSf4nEZ0oEI8O+DZk23w/MGnwKcekHs9Ga/9lquDf7V9WpRfidNP4Jbap hpjakJA3AlJMK63XnadfFWIKUbuY1H4TDzCgmmBBcw2Su5bKiPjzbkKYTpRqhTqI6quX 455g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=UB4fTYWfrW3vEt2oDlOTKBk6EbS08X1+1sCyJYpMX6M=; b=V8hGmlBhaM82UyK72BzHycgPcwjiipq/BQY6ru0PhdlCABrw7n5w12pryvb8GylGVH vrXPnIqfMwxKmfXcKKw6uUc8NW6gZTfJTn09MB+NUclYbT5vP1XaDFuGXJmzS6CcTZU+ GW/81ic6Sa8i9HHqa/9JnENbXvKLmtvtG6M9rxh4pCBzl2kLghTTGqCM3Iv3AyIjxJpf k48jnrV8jC2H+dH2Y166SwV3AfsxsJiYqt10FRn5WpOrFUQMdDBtSv9e4EGUgh3v2F2I My7xfZgIZQQuTdqGUixKiup7NGi7Kb1HVGUaVAYgKTWCxDF2Y+kPn8fmr1I82nBdXdku QXhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@runbox.com header.s=selector2 header.b=wsBt9BrN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=runbox.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y15-20020a056402440f00b00447978abf00si7266436eda.226.2022.09.11.21.37.06; Sun, 11 Sep 2022 21:37:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@runbox.com header.s=selector2 header.b=wsBt9BrN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=runbox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229565AbiILEgE (ORCPT + 99 others); Mon, 12 Sep 2022 00:36:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbiILEgD (ORCPT ); Mon, 12 Sep 2022 00:36:03 -0400 Received: from mailtransmit04.runbox.com (mailtransmit04.runbox.com [IPv6:2a0c:5a00:149::25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AC121AF28 for ; Sun, 11 Sep 2022 21:36:01 -0700 (PDT) Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com) by mailtransmit04.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1oXact-009cFM-Sa; Mon, 12 Sep 2022 06:00:51 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; s=selector2; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date: Subject:Cc:To:From; bh=UB4fTYWfrW3vEt2oDlOTKBk6EbS08X1+1sCyJYpMX6M=; b=wsBt9B rNhZlSmXaFOaUsL7bzGgtj6T7a5eDibuOqEJyMGFsWPJHhhEZ7XYhJuc4B5Nl1EqurFY12BPedUZz bfHkSGxrj1XbJp1AwXJy0UOSEcx2IeWNvPkf3IKz50q84/OFGAMT03HUT1v3MeAGEyBUOOdnZzM8a /o0ye5rKua9T7Klgi/hJwrnQqymFfyE5e4cG5MtZ19CYsFxRMRXUnrV+FKN21itSK65H6euVC3LGJ MQiDuyeA+4MVqW75zaAkcDGoAX+cBOMvTuYilUiWPpXxB0ZDLOvM12//HqjbLUNrSCWzHlJbg8B1B 9z7JeYqQ1fpFHHDJI73HWwoCXW9A==; Received: from [10.9.9.73] (helo=submission02.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1oXact-0004X5-Cu; Mon, 12 Sep 2022 06:00:51 +0200 Received: by submission02.runbox with esmtpsa [Authenticated ID (536975)] (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) id 1oXach-0003S3-DL; Mon, 12 Sep 2022 06:00:39 +0200 From: "M. Vefa Bicakci" To: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Cc: m.v.b@runbox.com, Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Demi Marie Obenour , Gerd Hoffmann Subject: [PATCH 0/2] xen/gntdev: Fixes for leaks and VMA splitting Date: Mon, 12 Sep 2022 00:00:00 -0400 Message-Id: <20220912040002.198191-1-m.v.b@runbox.com> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, The changes in this patch series intend to fix the Xen grant device driver, so that grant mapping leaks caused by partially failed grant mapping operations are avoided with the first patch, and so that the splitting of VMAs does not result in incorrectly unmapped grant pages with the second patch. The second patch also prevents a similar issue in a double-mapping scenario, where mmap() is used with MAP_FIXED to map grants over an existing mapping created with the same grants, and where grant pages are unmapped incorrectly as well. These commits were tested on top of Linux v5.15.67, but I have also verified that they compile fine on top of the base commit mentioned at the bottom of this cover letter. The base commit in question is tagged as "next-20220909". Thank you, Vefa M. Vefa Bicakci (2): xen/gntdev: Prevent leaking grants xen/gntdev: Accommodate VMA splitting drivers/xen/gntdev-common.h | 3 +- drivers/xen/gntdev.c | 90 +++++++++++++++++++++---------------- 2 files changed, 54 insertions(+), 39 deletions(-) base-commit: 9a82ccda91ed2b40619cb3c10d446ae1f97bab6e -- 2.37.3