Skip to content

Commit ee478e9

Browse files
committed
tipc: Return non-zero value from tipc_udp_addr2str() on error
jira LE-2157 cve CVE-2024-42284 Rebuild_History Non-Buildable kernel-5.14.0-503.14.1.el9_5 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 f5a094b commit ee478e9

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
@@ -135,8 +135,11 @@ static int tipc_udp_addr2str(struct tipc_media_addr *a, char *buf, int size)
135135
snprintf(buf, size, "%pI4:%u", &ua->ipv4, ntohs(ua->port));
136136
else if (ntohs(ua->proto) == ETH_P_IPV6)
137137
snprintf(buf, size, "%pI6:%u", &ua->ipv6, ntohs(ua->port));
138-
else
138+
else {
139139
pr_err("Invalid UDP media address\n");
140+
return 1;
141+
}
142+
140143
return 0;
141144
}
142145

0 commit comments

Comments
 (0)