Page MenuHomeFreeBSD

Eliminate ipfilter crash when VIMAGE is enabled in kernel
ClosedPublic

Authored by rodrigc on Nov 19 2014, 9:33 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jun 3, 5:48 PM
Unknown Object (File)
Mon, Jun 3, 3:15 AM
Unknown Object (File)
Dec 19 2023, 2:51 PM
Unknown Object (File)
Nov 22 2023, 8:45 AM
Unknown Object (File)
Nov 5 2023, 3:38 AM
Unknown Object (File)
Sep 14 2023, 7:04 AM
Unknown Object (File)
Aug 13 2023, 5:19 PM
Unknown Object (File)
Aug 13 2023, 6:13 AM
Subscribers

Details

Summary

Set the current vnet inside the ioctl handler for ipfilter.

Without this fix, the vnet was NULL and would crash.
This fix is similar to what was done inside the ioctl handler for PF.

PR: 176992

Test Plan

(1) Boot a kernel with "options VIMAGE" enabled
(2) Type:

echo "map lo0 from 10.0.0.0/24 to ! 10.0.0.0/24 -> 127.0.0.1/32" > /etc/ipnat.rules ; service ipnat onerestart

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

rodrigc retitled this revision from to Eliminate ipfilter crash when VIMAGE is enabled in kernel.
rodrigc updated this object.
rodrigc edited the test plan for this revision. (Show Details)
rodrigc added reviewers: network, cy.
cy edited edge metadata.

Looks good. Tested here, works.

This revision is now accepted and ready to land.Nov 20 2014, 2:23 AM
rodrigc updated this revision to Diff 2472.

Closed by commit rS274744 (authored by @rodrigc).

I'd argue that there is no need for the #ifs as there is no supported FreeBSD version before 8 anyway anymore.

Otherwise that's ok I'd say.