Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1979763pxb; Fri, 5 Mar 2021 04:40:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJyt/6v07+4nyy3d5VQZrRquMBk3qk34E7VJwq4pnD1EAFGWRY8YaQdaSr/7mlFj/+Z7057g X-Received: by 2002:a17:906:801:: with SMTP id e1mr1933858ejd.465.1614948023323; Fri, 05 Mar 2021 04:40:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614948023; cv=none; d=google.com; s=arc-20160816; b=kpC3Uig0vGODT6ha5KRzmHxWsUrFoHHKqgOnXEF7XRq04eTH/SsBgMv0BOY++EtAsj gktA8m4tTwjqNwovpZd49HOcsbEUEfpEHiqts2ykxkZ9eVi9ew/cAR83/EyTq+DpNuY9 b3uH+OV0CnRrgc1ltlyAm+uv02kRpJtPebQTDW27ZL02Pisb8fQ0NwqXWeuaRs3owS9x U5dmkgY9kSP1n+2zwrDQXGkRqvh2Ioa2vMXYbRRRWlh5/0rsW7BRfLh+MIvyvKc4NztO wZINsbpvjTFcIEQs5EifFySXUBrcDXZovbNwQZQUioH8Od5gUKLi7/qmjgFNnrCHza9n kQFg== 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=yhObvdj13HuMSzlR36X7F4RgBR6BnhrSeA/zKMzWkHY=; b=gKG2RhETTBSfALv64IhKq/alSYV8ITyrp0h560+yymWweBl+Yj1gGQQbCSio+JwAst dPH/g93Knhd7YyOuCVM1xrJeGdPB4keDYB/Rx+Mb2jgHOQ30I2XOsvSh4PME6DghLBI4 uKE8UVV5hhKCIKMrFjzz0b+iJtxHNwUYH8YFkf4dWuuqjpq9Xz1Jl9FfU8GrrESPKB2k H+w8RFfh51dkyX/zknKEiPRzmFbh0/gWElObPf7w3fypEV0jC350knNmXg4EAYDait39 SSGwnTzFod33ynQrgrO+2EIMu38/XcLnbdoibk2HVno+fSP1akJgXbtbhxmKYUM7GjvT 6xiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ijNEfzqS; 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 d5si1415857edr.381.2021.03.05.04.40.00; Fri, 05 Mar 2021 04:40:23 -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=ijNEfzqS; 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 S232741AbhCEMjB (ORCPT + 99 others); Fri, 5 Mar 2021 07:39:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:51180 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233208AbhCEMiI (ORCPT ); Fri, 5 Mar 2021 07:38:08 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id F2F2264FF0; Fri, 5 Mar 2021 12:38:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614947887; bh=0geVAclmWYxJtTl967G7WCvrc0OimZqO6eXFDTYSpc0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ijNEfzqSe6veHcT3wVwA4vMuXP/EdAVpEf6CARfZHDFEAnIDkTLgNNyGyX3jX29jf eTxhkzN/+XdqfmG1f0xQhiha+PpW7AxkpyMKAQZHYthf4ST+dqsXIamAo6x4FByBnp 2jbBQ6AUtJXmz4LxOtNIR8HNlTqW4Nr4sFIySVjY= 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 4.19 47/52] xen-netback: respect gnttab_map_refs()s return value Date: Fri, 5 Mar 2021 13:22:18 +0100 Message-Id: <20210305120855.963665111@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210305120853.659441428@linuxfoundation.org> References: <20210305120853.659441428@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 @@ -1326,11 +1326,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);