Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Sep 2025 11:07:15 +0800
From:      Zhenlei Huang <zlei@FreeBSD.org>
To:        Mateusz Guzik <mjguzik@gmail.com>
Cc:        Gleb Smirnoff <glebius@freebsd.org>, src-committers@freebsd.org, "<dev-commits-src-all@freebsd.org>" <dev-commits-src-all@freebsd.org>, "dev-commits-src-main@FreeBSD.org" <dev-commits-src-main@freebsd.org>, "Bjoern A. Zeeb" <bz@FreeBSD.org>, Kristof Provost <kp@FreeBSD.org>
Subject:   Re: svn commit: r256519 - in head/sys: net netatalk netinet netinet6 netipx
Message-ID:  <13C41285-E7E1-4B49-B9A7-1B157B445CDD@FreeBSD.org>
In-Reply-To: <CAGudoHHew1oZazNVMSnGDfCMV%2By1Q1_f9K_CtRDWuppaiKyydQ@mail.gmail.com>
References:  <201310151031.r9FAVgRP008282@svn.freebsd.org> <CAGudoHGN=6-dFQ791_=kLBnYfyz9zm75-vJKh=e9gibaXun5NQ@mail.gmail.com> <35D99D40-5534-402A-8479-64C71604206B@FreeBSD.org> <CAGudoHHew1oZazNVMSnGDfCMV%2By1Q1_f9K_CtRDWuppaiKyydQ@mail.gmail.com>

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

