Skip to content

Commit 6bab26a

Browse files
committed
tipc: Return non-zero value from tipc_udp_addr2str() on error
jira LE-3201 cve CVE-2024-42284 Rebuild_History Non-Buildable kernel-rt-4.18.0-553.27.1.rt7.368.el8_10 commit-author Shigeru Yoshida <[email protected]> commit fa96c6b tipc_udp_addr2str() should return non-zero value if the UDP media address is invalid. Otherwise, a buffer overflow access can occur in tipc_media_addr_printf(). Fix this by returning 1 on an invalid UDP media address. Fixes: d0f9193 ("tipc: add ip/udp media type") Signed-off-by: Shigeru Yoshida <[email protected]> Reviewed-by: Tung Nguyen <[email protected]> Signed-off-by: David S. Miller <[email protected]> (cherry picked from commit fa96c6b) Signed-off-by: Jonathan Maple <[email protected]>
1 parent bdab167 commit 6bab26a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

net/tipc/udp_media.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,11 @@ static int tipc_udp_addr2str(struct tipc_media_addr *a, char *buf, int size)
129129
snprintf(buf, size, "%pI4:%u", &ua->ipv4, ntohs(ua->port));
130130
else if (ntohs(ua->proto) == ETH_P_IPV6)
131131
snprintf(buf, size, "%pI6:%u", &ua->ipv6, ntohs(ua->port));
132-
else
132+
else {
133133
pr_err("Invalid UDP media address\n");
134+
return 1;
135+
}
136+
134137
return 0;
135138
}
136139

0 commit comments

Comments
 (0)