Skip to contentSkip to conversation

sctp: reset stored flag for each association

PATCH Applied Weiming Shi 4 participants 4 messages Nov 8 – Nov 11

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sctp: reset stored flag for each association

sctp_send_asconf_del_ip() walks every association on an endpoint. The stored flag records that the current association took the single-homed deferral path and therefore did not allocate an ASCONF chunk. It is currently scoped to the whole function. Once one association sets it, later eligible multihomed associations allocate chunks but skip sctp_send_asconf(), leaking each chunk and its skb.

Reset stored for every association so only an association taking the deferral path skips transmission. In an A/B kmemleak test, the vulnerable kernel reported 210 leaked objects from this call path and the fixed kernel reported none.

Fixes 8a07eb0a50ae ("sctp: Add ASCONF operation on the single-homed host")
---
 net/sctp/socket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/sctp/socket.c +1 -1
index c7b9e325ec1c..ed91ceff45a9 100644
@@ -771,7 +771,6 @@ static int sctp_send_asconf_del_ip(struct sock		*sk,
 	struct sctp_sockaddr_entry *saddr;
 	int 			i;
 	int 			retval = 0;
-	int			stored = 0;
 
 	chunk = NULL;
 	sp = sctp_sk(sk);
@@ -784,6 +783,7 @@ static int sctp_send_asconf_del_ip(struct sock		*sk,
 		 __func__, sk, addrs, addrcnt);
 
 	list_for_each_entry(asoc, &ep->asocs, asocs) {
+		int stored = 0;
 
 		if (!asoc->peer.asconf_capable)
 			continue;
Signature · 1 line
2.56.0
#1 lore raw
This is an automated message. This series looks like a fix, but its commit messages seem to be missing some information:

Hi!

This is an automated message. This series looks like a fix, but its commit messages seem to be missing some information:

- How the issue was discovered, e.g. hit in production, hit during development, syzbot report, manual code inspection, LLM or static analysis tool scan.

Please do not repost the series just to address the above. Instead, reply to this email with the missing information, so that reviewers can take it into account. If the series needs another revision for other reasons, please include the information in the commit messages then.

The evaluation is done by an LLM so it may be wrong, if you think that is the case please reply and explain.

maintainer Acked-by on v1 1/1
#2 lore raw
In reply to Weiming Shi
Quoted 42 lines · Weiming Shi

sctp_send_asconf_del_ip() walks every association on an endpoint. The stored flag records that the current association took the single-homed deferral path and therefore did not allocate an ASCONF chunk. It is currently scoped to the whole function. Once one association sets it, later eligible multihomed associations allocate chunks but skip sctp_send_asconf(), leaking each chunk and its skb.

Reset stored for every association so only an association taking the deferral path skips transmission. In an A/B kmemleak test, the vulnerable kernel reported 210 leaked objects from this call path and the fixed kernel reported none.

Fixes 8a07eb0a50ae ("sctp: Add ASCONF operation on the single-homed host")
---
 net/sctp/socket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/sctp/socket.c +1 -2
index c7b9e325ec1c..ed91ceff45a9 100644
@@ -771,7 +771,6 @@ static int sctp_send_asconf_del_ip(struct sock              *sk,
        struct sctp_sockaddr_entry *saddr;
        int                     i;
        int                     retval = 0;
-       int                     stored = 0;
 
        chunk = NULL;
        sp = sctp_sk(sk);
@@ -784,6 +783,7 @@ static int sctp_send_asconf_del_ip(struct sock              *sk,
                 __func__, sk, addrs, addrcnt);
 
        list_for_each_entry(asoc, &ep->asocs, asocs) {
+               int stored = 0;
 
                if (!asoc->peer.asconf_capable)
                        continue;
--
Quoted 2 lines

2.56.0

#3 lore raw
In reply to Weiming Shi
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Sun, 8 Nov 2026 08:11:49 -0800 you wrote:

sctp_send_asconf_del_ip() walks every association on an endpoint. The stored flag records that the current association took the single-homed deferral path and therefore did not allocate an ASCONF chunk. It is currently scoped to the whole function. Once one association sets it, later eligible multihomed associations allocate chunks but skip sctp_send_asconf(), leaking each chunk and its skb.

[...]

Here is the summary with links:
- [net] sctp: reset stored flag for each association

    https://git.kernel.org/netdev/net/c/173712d868eb

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html