Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp758504ybl; Wed, 4 Dec 2019 10:21:46 -0800 (PST) X-Google-Smtp-Source: APXvYqxNCyG8kOBXNIp/6mjQFmHn1o16gf156S+65R8LvlTrSgrfSmM24kkv9mp2BgRhKhleyU46 X-Received: by 2002:a54:4896:: with SMTP id r22mr3873164oic.30.1575483706399; Wed, 04 Dec 2019 10:21:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575483706; cv=none; d=google.com; s=arc-20160816; b=XlmVrrUTvSQuCOosUrYZVYNXzS6QXmKmU4FlN3H6g/UywR/6BI5Sm1Ib5JZwk/bkvI HHhS3//jCTYaY8ymiB99llEJEET+AFD19Lym4tn0kc1Pf4nzvOyn/QJRhSOpC/hUkMsP z/HrH5jWwTImuGXOgC2B3NkWfgjeLh/cfUYN7TveV4cmsa/jvr+10k3znG2w+emhnNPU 1ikvKYgpt9vRzPL8Cysrw6d3XdUtYb8MII+XFzxJfFaW+h9LrAQqtSY3eQyAZyOhiGA+ aKK8sdNvEzazKr1Y7SCuOkCmXa7y2Ci5bhScetUhIRt1ZiAfDyd6m5/QqIxfHvKkyL1H o0iQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=GS2slGtC1BhnOMToCcNI9aITryUd/0DFVI8Yo6KdkHk=; b=w5xp6EsR9qr+NN6WEiVIUT3+xhB+bdw4DVT7G3tyP7mjNc/n/ReG+phN8kY9vuouSW 4f7C34vCyPd4yAk1qn3w87UH/nWT9s3DSnaQQzNrdmBHBBs9ol9fTm7iZp9zZyVllOVf ncywB7Tk3mwnHcCZ/T068JK91zZtlifIKCCa6eoay9FL1pLR1WEnzmCNO4GJtPRyRISN cTg8o7s0UVros+R4wDQniGzVIa0EluPoUyNYinGWUNe3wGRWAaBYFWiQbilLUkoQHWc4 zIK7DsaLmAH754QxJvfvWoXhBbeCGnTUTYHhUT+r9lkgP3Uj5J2ZX72xcdWSVTjUv03l E87Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yfWyEtxt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v145si952847oia.68.2019.12.04.10.21.34; Wed, 04 Dec 2019 10:21:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yfWyEtxt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730872AbfLDSIK (ORCPT + 99 others); Wed, 4 Dec 2019 13:08:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:59406 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730864AbfLDSIJ (ORCPT ); Wed, 4 Dec 2019 13:08:09 -0500 Received: from localhost (unknown [217.68.49.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 232EA20675; Wed, 4 Dec 2019 18:08:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575482888; bh=HOp3Ta6NZpoFRwyh48a0gkxYv6Tz0xDYYwBI37p01V8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yfWyEtxt5wQTRh5J8a10XuHE21OO2cNYcYyNsBQBI7nNBAEYXl/H48GMfZeacSnyr /zCXnP2GCLu/QTvuTBq6UfSHXkwpiTEr6sGhrg0WO6zy/JoFIRviyH3+lsGeMfsLVt T6sBXgbcktQ81HivmSuvCMwwCVJ/6A4nmixWkABE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paolo Abeni , "David S. Miller" Subject: [PATCH 4.14 174/209] openvswitch: remove another BUG_ON() Date: Wed, 4 Dec 2019 18:56:26 +0100 Message-Id: <20191204175335.467081480@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191204175321.609072813@linuxfoundation.org> References: <20191204175321.609072813@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Paolo Abeni [ Upstream commit 8a574f86652a4540a2433946ba826ccb87f398cc ] If we can't build the flow del notification, we can simply delete the flow, no need to crash the kernel. Still keep a WARN_ON to preserve debuggability. Note: the BUG_ON() predates the Fixes tag, but this change can be applied only after the mentioned commit. v1 -> v2: - do not leak an skb on error Fixes: aed067783e50 ("openvswitch: Minimize ovs_flow_cmd_del critical section.") Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/openvswitch/datapath.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c @@ -1372,7 +1372,10 @@ static int ovs_flow_cmd_del(struct sk_bu OVS_FLOW_CMD_DEL, ufid_flags); rcu_read_unlock(); - BUG_ON(err < 0); + if (WARN_ON_ONCE(err < 0)) { + kfree_skb(reply); + goto out_free; + } ovs_notify(&dp_flow_genl_family, reply, info); } else { @@ -1380,6 +1383,7 @@ static int ovs_flow_cmd_del(struct sk_bu } } +out_free: ovs_flow_free(flow, true); return 0; unlock: