NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/58924: ugenintr() triggers allocation in b_to_q(), causing assert to fire



>Number:         58924
>Category:       kern
>Synopsis:       ugenintr() triggers allocation in b_to_q(), causing assert to fire
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 21 03:45:00 +0000 2024
>Originator:     matthew green
>Release:        NetBSD 9.99.94
>Organization:
people's front against (bozotic) www (softwar foundation)
>Environment:
System: rockpro64
Architecture: arm64
Machine: arm64-eb
>Description:

	i've seen this a few times and i believe christos has
	as well, and it is a "shouldn't happen" case afaict from
	the code:

 b_to_q: required clalloc
 panic: kernel diagnostic assertion "(!cpu_intr_p() && !cpu_softintr_p())" failed: file "/usr/src/sys/kern/subr_kmem.c", line 320 kmem(9) should not be used from the interrupt context
 cpu0: Begin traceback...
 trace fp ffffc0009d4b7a00
 fp ffffc0009d4b7a30 vpanic() at ffffc0000057a37c netbsd:vpanic+0x14c
 fp ffffc0009d4b7a90 kern_assert() at ffffc000007032f8 netbsd:kern_assert+0x58
 fp ffffc0009d4b7b20 kmem_zalloc() at ffffc0000056e0c8 netbsd:kmem_zalloc+0x48
 fp ffffc0009d4b7b50 b_to_q() at ffffc000005a750c netbsd:b_to_q+0x1dc
 fp ffffc0009d4b7ba0 ugenintr() at ffffc00000197fe8 netbsd:ugenintr+0x68
 fp ffffc0009d4b7be0 usb_transfer_complete() at ffffc0000017b574 netbsd:usb_transfer_complete+0x494
 fp ffffc0009d4b7c50 ohci_softintr() at ffffc00000233838 netbsd:ohci_softintr+0xf28
 fp ffffc0009d4b7cd0 usb_soft_intr() at ffffc000001743a4 netbsd:usb_soft_intr+0x24
 fp ffffc0009d4b7d30 softint_dispatch() at ffffc00000545298 netbsd:softint_dispatch+0xf8
 fp ffffc0009d44fcc0 cpu_switchto_softint() at ffffc000000aca20 netbsd:cpu_switchto_softint+0x70
 fp ffffc0009d44fdf8 cpu_idle() at ffffc000000adc9c netbsd:cpu_idle+0x58
 fp ffffc0009d44fe40 idle_loop() at ffffc0000051c140 netbsd:idle_loop+0x180

	the relevant device is:

 ugen0 at uhub5 port 1
 ugen0: CPS (0x0764) CP 1500C (0x0501), rev 1.10/0.01, addr 2

	and ups-nut-usb was talking to it.  the tty buffer should
	be pre-allocated and not need clalloc() here, but something
	is making it believe it needs to allocate.

	Taylor suggests that perhaps ugen.c 1.171 fixed this, but
	this problem is hard to trigger (this system had been up
	for almost a year before some recent extended power outages,
	and did not see the problem.)  i'm filing this PR for both
	tracking the issue (if it does not re-occur in the coming
	years, we can assume ugen 1.171 was the fix), and also to
	consider pulling up the fix to netbsd-9 (and, the code that
	the fix fixes, since that code fixes other bugs.)

>How-To-Repeat:

	use ups-nut-usb?

>Fix:



Home | Main Index | Thread Index | Old Index