kern/158665: kernel pagefault in in6_setscope()

Mike Cui cuicui at gmail.com
Tue Jul 5 10:10:12 UTC 2011


>Number:         158665
>Category:       kern
>Synopsis:       kernel pagefault in in6_setscope()
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 05 10:10:11 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Mike Cui
>Release:        8.2RELEASE
>Organization:
>Environment:
FreeBSD router 8.2-RELEASE FreeBSD 8.2-RELEASE #3
>Description:
When I set up a 6to4 tunnel device (stf0) and put it in output only mode according to man stf(4):

     # ifconfig ne0 inet 133.4.5.6 netmask 0xffffff00
     # ifconfig stf0 inet6 2002:8504:0506:0000:a00:5aff:fe38:6f86 \
             prefixlen 16 alias deprecated link0
     # route add -inet6 2002:: -prefixlen 16 ::1
     # route change -inet6 2002:: -prefixlen 16 ::1 -ifp stf0

The kernel often crashes sending traffic to other other 2002::/16 hosts. I think the problem is the "deprecated" address that's causing problems when trying to resolve ipv6 scope.

The instruction causing the fault is:
c069cee8:       0f b1 96 18 02 00 00    cmpxchg %edx,0x218(%esi)

which I think corresponds to this line in the source:

int
in6_setscope(struct in6_addr *in6, struct ifnet *ifp, u_int32_t *ret_id)
{
        int scope;
        u_int32_t zoneid = 0;
        struct scope6_id *sid;

        IF_AFDATA_LOCK(ifp);  <----- HERE

The fault virtual address is 0x218, which seems to suggest that ifp passed into this function is NULL.

>How-To-Repeat:
1. On a machine with both a public IPv6 address (not 6to4 address) as well as IPv4, create a stf0 device and put it in "output only" mode according to man stf(4).
2. Ping another host using its 6to4 address (2002::/16).


>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list