Skip to content

net: mcast: do not write past optlen in the source filter getsockopt

Breno Leitao lkml netdev stable 1 version NAK

Status from this message: Nak, same as IPv4.

Get series with b4
b4 am [email protected] change-id 20260806-mcast_fix-4db13688cbb6

Versions newest first

  1. v1 Latest2 patches 10 repliesNAK

Patches in v1

#Subject and filesSizeRepliesApplied
1/2ipv4: mcast: getsockopt: do not overwrite past optlennet/ipv4/ip_sockglue.c+16 -08 replies
2/2ipv6: mcast: do not write past optlen in the source filter getsockoptnet/ipv6/ipv6_sockglue.c+11 -01 reply

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchSimon Horman
SeriesR-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net 0/2] net: mcast: do not write past optlen in the source filter getsockopt

getsockopt() on the multicast source filter options writes past the buffer the caller declared. Only the fixed header is checked against optlen. The number of sources copied out comes from gf_numsrc/ imsf_numsrc, read back from optval, and nothing bounds that count by the space left in the buffer.

I hit this while converting the mcast getsockopt paths to sockopt_t. Fixing it against 'net' first, so the fix is settled on its own before the conversion goes on top.

---
Breno Leitao (2):
ipv4: mcast: getsockopt: do not overwrite past optlen
ipv6: mcast: do not write past optlen in the source filter getsockopt

 net/ipv4/ip_sockglue.c   | 16 ++++++++++++++++
 net/ipv6/ipv6_sockglue.c | 11 +++++++++++
 2 files changed, 27 insertions(+)

---
base-commit: b0057c68df711bf6a62033c072ac61c4f9d3cbc1
change-id: 20260806-mcast_fix-4db13688cbb6

Best regards,

Signature · 1 line
Breno Leitao <[email protected]>