Page MenuHomeFreeBSD

tcp_syncache: Mute a false positive random-may-block warning
AcceptedPublic

Authored by cem on May 6 2019, 6:12 PM.

Details

Reviewers
gallatin
rrs
jhb
glebius
tuexen
Group Reviewers
transport
Summary

syncache_add cannot be reached unless syncache_init has already succeeded,
and syncache_init() relies on arc4random availability. We inherit the
invariant that random must already be unblocked from it.

Test Plan

Stack was:

arc4rand may block once with the following non-sleepable locks held:
exclusive sleep mutex tcp_sc_head (tcp_sc_head) r = 0 (0xfffffe000077a0b0) locked @ /usr/home/conrad/src/freebsd/sys/netinet/tcp_syncache.c:531
stack backtrace:
#0 0xffffffff80c127a4 at witness_debugger.part.14+0xa4
#1 0xffffffff80c15aa5 at witness_warn+0x285
#2 0xffffffff80c93be1 at arc4rand+0x41
#3 0xffffffff80c93da8 at arc4random+0x18
#4 0xffffffff80de6b9d at syncache_add+0x6dd
#5 0xffffffff80dcd778 at tcp_input+0x1788
#6 0xffffffff80d443c0 at ip_input+0x170
#7 0xffffffff80cd0fb8 at netisr_dispatch_src+0x328
#8 0xffffffff80cb25be at ether_demux+0x1ae
#9 0xffffffff80cb318a at ether_nh_input+0x27a
#10 0xffffffff80cd0fb8 at netisr_dispatch_src+0x328
#11 0xffffffff80cb1fd4 at ether_input+0xa4
#12 0xffffffff809dcd6a at vtnet_rxq_eof+0x40a
#13 0xffffffff809dd16b at vtnet_rx_vq_intr+0x7b
#14 0xffffffff80b684be at ithread_loop+0x13e

Diff Detail

Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 24125
Build 22982: arc lint + arc unit