plan9fox/sys
cinap_lenrek 27fc79b04b devip: fix ifc recursive rlock() deadlock
ipiput4() and ipiput6() are called with the incoming interface rlocked
while ipoput4() and ipoput6() also rlock() the outgoing interface once
a route has been found. it is common that the incoming and outgoing
interfaces are the same recusive rlocking().

the deadlock happens when a reader holds the rlock for the incoming interface,
then ip/ipconfig tries to add a new address, trying to wlock the interface.
as there are still active readers on the ifc, ip/ipconfig process gets queued
on the inteface RWlock.

now the reader finds the outgoing route which has the same interface as the
incoming packet and tries to rlock the ifc again. but now theres a writer
queued, so we also go to sleep waiting four outselfs to release the lock.

the solution is to never wait for the outgoing interface rlock, but instead
use non-queueing canrlock() and if it cannot be acquired, discard the packet.
2020-05-10 22:51:40 +02:00
..
doc /sys/doc: fix mkfile to and remove files that now can be regenerated 2017-05-09 16:23:48 +02:00
games/lib fortunes: As much as I'd love to I feel I have to let it go -- rminnich 2020-04-18 21:37:53 -04:00
include bring stdint.h closer to spec 2020-05-06 15:39:12 -07:00
lib tmac.eai: wrapper around -me: auto indexing sections, .TC macro (thanks sirjofri) 2020-05-04 11:57:24 +02:00
man aux/getflags: improve flagfmt parser 2020-05-07 00:10:09 +02:00
src devip: fix ifc recursive rlock() deadlock 2020-05-10 22:51:40 +02:00