Page MenuHomeFreeBSD

netinet: Disallow unspecified addresses in ICMP-embedded packets
ClosedPublic

Authored by markj on Mar 6 2023, 10:21 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 31, 11:08 PM
Unknown Object (File)
Sun, Oct 27, 7:16 PM
Unknown Object (File)
Wed, Oct 23, 5:35 AM
Unknown Object (File)
Sat, Oct 19, 12:29 PM
Unknown Object (File)
Oct 16 2024, 6:07 AM
Unknown Object (File)
Oct 6 2024, 11:30 AM
Unknown Object (File)
Oct 2 2024, 7:57 AM
Unknown Object (File)
Oct 1 2024, 4:29 PM
Subscribers

Details

Summary

Reported by: glebius
Reported by: syzbot+981c528ccb5c5534dffc@syzkaller.appspotmail.com

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 50179
Build 47071: arc lint + arc unit

Event Timeline

markj requested review of this revision.Mar 6 2023, 10:21 PM
This revision is now accepted and ready to land.Mar 6 2023, 10:30 PM
glebius requested changes to this revision.Mar 8 2023, 5:19 PM

Continuing out discussion that we had before in email. After more thinking on this I'm convinced we should filter this out at ICMP input and don't let it down to TCP/UDP control input method. Any legitimate ICMP in principle is a reaction to a packet that we sent. We never send a packet with zero source address. Let's for a minute imagine that we did! In that case an ICMP reply to this packet should go to zero address. How is it going to reach us in that case? The only absolutely imaginary situation that I can see is that we send from 0.0.0.0 and the closest gateway sends us that packet back wrapped into ICMP and uses layer 2 header to determine where it actually should send it to.

This revision now requires changes to proceed.Mar 8 2023, 5:19 PM

Continuing out discussion that we had before in email. After more thinking on this I'm convinced we should filter this out at ICMP input and don't let it down to TCP/UDP control input method. Any legitimate ICMP in principle is a reaction to a packet that we sent. We never send a packet with zero source address. Let's for a minute imagine that we did! In that case an ICMP reply to this packet should go to zero address. How is it going to reach us in that case? The only absolutely imaginary situation that I can see is that we send from 0.0.0.0 and the closest gateway sends us that packet back wrapped into ICMP and uses layer 2 header to determine where it actually should send it to.

Ok, I will update the patch.

Or I can formulate it other way. The source address in the IP packet embedded into ICMP must be the same as destination address of the outer IP packet. If they are different, the ICMP packet is illegitimate.

Filter out unspecified addresses in the ICMP layer.

This revision is now accepted and ready to land.Mar 13 2023, 2:38 PM