[-- Attachment #1 --]


> On Sep 30, 2025, at 10:59 AM, Mateusz Guzik <mjguzik@gmail.com> wrote:
> 
> On Tue, Sep 30, 2025 at 4:38 AM Zhenlei Huang <zlei@freebsd.org <mailto:zlei@freebsd.org>> wrote:
>> 
>> 
>> 
>>> On Sep 29, 2025, at 10:29 PM, Mateusz Guzik <mjguzik@gmail.com> wrote:
>>> 
>>> On Tue, Oct 15, 2013 at 12:31 PM Gleb Smirnoff <glebius@freebsd.org> wrote:
>>>> 
>>>> Author: glebius
>>>> Date: Tue Oct 15 10:31:42 2013
>>>> New Revision: 256519
>>>> URL: http://svnweb.freebsd.org/changeset/base/256519
>>>> 
>>>> Log:
>>>>   Remove ifa_init() and provide ifa_alloc() that will allocate and setup
>>>> struct ifaddr internally.
>>>> 
>>>> Sponsored by: Netflix
>>>> Sponsored by: Nginx, Inc.
>>>> 
>>>> Modified:
>>>> head/sys/net/if.c
>>>> head/sys/net/if_var.h
>>>> head/sys/netatalk/at_control.c
>>>> head/sys/netinet/in.c
>>>> head/sys/netinet6/in6.c
>>>> head/sys/netipx/ipx.c
>>>> 
>>>> Modified: head/sys/net/if.c
>>>> ==============================================================================
>>>> --- head/sys/net/if.c   Tue Oct 15 10:19:24 2013        (r256518)
>>>> +++ head/sys/net/if.c   Tue Oct 15 10:31:42 2013        (r256519)
>>>> @@ -633,8 +633,7 @@ if_attach_internal(struct ifnet *ifp, in
>>>>                       socksize = sizeof(*sdl);
>>>>               socksize = roundup2(socksize, sizeof(long));
>>>>               ifasize = sizeof(*ifa) + 2 * socksize;
>>>> -               ifa = malloc(ifasize, M_IFADDR, M_WAITOK | M_ZERO);
>>>> -               ifa_init(ifa);
>>>> +               ifa = ifa_alloc(ifasize, M_WAITOK);
>>>>               sdl = (struct sockaddr_dl *)(ifa + 1);
>>>>               sdl->sdl_len = socksize;
>>>>               sdl->sdl_family = AF_LINK;
>>>> @@ -1417,13 +1416,23 @@ if_maddr_runlock(struct ifnet *ifp)
>>>> /*
>>>> * Initialization, destruction and refcounting functions for ifaddrs.
>>>> */
>>>> -void
>>>> -ifa_init(struct ifaddr *ifa)
>>>> +struct ifaddr *
>>>> +ifa_alloc(size_t size, int flags)
>>>> {
>>>> +       struct ifaddr *ifa;
>>>> +
>>>> +       KASSERT(size >= sizeof(struct ifaddr),
>>>> +           ("%s: invalid size %zu", __func__, size));
>>>> +
>>> 
>>> We have crashes stemming from this:
>>> 
>>> panic: ifa_alloc: invalid size 16
>>> 
>>> panic() at panic+0x43/frame 0xfffffe009e777760
>>> ifa_alloc() at ifa_alloc+0xd6/frame 0xfffffe009e777780
>>> in6_ifadd() at in6_ifadd+0xd8/frame 0xfffffe009e7778a0
>>> nd6_ra_input() at nd6_ra_input+0x1023/frame 0xfffffe009e777a80
>>> icmp6_input() at icmp6_input+0x5b6/frame 0xfffffe009e777c00
>>> ip6_input() at ip6_input+0xc94/frame 0xfffffe009e777ce0
>>> sppp_input() at sppp_input+0x502/frame 0xfffffe009e777d70
>>> pppoe_data_input() at pppoe_data_input+0x1e7/frame 0xfffffe009e777de0
>>> swi_net() at swi_net+0x19b/frame 0xfffffe009e777e60
>>> ithread_loop() at ithread_loop+0x266/frame 0xfffffe009e777ef0
>>> fork_exit() at fork_exit+0x82/frame 0xfffffe009e777f30
>>> fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe009e777f30
>>> 
>>> in6_ifadd has:
>>>                       struct in6_addr taddr;
>>>                       ifa = ifa_alloc(sizeof(taddr), M_WAITOK);
>>> 
>>> should the assert be simply removed?
>> 
>> Hi Mateusz,
>> 
>> I believe you just found a bug.
>> 
>> Try the following patch please,
>> 
>> --- a/sys/netinet6/nd6_rtr.c
>> +++ b/sys/netinet6/nd6_rtr.c
>> @@ -1243,8 +1243,7 @@ in6_ifadd(struct nd_prefixctl *pr, int mcast)
>> 
>>                /* No suitable LL address, get the ifid directly */
>>                if (ifid_addr == NULL) {
>> -                       struct in6_addr taddr;
>> -                       ifa = ifa_alloc(sizeof(taddr), M_WAITOK);
>> +                       ifa = ifa_alloc(sizeof(struct in6_ifaddr), M_WAITOK);
>>                        if (ifa) {
>>                                ib = (struct in6_ifaddr *)ifa;
>>                                ifid_addr = &ib->ia_addr.sin6_addr;
>> 
> 
> Thanks for the patch. I don't have means to readily test it.
> 
> This panic was getting in the way of looking at another panic so I did
> not pay much attention.
> 
> But now that you point this out, I don't think the patch is sufficient.
> 
> in6_get_ifid starts with NET_EPOCH_ASSERT.
> 
> At the same time malloc(..., M_WAITOK) is illegal to call from an epoch section.

So M_NOWAIT should be used, instead of M_WAITOK .

> 
> I don't know if in6_ifadd is called within net epoch, either way the
> above two are clearly contradictory.
> 
> Is there are a reason to malloc this in the first place?

I have not look into the code throughly. That was introduced via commit https://cgit.freebsd.org/src/commit/?id=9e792f7ef7298080c058fbc2d36a4e60e596dae9 .

See https://reviews.freebsd.org/D51778 for more context.

Best regards,
Zhenlei


[-- Attachment #2 --]
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Sep 30, 2025, at 10:59 AM, Mateusz Guzik &lt;<a href="mailto:mjguzik@gmail.com" class="">mjguzik@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">On Tue, Sep 30, 2025 at 4:38 AM Zhenlei Huang &lt;</span><a href="mailto:zlei@freebsd.org" style="font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">zlei@freebsd.org</a><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">&gt; wrote:</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" style="font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class=""><br class=""><br class=""><blockquote type="cite" class="">On Sep 29, 2025, at 10:29 PM, Mateusz Guzik &lt;<a href="mailto:mjguzik@gmail.com" class="">mjguzik@gmail.com</a>&gt; wrote:<br class=""><br class="">On Tue, Oct 15, 2013 at 12:31 PM Gleb Smirnoff &lt;<a href="mailto:glebius@freebsd.org" class="">glebius@freebsd.org</a>&gt; wrote:<br class=""><blockquote type="cite" class=""><br class="">Author: glebius<br class="">Date: Tue Oct 15 10:31:42 2013<br class="">New Revision: 256519<br class="">URL: <a href="http://svnweb.freebsd.org/changeset/base/256519" class="">http://svnweb.freebsd.org/changeset/base/256519</a><br class=""><br class="">Log:<br class="">&nbsp;&nbsp;Remove ifa_init() and provide ifa_alloc() that will allocate and setup<br class="">struct ifaddr internally.<br class=""><br class="">Sponsored by: Netflix<br class="">Sponsored by: Nginx, Inc.<br class=""><br class="">Modified:<br class="">head/sys/net/if.c<br class="">head/sys/net/if_var.h<br class="">head/sys/netatalk/at_control.c<br class="">head/sys/netinet/in.c<br class="">head/sys/netinet6/in6.c<br class="">head/sys/netipx/ipx.c<br class=""><br class="">Modified: head/sys/net/if.c<br class="">==============================================================================<br class="">--- head/sys/net/if.c &nbsp;&nbsp;Tue Oct 15 10:19:24 2013 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(r256518)<br class="">+++ head/sys/net/if.c &nbsp;&nbsp;Tue Oct 15 10:31:42 2013 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(r256519)<br class="">@@ -633,8 +633,7 @@ if_attach_internal(struct ifnet *ifp, in<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;socksize = sizeof(*sdl);<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;socksize = roundup2(socksize, sizeof(long));<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ifasize = sizeof(*ifa) + 2 * socksize;<br class="">- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ifa = malloc(ifasize, M_IFADDR, M_WAITOK | M_ZERO);<br class="">- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ifa_init(ifa);<br class="">+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ifa = ifa_alloc(ifasize, M_WAITOK);<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sdl = (struct sockaddr_dl *)(ifa + 1);<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sdl-&gt;sdl_len = socksize;<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sdl-&gt;sdl_family = AF_LINK;<br class="">@@ -1417,13 +1416,23 @@ if_maddr_runlock(struct ifnet *ifp)<br class="">/*<br class="">* Initialization, destruction and refcounting functions for ifaddrs.<br class="">*/<br class="">-void<br class="">-ifa_init(struct ifaddr *ifa)<br class="">+struct ifaddr *<br class="">+ifa_alloc(size_t size, int flags)<br class="">{<br class="">+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct ifaddr *ifa;<br class="">+<br class="">+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;KASSERT(size &gt;= sizeof(struct ifaddr),<br class="">+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;("%s: invalid size %zu", __func__, size));<br class="">+<br class=""></blockquote><br class="">We have crashes stemming from this:<br class=""><br class="">panic: ifa_alloc: invalid size 16<br class=""><br class="">panic() at panic+0x43/frame 0xfffffe009e777760<br class="">ifa_alloc() at ifa_alloc+0xd6/frame 0xfffffe009e777780<br class="">in6_ifadd() at in6_ifadd+0xd8/frame 0xfffffe009e7778a0<br class="">nd6_ra_input() at nd6_ra_input+0x1023/frame 0xfffffe009e777a80<br class="">icmp6_input() at icmp6_input+0x5b6/frame 0xfffffe009e777c00<br class="">ip6_input() at ip6_input+0xc94/frame 0xfffffe009e777ce0<br class="">sppp_input() at sppp_input+0x502/frame 0xfffffe009e777d70<br class="">pppoe_data_input() at pppoe_data_input+0x1e7/frame 0xfffffe009e777de0<br class="">swi_net() at swi_net+0x19b/frame 0xfffffe009e777e60<br class="">ithread_loop() at ithread_loop+0x266/frame 0xfffffe009e777ef0<br class="">fork_exit() at fork_exit+0x82/frame 0xfffffe009e777f30<br class="">fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe009e777f30<br class=""><br class="">in6_ifadd has:<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct in6_addr taddr;<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ifa = ifa_alloc(sizeof(taddr), M_WAITOK);<br class=""><br class="">should the assert be simply removed?<br class=""></blockquote><br class="">Hi Mateusz,<br class=""><br class="">I believe you just found a bug.<br class=""><br class="">Try the following patch please,<br class=""><br class="">--- a/sys/netinet6/nd6_rtr.c<br class="">+++ b/sys/netinet6/nd6_rtr.c<br class="">@@ -1243,8 +1243,7 @@ in6_ifadd(struct nd_prefixctl *pr, int mcast)<br class=""><br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* No suitable LL address, get the ifid directly */<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (ifid_addr == NULL) {<br class="">- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct in6_addr taddr;<br class="">- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ifa = ifa_alloc(sizeof(taddr), M_WAITOK);<br class="">+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ifa = ifa_alloc(sizeof(struct in6_ifaddr), M_WAITOK);<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (ifa) {<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ib = (struct in6_ifaddr *)ifa;<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ifid_addr = &amp;ib-&gt;ia_addr.sin6_addr;<br class=""><br class=""></blockquote><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Thanks for the patch. I don't have means to readily test it.</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">This panic was getting in the way of looking at another panic so I did</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">not pay much attention.</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">But now that you point this out, I don't think the patch is sufficient.</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">in6_get_ifid starts with NET_EPOCH_ASSERT.</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">At the same time malloc(..., M_WAITOK) is illegal to call from an epoch section.</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""></div></blockquote><div><br class=""></div><div>So M_NOWAIT should be used, instead of M_WAITOK .</div><br class=""><blockquote type="cite" class=""><div class=""><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">I don't know if in6_ifadd is called within net epoch, either way the</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">above two are clearly contradictory.</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Is there are a reason to malloc this in the first place?</span></div></blockquote><br class=""></div><div>I have not look into the code throughly. That was introduced via commit&nbsp;<a href="https://cgit.freebsd.org/src/commit/?id=9e792f7ef7298080c058fbc2d36a4e60e596dae9" class="">https://cgit.freebsd.org/src/commit/?id=9e792f7ef7298080c058fbc2d36a4e60e596dae9</a>; .</div><div><br class=""></div><div>See&nbsp;<a href="https://reviews.freebsd.org/D51778" class="">https://reviews.freebsd.org/D51778</a>; for more context.</div><br class=""><div class="">
<div>Best regards,</div><div>Zhenlei</div>

</div>
<br class=""></body></html>

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?13C41285-E7E1-4B49-B9A7-1B157B445CDD>