All of lore.kernel.org
 help / color / mirror / Atom feed
* 6.12.y longterm regression - IPv6 UDP packet fragmentation
@ 2025-06-11 11:04 Brett Sheffield
  2025-06-17 13:47 ` Greg KH
  0 siblings, 1 reply; 19+ messages in thread
From: Brett Sheffield @ 2025-06-11 11:04 UTC (permalink / raw)
  To: stable; +Cc: regressions

[-- Attachment #1: Type: text/plain, Size: 939 bytes --]

Hello Stable Maintainers,

Longterm kernel 6.12.y backports commit:

- a18dfa9925b9ef6107ea3aa5814ca3c704d34a8a "ipv6: save dontfrag in cork"

but does not backport these related commits:

- 54580ccdd8a9c6821fd6f72171d435480867e4c3 "ipv6: remove leftover ip6 cookie initializer"
- 096208592b09c2f5fc0c1a174694efa41c04209d "ipv6: replace ipcm6_init calls with ipcm6_init_sk"

This causes a regression when sending IPv6 UDP packets by preventing
fragmentation and instead returning EMSGSIZE. I have attached a program which
demonstrates the issue.

sendmsg() returns correctly (8192) on a working kernel, and returns -1
(EMSGSIZE) when the regression is present.

The regression is not present in the mainline kernel.

Applying the two missing commits to 6.12.y fixes the regression.

Cheers,


Brett
-- 
Brett Sheffield (he/him)
Librecast - Decentralising the Internet with Multicast
https://librecast.net/
https://blog.brettsheffield.com/

[-- Attachment #2: 6.12.y-frag.c --]
[-- Type: text/plain, Size: 1629 bytes --]

/*
 * 6.12.y backports commit:
 * - a18dfa9925b9ef6107ea3aa5814ca3c704d34a8a "ipv6: save dontfrag in cork"
 * but does not backport:
 * - 54580ccdd8a9c6821fd6f72171d435480867e4c3 "ipv6: remove leftover ip6 cookie initializer"
 * - 096208592b09c2f5fc0c1a174694efa41c04209d "ipv6: replace ipcm6_init calls with ipcm6_init_sk"
 *
 * This causes a regression when sending IPv6 UDP packets by preventing
 * fragmentation and instead returning EMSGSIZE. This program demonstrates the
 * issue. sendmsg returns correctly (8192) on a working kernel, and returns -1
 * (EMSGSIZE) when the regression is present.
 *
 * The regression is not present in the mainline kernel.
 *
 * Applying the missing commits to 6.12.y fixes the regression.
 */

#include <netinet/in.h>
#include <sys/socket.h>
#include <stdio.h>

#define LARGER_THAN_MTU 8192

int main(void)
{
	/* address doesn't matter, use an IPv6 multicast address for simplicity */
	struct in6_addr addr = {
		.s6_addr[0] = 0xff, /* multicast */
		.s6_addr[1] = 0x12, /* set flags (T, link-local) */
	};
	struct sockaddr_in6 sa = {
		.sin6_family = AF_INET6,
		.sin6_addr = addr,
		.sin6_port = 4242
	};
	char buf[LARGER_THAN_MTU] = {0};
	struct iovec iov = { .iov_base = buf, .iov_len = sizeof buf};
	struct msghdr msg = {
		.msg_iov = &iov,
		.msg_iovlen = 1,
		.msg_name = (struct sockaddr *)&sa,
		.msg_namelen = sizeof sa,
	};
	ssize_t rc;
	int s = socket(AF_INET6, SOCK_DGRAM, 0);
	msg.msg_name = (struct sockaddr *)&sa;
	msg.msg_namelen = sizeof sa;
	rc = sendmsg(s, &msg, 0);
	if (rc == -1) {
		perror("send");
		return 1;
	}
	printf("send() returned %zi\n", rc);
	return 0;
}

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2025-07-03 18:35 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-11 11:04 6.12.y longterm regression - IPv6 UDP packet fragmentation Brett Sheffield
2025-06-17 13:47 ` Greg KH
2025-06-17 17:29   ` Brett Sheffield
2025-06-17 18:25     ` Willem de Bruijn
2025-06-22  9:10       ` Greg KH
2025-06-22  9:37         ` Brett Sheffield
2025-07-02  9:59           ` Greg KH
2025-07-02 11:37             ` [PATCH 6.6.y] Revert "ipv6: save dontfrag in cork" Brett A C Sheffield
2025-07-02 14:23               ` Patch "Revert "ipv6: save dontfrag in cork"" has been added to the 6.6-stable tree gregkh
2025-07-03 18:34               ` [PATCH 6.6.y] Revert "ipv6: save dontfrag in cork" Sasha Levin
2025-07-02 11:38             ` [PATCH 5.15.y] " Brett A C Sheffield
2025-07-02 14:23               ` Patch "Revert "ipv6: save dontfrag in cork"" has been added to the 5.15-stable tree gregkh
2025-07-03 18:34               ` [PATCH 5.15.y] Revert "ipv6: save dontfrag in cork" Sasha Levin
2025-07-02 11:41             ` [PATCH 5.10.y] " Brett A C Sheffield
2025-07-02 14:22               ` Patch "Revert "ipv6: save dontfrag in cork"" has been added to the 5.10-stable tree gregkh
2025-07-03 18:34               ` [PATCH 5.10.y] Revert "ipv6: save dontfrag in cork" Sasha Levin
2025-07-02 11:41             ` [PATCH 6.1.y] " Brett A C Sheffield
2025-07-02 14:23               ` Patch "Revert "ipv6: save dontfrag in cork"" has been added to the 6.1-stable tree gregkh
2025-07-03 18:35               ` [PATCH 6.1.y] Revert "ipv6: save dontfrag in cork" Sasha Levin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.