netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.9 01/16] openvswitch: Fix double reporting of drops in dropwatch
@ 2022-10-09 22:26 Sasha Levin
  2022-10-09 22:26 ` [PATCH AUTOSEL 4.9 02/16] openvswitch: Fix overreporting " Sasha Levin
                   ` (14 more replies)
  0 siblings, 15 replies; 18+ messages in thread
From: Sasha Levin @ 2022-10-09 22:26 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Mike Pattrick, David S . Miller, Sasha Levin, pshelar, edumazet,
	kuba, pabeni, netdev, dev

From: Mike Pattrick <mkp@redhat.com>

[ Upstream commit 1100248a5c5ccd57059eb8d02ec077e839a23826 ]

Frames sent to userspace can be reported as dropped in
ovs_dp_process_packet, however, if they are dropped in the netlink code
then netlink_attachskb will report the same frame as dropped.

This patch checks for error codes which indicate that the frame has
already been freed.

Signed-off-by: Mike Pattrick <mkp@redhat.com>
Link: https://bugzilla.redhat.com/show_bug.cgi?id=2109946
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/openvswitch/datapath.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index c28f0e2a7c3c..ab318844a19b 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -278,10 +278,17 @@ void ovs_dp_process_packet(struct sk_buff *skb, struct sw_flow_key *key)
 		upcall.portid = ovs_vport_find_upcall_portid(p, skb);
 		upcall.mru = OVS_CB(skb)->mru;
 		error = ovs_dp_upcall(dp, skb, key, &upcall, 0);
-		if (unlikely(error))
-			kfree_skb(skb);
-		else
+		switch (error) {
+		case 0:
+		case -EAGAIN:
+		case -ERESTARTSYS:
+		case -EINTR:
 			consume_skb(skb);
+			break;
+		default:
+			kfree_skb(skb);
+			break;
+		}
 		stats_counter = &stats->n_missed;
 		goto out;
 	}
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2022-10-17 12:50 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-09 22:26 [PATCH AUTOSEL 4.9 01/16] openvswitch: Fix double reporting of drops in dropwatch Sasha Levin
2022-10-09 22:26 ` [PATCH AUTOSEL 4.9 02/16] openvswitch: Fix overreporting " Sasha Levin
2022-10-09 22:26 ` [PATCH AUTOSEL 4.9 03/16] tcp: annotate data-race around tcp_md5sig_pool_populated Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 04/16] xfrm: Update ipcomp_scratches with NULL when freed Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 05/16] net: xscale: Fix return type for implementation of ndo_start_xmit Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 06/16] net: lantiq_etop: " Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 07/16] net: ftmac100: fix endianness-related issues from 'sparse' Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 08/16] Bluetooth: L2CAP: initialize delayed works at l2cap_chan_create() Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 09/16] net: davicom: Fix return type of dm9000_start_xmit Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 10/16] net: ethernet: ti: davinci_emac: Fix return type of emac_dev_xmit Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 11/16] net: korina: Fix return type of korina_send_packet Sasha Levin
2022-10-17 10:25   ` Pavel Machek
2022-10-17 12:50     ` Pavel Machek
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 12/16] Bluetooth: hci_sysfs: Fix attempting to call device_add multiple times Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 13/16] can: bcm: check the result of can_send() in bcm_can_tx() Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 14/16] wifi: rt2x00: don't run Rt5592 IQ calibration on MT7620 Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 15/16] Bluetooth: L2CAP: Fix user-after-free Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 16/16] r8152: Rate limit overflow messages Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).