Skip to content

ipmr, ip6mr: Fix several info leaks

Ido Schimmel netdev stable 1 version Applied

Status from this message: This series was applied to netdev/net.git (main)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 4 repliesApplied 2/2

Patches in v1 All 2 applied

#Subject and filesSizeRepliesApplied
1/2ipmr: fully initialize the synthetic IP header in ipmr_get_route()net/ipv4/ipmr.c+1 -01 replyApplied
2/2ipmr, ip6mr: validate packets injected into the register vif on xmitnet/ipv4/ipmr.c net/ipv6/ip6mr.c+7 -12 repliesApplied

Reviews trailers per patch

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

PatchEric DumazetHangbin Liu
SeriesR-b
1/2R-b
2/2R-b

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] ipmr, ip6mr: Fix several info leaks

ip{,6}mr_cache_report() copy the IP header of a packet that triggered an upcall to a report packet that is delivered to user space. The header is not always fully initialized or present, resulting in info leaks flagged by KMSAN.

Patch 1 fixes an info leak in the RTM_GETROUTE path, caused by the fact that ipmr_get_route() does not fully initialize the IP header of the packet that it creates. IPv6 does not suffer from this problem.

Patch 2 fixes info leaks triggered by packets injected into pim{,6}reg devices via AF_PACKET sockets. The kernel does not validate that these are IP packets that carry an IP header before calling ip{,6}mr_cache_report().

Both issues were reported by Sashiko and reproduced by me. See KMSAN traces in the commit messages.

As far as I can tell, all other callers call these functions from the IP input / output paths and therefore provide a valid IP packet, with the exception of ip6mr_get_route() which fully initializes the header of the packet it creates.

Ido Schimmel (2):
ipmr: fully initialize the synthetic IP header in ipmr_get_route() ipmr, ip6mr: validate packets injected into the register vif on xmit

 net/ipv4/ipmr.c  | 7 +++++++
 net/ipv6/ip6mr.c | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)
Signature · 1 line
2.56.0