Page MenuHomeFreeBSD

Protect calls to mtod() from accessing NULL mbufs
ClosedPublic

Authored by gnn on Jan 3 2017, 8:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jan 30, 4:00 AM
Unknown Object (File)
Sun, Jan 26, 5:29 AM
Unknown Object (File)
Fri, Jan 24, 6:37 AM
Unknown Object (File)
Fri, Jan 10, 6:12 AM
Unknown Object (File)
Dec 7 2024, 10:25 PM
Unknown Object (File)
Nov 13 2024, 10:04 AM
Unknown Object (File)
Oct 28 2024, 7:09 AM
Unknown Object (File)
Oct 10 2024, 3:16 PM
Subscribers

Details

Summary
Test Plan

Trace all debug output using a modified tcpdebug script that looks at all sockets

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

gnn retitled this revision from to Protect calls to mtod() from accessing NULL mbufs.
gnn updated this object.
gnn edited the test plan for this revision. (Show Details)
gnn added a reviewer: hiren.

Is it possible to handle 'm' being null in TCP_PROBE3() instead of these if/else checks everywhere?

hiren edited edge metadata.
hiren added a subscriber: avg.

I could make an uglier macro. If that would please the audience.

In D9035#186666, @gnn wrote:

I could make an uglier macro. If that would please the audience.

Hah. Uglier macro in one place might probably be better?

I'll see what others have to say. :-)

Have you checked generated assembly? This likely executes a branch regardless of whether SDT is enabled. On the other putting the check in the macro should get around that.

We actually don't need mtod() at all. If you want the mbuf, use the mbuf provider.

hiren edited edge metadata.
This revision is now accepted and ready to land.Jan 4 2017, 2:11 AM
This revision was automatically updated to reflect the committed changes.