Thread (3 messages) read the whole thread 3 messages, 2 authors, 10d ago

Re: [PATCH net-next] ipv6: initialize ipcm6_cookie before parsing control messages

From: Fernando Fernandez Mancera <hidden>
Date: 2026-07-21 14:45:21
Also in: linux-arm-kernel, linux-mediatek

On Thu, 09 Jul 2026 16:32:30 +0800, Wayen Yan [off-list ref] wrote:
ip6_datagram_send_ctl() parses both SOL_IPV6 and SOL_SOCKET control
messages. For SOL_SOCKET messages it passes ipc6->sockc to
__sock_cmsg_send(), which updates fields such as tsflags with
read-modify-write operations.

The IPV6_2292PKTOPTIONS and flowlabel option paths only set ipc6.opt
before calling ip6_datagram_send_ctl(). If a SOL_SOCKET control message
such as SO_TIMESTAMPING_* or SCM_TS_OPT_ID is present, this can read
uninitialized sockc state.

Initialize the ipcm6_cookie with ipcm6_init_sk(), as the normal IPv6
sendmsg paths do, before overriding ->opt with the temporary option
buffer.

Signed-off-by: Wayen Yan <redacted>
Reviewed-by: Fernando Fernandez Mancera <redacted>

Thanks!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help