Skip site navigation (1)Skip section navigation (2)
Date:      Tue,  3 Aug 2010 15:11:25 +0000 (UTC)
From:      Stef Walter <stef-list@memberwebs.com>
To:        freebsd-jail@freebsd.org
Cc:        jhb@freebsd.org
Subject:   ifconfig and sysctl() PF_ROUTE fix for 32-bit jail running on 64-bit kernel
Message-ID:  <4C583199.8060609@memberwebs.com>

next in thread | raw e-mail | index | archive | help
Another patch for 32-bit compatibility on 64-bit kernel. I'm running
this way for some clients with older jails...

This bug makes ifconfig output look like:

: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
��: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	inet X.X.X.X netmask 0xffffffff broadcast X.X.X.X
: flags=8801<UP,SIMPLEX,MULTICAST> mtu 65536
: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384

Notice how the interface names are all screwed up. This bug can also
cause certain processes using PF_ROUTE to read invalid memory and  crash.

Recently code was added by jhb (thanks!) to sys/net/rtsock.c [1] which
handles compatibility of 32-bit processes. I posted a patch to
freebsd-net about this a while back [2].

However there's one minor issue with the new compat shims, and that is
that the ifi_datalen member of struct if_data is not set correctly. It's
supposed to be set to the size of the if_data struct, but in this case
it's set to the size of the 64-bit struct instead of the 32-bit one.

Just wanted to give folks a heads up in case anyone runs into the same
issue.

PR filed with details, patch and test program to reproduce problem:

http://www.freebsd.org/cgi/query-pr.cgi?pr=149240

Cheers,

Stef


PS: I'm traveling and this computer is not receiving email from the
list, so please CC stef@memberwebs.com on any responses to this thread.

[1]
http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/net/rtsock.c?rev=1.187;content-type=text/x-cvsweb-markup

[2] http://www.mail-archive.com/freebsd-net@freebsd.org/msg30230.html



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C583199.8060609>