public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Brett Sheffield <bacs@librecast.net>
To: stable@vger.kernel.org
Cc: regressions@lists.linux.dev
Subject: 6.12.y longterm regression - IPv6 UDP packet fragmentation
Date: Wed, 11 Jun 2025 13:04:29 +0200	[thread overview]
Message-ID: <aElivdUXqd1OqgMY@karahi.gladserv.com> (raw)

[-- 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;
}

             reply	other threads:[~2025-06-11 11:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-11 11:04 Brett Sheffield [this message]
2025-06-17 13:47 ` 6.12.y longterm regression - IPv6 UDP packet fragmentation 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-03 18:34               ` Sasha Levin
2025-07-02 11:38             ` [PATCH 5.15.y] " Brett A C Sheffield
2025-07-03 18:34               ` Sasha Levin
2025-07-02 11:41             ` [PATCH 5.10.y] " Brett A C Sheffield
2025-07-03 18:34               ` Sasha Levin
2025-07-02 11:41             ` [PATCH 6.1.y] " Brett A C Sheffield
2025-07-03 18:35               ` Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aElivdUXqd1OqgMY@karahi.gladserv.com \
    --to=bacs@librecast.net \
    --cc=regressions@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox