Received: by 2002:a05:6358:795:b0:dc:4c66:fc3e with SMTP id n21csp1462011rwj; Sun, 30 Oct 2022 00:50:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5IkfrCfsk+hw6x+1wzDtrcjK8TZ8FcLTKwUHflfl69Ty7DlnR0uXDXaEqXGKf/qlzn/cx+ X-Received: by 2002:a63:41c5:0:b0:46e:f23a:9fa2 with SMTP id o188-20020a6341c5000000b0046ef23a9fa2mr7460208pga.77.1667116235083; Sun, 30 Oct 2022 00:50:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667116235; cv=none; d=google.com; s=arc-20160816; b=JgyQubx9P4WlgB9MbAKilk5gPzOSGLhjJonTNwufwYdcCOmlNRcom5tSj+6IJ8R4xx VWJ2h2NSMQNX+0MOzNBu2Sg/VqenjCz+vjjOWGHZwDkwVHEn6JPeiXCyUVDnaUbKNNjB iezAQ42Z6cUaX5GHYVDyp022meYBGNuOPD2ncJXkgWJad2GlGY5zs2Z4Xi/B0hh1CgVY i98RECU0ihax//EFttwtneCegrHfPxhmjUmzR0KIJPVujG2XqlLLTyKTLTNqYIKgJkhz Fgs+GzlylvPd0EpRurGHS2Mb0+qMg8ANAyxxA7zn4GL+dgOLu7cOgnfQ45focG4H7nUE /uaA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=vJbgWUEbOHgWLPm7ppN5SvNsjatY4g8zRiCFyL+Xdn4=; b=xGKPFxf5rT9Ql+mXwgZIZLJZylbS5hW4306qLMYX4X9pEd2EXsa1Kf7ozIPURmkMk+ Cq9QvlmN1LZlJUuH2Rw+3YoHGbtccPXuiaY0UN4Q/6NfFpjHV2Tt+u96Xy2afuNZk9Ho 47wHZdILWrAiClNJqB/73Z9TobeAFeVbV0a3q+rhCSZduVz4W2D32dMki35ygGez6N0O icsNl7fOG3PgVkNTkYq+8zhgw8ch4kqAVhGpwnzh9TqJ3yg2A7l3h+C1GZQbsFM0sIoy MpKvOXfZdKpdZkysIYygOlyWYso43ilbrGsR5U+Vsf7wELe0oteP9cPuC7MJkWleYhS0 5HMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@invisiblethingslab.com header.s=fm3 header.b=IwHb1Zgz; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=YnAuvN76; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id il3-20020a17090b164300b002008948605esi4962177pjb.13.2022.10.30.00.50.23; Sun, 30 Oct 2022 00:50:35 -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=@invisiblethingslab.com header.s=fm3 header.b=IwHb1Zgz; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=YnAuvN76; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229783AbiJ3HNZ (ORCPT + 99 others); Sun, 30 Oct 2022 03:13:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbiJ3HNU (ORCPT ); Sun, 30 Oct 2022 03:13:20 -0400 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 124E7F16; Sun, 30 Oct 2022 00:13:16 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 7D9E35C009A; Sun, 30 Oct 2022 03:13:15 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sun, 30 Oct 2022 03:13:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-transfer-encoding:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1667113995; x=1667200395; bh=vJbgWUEbOHgWLPm7ppN5SvNsjatY4g8zRiC FyL+Xdn4=; b=IwHb1Zgz07Y3pVKscW2hU3i2Gk3zGfp/GIJEDSY1Lss/QbNU4KN qGzcy7D8wmGTR8+s7sXppPmh4KRx8dpUORuYucIm+RUGpnGrvt0+gnmR1ZC/PO4t r1aVb/4Mo027QXSmQo9QORe21bNc0Nm0KaAJh+hhnDLsvK4uMSPsHdBlWR7JuStf ZeEQyXf1lICQohjcILHY8OGKNOijySG8dVn/GBEBgb9YqhHVjDJOAYOiBfg8ERL6 FWbTFQOlG9NWUoMWqT3tIAlfAqGYGUAQS3+rp/URv0HvZK1hdcSMJqZd64nmGbds mS+AEnn0p2dCDw3GCfwF5aiCRibL/lcexbw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1667113995; x=1667200395; bh=vJbgWUEbOHgWL Pm7ppN5SvNsjatY4g8zRiCFyL+Xdn4=; b=YnAuvN76YQGIKkObsRtmsUAlXuVS/ JEOrnqn5TBT4Ht3RE+VnSZ7fHsmwL6Mv6dksR5pBse1+Bs16ey+TSxk6Cp6T+z3f /S9/EwhDTraScgg7K8Sdsttaj50uOatQHIfEQIwaPuyGy8qmbYyol8n819AGbmm6 H7FFwwBIHI3fVR5QXTtWi0Y8MnVj7K20kBmM9EsT86Fk/6cwDCIXsaSbKU8cJqu2 oSV9mTnRBkZREziGyvfjR0+32O8O4CkwZWYmieWKr19jhQ6vlStL5ylxCg6neKvJ duBsWolhOOFGK2hTwhSRtUgDP9GA+02wZA8RUsxg3mcqZvtGm8g9G219Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrtdelgdduudekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepffgvmhhi ucforghrihgvucfqsggvnhhouhhruceouggvmhhisehinhhvihhsihgslhgvthhhihhngh hslhgrsgdrtghomheqnecuggftrfgrthhtvghrnhepkeevkeevgedufffggfelkeduueek teelgfevlefhheeutdefvdfgkeelhfetgfefnecuffhomhgrihhnpehkvghrnhgvlhdroh hrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegu vghmihesihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhm X-ME-Proxy: Feedback-ID: iac594737:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 30 Oct 2022 03:13:14 -0400 (EDT) From: Demi Marie Obenour To: Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Greg Kroah-Hartman , Sasha Levin , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Cc: Jan Beulich , xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Demi Marie Obenour Subject: [PATCH 1/3] Xen/gntdev: don't ignore kernel unmapping error Date: Sun, 30 Oct 2022 03:12:41 -0400 Message-Id: <20221030071243.1580-2-demi@invisiblethingslab.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221030071243.1580-1-demi@invisiblethingslab.com> References: <20221030071243.1580-1-demi@invisiblethingslab.com> 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,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE 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 From: Jan Beulich commit f28347cc66395e96712f5c2db0a302ee75bafce6 upstream. While working on XSA-361 and its follow-ups, I failed to spot another place where the kernel mapping part of an operation was not treated the same as the user space part. Detect and propagate errors and add a 2nd pr_debug(). Signed-off-by: Jan Beulich Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/c2513395-74dc-aea3-9192-fd265aa44e35@suse.com Signed-off-by: Juergen Gross Signed-off-by: Demi Marie Obenour Co-authored-by: Demi Marie Obenour --- drivers/xen/gntdev.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c index 54fee4087bf1078803c230ad2081aafa8415cf53..8cf9f2074c5d57bff81364d7d6a70b0007a85e44 100644 --- a/drivers/xen/gntdev.c +++ b/drivers/xen/gntdev.c @@ -407,6 +407,14 @@ static void __unmap_grant_pages_done(int result, map->unmap_ops[offset+i].handle, map->unmap_ops[offset+i].status); map->unmap_ops[offset+i].handle = -1; + if (use_ptemod) { + WARN_ON(map->kunmap_ops[offset+i].status && + map->kunmap_ops[offset+i].handle != -1); + pr_debug("kunmap handle=%u st=%d\n", + map->kunmap_ops[offset+i].handle, + map->kunmap_ops[offset+i].status); + map->kunmap_ops[offset+i].handle = -1; + } } /* * Decrease the live-grant counter. This must happen after the loop to -- 2.38.1