Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 Mar 2012 01:03:53 GMT
From:      Vijay Singh <vijju.singh@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/165643: Missing vnet restores in net/if_ethersubr.c
Message-ID:  <201203030103.q2313rn5006741@red.freebsd.org>
Resent-Message-ID: <201203030110.q231A84t092212@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         165643
>Category:       kern
>Synopsis:       Missing vnet restores in net/if_ethersubr.c
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 03 01:10:08 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Vijay Singh
>Release:        9/stable
>Organization:
>Environment:
>Description:
There are some missing vnet restore in net/if_ethersubr.c that can cause networking code to execute in the wrong vnet context.

A patch is provided here:

[pc20 /u/vijay/bsd/CODE/9s/sys]# svn diff net/if_ethersubr.c
Index: net/if_ethersubr.c
===================================================================
--- net/if_ethersubr.c  (revision 232242)
+++ net/if_ethersubr.c  (working copy)
@@ -661,8 +661,10 @@
              m = (*lagg_input_p)(ifp, m);
              if (m != NULL)
                      ifp = m->m_pkthdr.rcvif;
-               else
+               else {
+                       CURVNET_RESTORE();
                      return;
+               }
      }

      /*
@@ -681,6 +683,7 @@
 #endif
                      ifp->if_ierrors++;
                      m_freem(m);
+                       CURVNET_RESTORE();
                      return;
              }
>How-To-Repeat:

>Fix:
[pc20 /u/vijay/bsd/CODE/9s/sys]# svn diff net/if_ethersubr.c
Index: net/if_ethersubr.c
===================================================================
--- net/if_ethersubr.c  (revision 232242)
+++ net/if_ethersubr.c  (working copy)
@@ -661,8 +661,10 @@
              m = (*lagg_input_p)(ifp, m);
              if (m != NULL)
                      ifp = m->m_pkthdr.rcvif;
-               else
+               else {
+                       CURVNET_RESTORE();
                      return;
+               }
      }

      /*
@@ -681,6 +683,7 @@
 #endif
                      ifp->if_ierrors++;
                      m_freem(m);
+                       CURVNET_RESTORE();
                      return;
              }

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



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