Page MenuHomeFreeBSD

ping6: fix outpack overflow in pattern fill loop
ClosedPublic

Authored by oshogbo on Thu, Jun 4, 3:00 PM.
Tags
None
Referenced Files
F160086222: D57441.id179375.diff
Sun, Jun 21, 6:45 AM
F160086201: D57441.id179375.diff
Sun, Jun 21, 6:45 AM
Unknown Object (File)
Sat, Jun 20, 5:50 PM
Unknown Object (File)
Thu, Jun 18, 11:01 PM
Unknown Object (File)
Thu, Jun 18, 8:04 PM
Unknown Object (File)
Thu, Jun 18, 7:41 PM
Unknown Object (File)
Thu, Jun 18, 7:22 PM
Unknown Object (File)
Thu, Jun 18, 7:20 PM
Subscribers

Details

Summary

The fill loop was bounded by packlen, which is sized for the receive
buffer (datalen + IP6LEN + ICMP6ECHOLEN + EXTRA), not for outpack.
With large datalen the loop wrote past outpack[MAXPACKETLEN].

Bound it to the actual data area in outpack instead.

Reported by: Oculytic

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

oshogbo held this revision as a draft.
oshogbo published this revision for review.Thu, Jun 4, 3:01 PM
oshogbo changed the visibility from "Public (No Login Required)" to "secteam (Project)".
oshogbo changed the edit policy from "All Users" to "secteam (Project)".
oshogbo added a reviewer: markj.
oshogbo added a reviewer: secteam.

There is a ton of cleanup that could be done in this file. We should also ensure that casper services are created after ping drops its privileges...

sbin/ping/ping6.c
767
This revision is now accepted and ready to land.Thu, Jun 4, 4:29 PM
des requested changes to this revision.Fri, Jun 5, 3:13 PM
des added a subscriber: des.
des added inline comments.
sbin/ping/ping6.c
241

should take a size

766

braces please

767
This revision now requires changes to proceed.Fri, Jun 5, 3:13 PM

Address review from des

You skipped the most important part. The filling loop is still incorrect.

oshogbo marked 3 inline comments as done.

Fix the loop.

Yes you were right, sorry about that.

This revision is now accepted and ready to land.Wed, Jun 10, 5:10 PM
oshogbo changed the visibility from "secteam (Project)" to "Public (No Login Required)".Tue, Jun 16, 5:04 PM