Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1977871pxb; Fri, 5 Mar 2021 04:37:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJzkH7XXFvgNNQf6QkUSuqNRoe2X4l1IS1TPyVknaSPulHbQaR969LyZ23AYaSUzvyUdM6In X-Received: by 2002:aa7:c3c1:: with SMTP id l1mr9081850edr.208.1614947846234; Fri, 05 Mar 2021 04:37:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614947846; cv=none; d=google.com; s=arc-20160816; b=GOFPuXa3hspHZo+jiUDJSbl3JenWXIQ1+uUPME7jNWz22yVlYwenaiyYjo6BrHvtFu pJ3RzFYs3x5mbAwFJDW/fdZEmvA++Wl42fXdi8E9761+EjftHy9+2Won+JUf0xl85es2 U/+j+Z+1UZsjNvjNoYX5IBq7WGzzH+o2ltPFt9CxumOaYO8hS67YEvmf6EniuMnP0IGc 4fklbomJFXcgfAP0VRehtJQmEdmrMwyIUlpVYs4Nb9jgt5ytkfNvea0FRoE/VFXYN9mi su25iUkvYhJw7lnplhVM0Xfs+2ZhnceilyzMs1S27sseIvCSPjNssQbbheNQWmL+9wid IpMw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=03oDusIkpsWK3i4fpi5Nl2X0ak9H2m4HOK/aWbLiK9w=; b=JQExusJ0Z/idYmn7t4HcYu6s0s7k2mv7kFDm1M5xUOKSJ5S2s2pQbYVj7bT2LDuSwW HBdEtCw9tmAq/gim+DInXTazjKk2PoEWyhS2Jvtk7C5NQXK/KKCwkLw4eIhr8aykTB7G 0J5PHEKGb37v6EQjuftuIzBHxwk7BQ3WPtQFy0J5WhMd1QVqbeTOExlj9FawPMQKeRs7 EzEKMhoz/RRWHDtlfNVqTUSGf5IAfKd+eoRBeTxNZqmkqoD97wMzjlG5eKpKpw84vYSd XAAXPO8CvIJHUxfhrFUfr++jyGK1Q6wltXUxG0lXWooTNFVWSxruKUM5+FezAEyJeKDy 8cDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aCyPnl2D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p14si1530961edq.556.2021.03.05.04.37.03; Fri, 05 Mar 2021 04:37:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aCyPnl2D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232113AbhCEMgI (ORCPT + 99 others); Fri, 5 Mar 2021 07:36:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:47882 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232435AbhCEMfg (ORCPT ); Fri, 5 Mar 2021 07:35:36 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6A80F65027; Fri, 5 Mar 2021 12:35:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614947736; bh=acKLn+rjEj4GLNjnDvR2gDy/O+xFPyGO2hiJrIVlMqA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aCyPnl2Dgzc8plwv9+KEVcI0nuYodUWfPHkhjPG6PYVoeDoAwzYey3UWtsCYopjCW YXMalXXWxqwS9urXgqVCEnfjdgv0xYW9trc2bqOffaSfQnOtyko3suGLCUqsTMxVnh BIwWNkzH/rMllForm8aJzmkMtTibDM7WVU8y374w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , Jan Beulich , Juergen Gross Subject: [PATCH 5.4 66/72] xen-netback: respect gnttab_map_refs()s return value Date: Fri, 5 Mar 2021 13:22:08 +0100 Message-Id: <20210305120900.569399337@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210305120857.341630346@linuxfoundation.org> References: <20210305120857.341630346@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jan Beulich commit 2991397d23ec597405b116d96de3813420bdcbc3 upstream. Commit 3194a1746e8a ("xen-netback: don't "handle" error by BUG()") dropped respective a BUG_ON() without noticing that with this the variable's value wouldn't be consumed anymore. With gnttab_set_map_op() setting all status fields to a non-zero value, in case of an error no slot should have a status of GNTST_okay (zero). This is part of XSA-367. Cc: Reported-by: kernel test robot Signed-off-by: Jan Beulich Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/d933f495-619a-0086-5fb4-1ec3cf81a8fc@suse.com Signed-off-by: Juergen Gross Signed-off-by: Greg Kroah-Hartman --- drivers/net/xen-netback/netback.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c @@ -1335,11 +1335,21 @@ int xenvif_tx_action(struct xenvif_queue return 0; gnttab_batch_copy(queue->tx_copy_ops, nr_cops); - if (nr_mops != 0) + if (nr_mops != 0) { ret = gnttab_map_refs(queue->tx_map_ops, NULL, queue->pages_to_map, nr_mops); + if (ret) { + unsigned int i; + + netdev_err(queue->vif->dev, "Map fail: nr %u ret %d\n", + nr_mops, ret); + for (i = 0; i < nr_mops; ++i) + WARN_ON_ONCE(queue->tx_map_ops[i].status == + GNTST_okay); + } + } work_done = xenvif_tx_submit(queue);