NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/49410: -current: panic: "KERNEL_LOCKED_P()" failed: file ".../if_loop.c", line 221
On Sun, Nov 23, 2014 at 12:35 AM, <kardel%netbsd.org@localhost> wrote:
>>Number: 49410
>>Category: kern
>>Synopsis: -current MROUTING enabled kernel panics in if_loop.c:221 with KERNEL_LOCKED_P assertion
>>Confidential: no
>>Severity: serious
>>Priority: high
>>Responsible: kern-bug-people
>>State: open
>>Class: sw-bug
>>Submitter-Id: net
>>Arrival-Date: Sat Nov 22 15:35:00 +0000 2014
>>Originator: Charlie Root
>>Release: NetBSD 7.99.1
>>Organization:
>>Environment:
> System: NetBSD gateway.kardel.name 7.99.1 NetBSD 7.99.1 (GATEWAY) #21: Sat Nov 22 13:49:32 CET 2014 kardel%pip.kardel.name@localhost:/fs/raid1a/src/NetBSD/cur/src/obj.amd64/sys/arch/amd64/compile/GATEWAY amd64
> Architecture: x86_64
> Machine: amd64
>>Description:
> A -current kernel with multicast support panics due to locking error.
>
> panic: kernel diagnostic assertion "KERNEL_LOCKED_P()" failed: file "/fs/raid1a/src/NetBSD/cur/src/sys/net/if_loop.c", line 221
> cpu1: Begin traceback...
> vpanic() at netbsd:vpanic+0x13c
> kern_assert() at netbsd:kern_assert+0x4f
> looutput() at netbsd:looutput+0x39e
> ip_output() at netbsd:ip_output+0x8b0
> igmp_sendpkt.isra.1() at netbsd:igmp_sendpkt.isra.1+0x117
> igmp_fasttimo() at netbsd:igmp_fasttimo+0xb3
> pffasttimo() at netbsd:pffasttimo+0x31
> callout_softclock() at netbsd:callout_softclock+0x1d0
> softint_dispatch() at netbsd:softint_dispatch+0xd3
>>How-To-Repeat:
> pick -current kernel with MROUTING enabled and run with
> multicast services like mrouted and multiple interfaces
> and watch it panic while trying to reach multi user.
>>Fix:
> With MROUTING disabled the kernel will survive the startup
> but that is not the solution.
Thank you for the report. A possible fix is the below patch.
I'm still checking whether the place I put KERNEL_LOCK is appropriate
or not, anyway it should fix the assertion failure.
Regards,
ozaki-r
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index a92c61b..4d31253 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -1713,5 +1713,7 @@ ip_mloopback(struct ifnet *ifp, struct mbuf *m,
const struct sockaddr_in *dst)
ip->ip_sum = 0;
ip->ip_sum = in_cksum(copym, ip->ip_hl << 2);
+ KERNEL_LOCK(1, NULL);
(void)looutput(ifp, copym, sintocsa(dst), NULL);
+ KERNEL_UNLOCK_ONE(NULL);
}
Home |
Main Index |
Thread Index |
Old Index