public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleh Konko <security@1seal.org>
To: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Cc: "jmaloy@redhat.com" <jmaloy@redhat.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"horms@kernel.org" <horms@kernel.org>,
	"tipc-discussion@lists.sourceforge.net"
	<tipc-discussion@lists.sourceforge.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: [PATCH net] tipc: fix bc_ackers underflow on duplicate GRP_ACK_MSG
Date: Mon, 30 Mar 2026 15:05:08 +0000	[thread overview]
Message-ID: <043673b8636b4f60a52589330cb55e83.security@1seal.org> (raw)

The GRP_ACK_MSG handler in tipc_group_proto_rcv() unconditionally
decrements grp->bc_ackers on every inbound group ACK, even when the
sending member has already acknowledged the current broadcast round.

Because bc_ackers is a u16, a single duplicate ACK received after the
legitimate set has drained the counter to zero wraps it to 65535.
Once wrapped, tipc_group_bc_cong() permanently reports congestion,
blocking all subsequent group broadcasts on the affected socket until
the group is recreated.

The member-removal path (tipc_group_delete_member) already handles this
correctly: it only decrements bc_ackers when the counter is non-zero
and the member still owes an ACK for the current broadcast round.

Apply the same forward-progress guard to the GRP_ACK_MSG handler: only
update m->bc_acked and decrement bc_ackers when the inbound ack value
is strictly ahead of what has already been recorded for that member,
and only decrement when bc_ackers is non-zero.

Fixes: 75da2163dbb6 ("tipc: introduce communication groups")
Cc: stable@vger.kernel.org
Signed-off-by: Oleh Konko <security@1seal.org>
---
 net/tipc/group.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/net/tipc/group.c b/net/tipc/group.c
index e0e6227b433..41fa7bb3091 100644
--- a/net/tipc/group.c
+++ b/net/tipc/group.c
@@ -745,7 +745,7 @@ void tipc_group_proto_rcv(struct tipc_group *grp, bool *usr_wakeup,
 	u32 node = msg_orignode(hdr);
 	u32 port = msg_origport(hdr);
 	struct tipc_member *m, *pm;
-	u16 remitted, in_flight;
+	u16 remitted, in_flight, acked;
 
 	if (!grp)
 		return;
@@ -798,8 +798,13 @@ void tipc_group_proto_rcv(struct tipc_group *grp, bool *usr_wakeup,
 	case GRP_ACK_MSG:
 		if (!m)
 			return;
-		m->bc_acked = msg_grp_bc_acked(hdr);
-		if (--grp->bc_ackers)
+		acked = msg_grp_bc_acked(hdr);
+		if (less(m->bc_acked, acked)) {
+			m->bc_acked = acked;
+			if (grp->bc_ackers)
+				grp->bc_ackers--;
+		}
+		if (grp->bc_ackers)
 			return;
 		list_del_init(&m->small_win);
 		*m->group->open = true;
-- 
2.50.0



             reply	other threads:[~2026-03-30 15:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-30 15:05 Oleh Konko [this message]
2026-04-01  6:23 ` [PATCH net] tipc: fix bc_ackers underflow on duplicate GRP_ACK_MSG Tung Quang Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=043673b8636b4f60a52589330cb55e83.security@1seal.org \
    --to=security@1seal.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jmaloy@redhat.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=tipc-discussion@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox