Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Apr 2022 23:01:47 -0800
From:      Rob Wing <rob.fx907@gmail.com>
To:        Eugene Grosbein <eugen@grosbein.net>
Cc:        Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>, freebsd-hackers@freebsd.org
Subject:   Re: kernel crash making a vlan on a wlan
Message-ID:  <CAF3%2Bn_dr1yeZnJkmyn3EBwSPfR%2BvQqT5h%2BtxtWp1=J5t0%2BD2Vg@mail.gmail.com>
In-Reply-To: <113d6d4d-eb23-30b1-a9e7-5a82a46604f8@grosbein.net>
References:  <f08424d6-e209-928b-9927-3cc6c0aabb22@hesiod.org> <421d0c0d-4109-3370-9147-85168051deed@freebsd.org> <9ea3536e-b501-3684-850e-65f95fddf2e7@freebsd.org> <28c9ea32-b913-c153-005b-a62d6a7a6f4e@plan-b.pwste.edu.pl> <113d6d4d-eb23-30b1-a9e7-5a82a46604f8@grosbein.net>

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

[-- Attachment #1 --]
>From what I can tell, the vlan driver is calling ieee80211_output() with
the wrong ifnet context and dereferencing a bad pointer.

It looks like the passed in if_softc is pointing to a struct ifvlan instead
of the expected struct ieee80211_vap

Looking at vlan_output(), I wonder if the parents ifnet context should be
used when calling if_output()? something like:

diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index 2bb5284c2129..5fbd7a79dccc 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -1318,7 +1318,7 @@ vlan_output(struct ifnet *ifp, struct mbuf *m, const
struct sockaddr *dst,
                ifv = p->if_softc;
        } while (p->if_type == IFT_L2VLAN);

-       return p->if_output(ifp, m, dst, ro);
+       return ((*p->if_output)(p, m, dst, ro));
 }

 #ifdef ALTQ


On Sat, Apr 23, 2022 at 1:12 PM Eugene Grosbein <eugen@grosbein.net> wrote:

> 24.04.2022 3:28, Marek Zarychta wrote:
>
> > W dniu 23.04.2022 o 22:11, Craig Leres pisze:
> >>
> >> On 4/23/22 11:12, Craig Leres wrote:
> >>> I am able to reproduce the crash with 13.1-RC4.
> >>
> >> I'm also able to reproduce the crash on 12.3-RELEASE-p5. It seems wlan0
> is part of the recipe, I tried vlans_em0="vlan0" first but was not able to
> induce a crash.
> >>
> >>          Craig
> >>
> >
> > I am curious what is this WiFi hardware that supports 802.1q tagging
> over the air? Could you please reveal this?
> >
> > That's rather not a bug when you are shooting yourself in the foot.
>
> Kernel panic due to ifconfig command is always a bug.
>
>
>
>

[-- Attachment #2 --]
<div dir="ltr"><div>From what I can tell, the vlan driver is calling ieee80211_output() with the wrong ifnet context and dereferencing a bad pointer. <br></div><div><br></div><div>It looks like the passed in if_softc is pointing to a struct ifvlan instead of the expected struct ieee80211_vap</div><div><br></div><div>Looking at vlan_output(), I wonder if the parents ifnet context should be used when calling if_output()? something like:</div><div><br></div><div>diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c<br>index 2bb5284c2129..5fbd7a79dccc 100644<br>--- a/sys/net/if_vlan.c<br>+++ b/sys/net/if_vlan.c<br>@@ -1318,7 +1318,7 @@ vlan_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,<br>                ifv = p-&gt;if_softc;<br>        } while (p-&gt;if_type == IFT_L2VLAN);<br><br>-       return p-&gt;if_output(ifp, m, dst, ro);<br>+       return ((*p-&gt;if_output)(p, m, dst, ro));<br> }<br><br> #ifdef ALTQ</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Apr 23, 2022 at 1:12 PM Eugene Grosbein &lt;<a href="mailto:eugen@grosbein.net" target="_blank">eugen@grosbein.net</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">24.04.2022 3:28, Marek Zarychta wrote:<br>
<br>
&gt; W dniu 23.04.2022 o 22:11, Craig Leres pisze:<br>
&gt;&gt;<br>
&gt;&gt; On 4/23/22 11:12, Craig Leres wrote:<br>
&gt;&gt;&gt; I am able to reproduce the crash with 13.1-RC4.<br>
&gt;&gt;<br>
&gt;&gt; I&#39;m also able to reproduce the crash on 12.3-RELEASE-p5. It seems wlan0 is part of the recipe, I tried vlans_em0=&quot;vlan0&quot; first but was not able to induce a crash.<br>
&gt;&gt;<br>
&gt;&gt;          Craig<br>
&gt;&gt;<br>
&gt; <br>
&gt; I am curious what is this WiFi hardware that supports 802.1q tagging over the air? Could you please reveal this?<br>
&gt; <br>
&gt; That&#39;s rather not a bug when you are shooting yourself in the foot.<br>
<br>
Kernel panic due to ifconfig command is always a bug.<br>
<br>
<br>
<br>
</blockquote></div>

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAF3%2Bn_dr1yeZnJkmyn3EBwSPfR%2BvQqT5h%2BtxtWp1=J5t0%2BD2Vg>