Skip to content

Commit be28c14

Browse files
q2venkuba-moo
authored andcommitted
udplite: Print deprecation notice.
Recently syzkaller reported a 7-year-old null-ptr-deref [0] that occurs when a UDP-Lite socket tries to allocate a buffer under memory pressure. Someone should have stumbled on the bug much earlier if UDP-Lite had been used in a real app. Also, we do not always need a large UDP-Lite workload to hit the bug since UDP and UDP-Lite share the same memory accounting limit. Removing UDP-Lite would simplify UDP code removing a bunch of conditionals in fast path. Let's add a deprecation notice when UDP-Lite socket is created and schedule its removal to 2025. Link: https://lore.kernel.org/netdev/[email protected]/ [0] Signed-off-by: Kuniyuki Iwashima <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 9a36e2d commit be28c14

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

net/ipv4/udplite.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ static int udplite_sk_init(struct sock *sk)
2222
{
2323
udp_init_sock(sk);
2424
udp_sk(sk)->pcflag = UDPLITE_BIT;
25+
pr_warn_once("UDP-Lite is deprecated and scheduled to be removed in 2025, "
26+
"please contact the netdev mailing list\n");
2527
return 0;
2628
}
2729

net/ipv6/udplite.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
* Changes:
99
* Fixes:
1010
*/
11+
#define pr_fmt(fmt) "UDPLite6: " fmt
12+
1113
#include <linux/export.h>
1214
#include <linux/proc_fs.h>
1315
#include "udp_impl.h"
@@ -16,6 +18,8 @@ static int udplitev6_sk_init(struct sock *sk)
1618
{
1719
udpv6_init_sock(sk);
1820
udp_sk(sk)->pcflag = UDPLITE_BIT;
21+
pr_warn_once("UDP-Lite is deprecated and scheduled to be removed in 2025, "
22+
"please contact the netdev mailing list\n");
1923
return 0;
2024
}
2125

0 commit comments

Comments
 (0)