Subject: CVS commit: src/sys
To: None <source-changes@NetBSD.org>
From: Thor Lancelot Simon <tls@netbsd.org>
List: source-changes
Date: 10/05/2006 17:35:20
Module Name: src
Committed By: tls
Date: Thu Oct 5 17:35:20 UTC 2006
Modified Files:
src/sys/dev/raidframe: rf_diskqueue.c rf_netbsdkintf.c
src/sys/net: if_bridge.c route.c
src/sys/netinet: igmp.c in.c in_pcb.c ip_flow.c ip_input.c raw_ip.c
tcp_input.c tcp_sack.c tcp_subr.c tcp_usrreq.c udp_usrreq.c
src/sys/netinet6: in6_pcb.c
Log Message:
Protect calls to pool_put/pool_get that may occur in interrupt context
with spl used to protect other allocations and frees, or datastructure
element insertion and removal, in adjacent code.
It is almost unquestionably the case that some of the spl()/splx() calls
added here are superfluous, but it really seems wrong to see:
s=splfoo();
/* frob data structure */
splx(s);
pool_put(x);
and if we think we need to protect the first operation, then it is hard
to see why we should not think we need to protect the next. "Better
safe than sorry".
It is also almost unquestionably the case that I missed some pool
gets/puts from interrupt context with my strategy for finding these
calls; use of PR_NOWAIT is a strong hint that a pool may be used from
interrupt context but many callers in the kernel pass a "can wait/can't
wait" flag down such that my searches might not have found them. One
notable area that needs to be looked at is pf.
See also:
http://mail-index.netbsd.org/tech-kern/2006/07/19/0003.html
http://mail-index.netbsd.org/tech-kern/2006/07/19/0009.html
To generate a diff of this commit:
cvs rdiff -r1.45 -r1.46 src/sys/dev/raidframe/rf_diskqueue.c
cvs rdiff -r1.214 -r1.215 src/sys/dev/raidframe/rf_netbsdkintf.c
cvs rdiff -r1.40 -r1.41 src/sys/net/if_bridge.c
cvs rdiff -r1.71 -r1.72 src/sys/net/route.c
cvs rdiff -r1.42 -r1.43 src/sys/netinet/igmp.c
cvs rdiff -r1.110 -r1.111 src/sys/netinet/in.c
cvs rdiff -r1.105 -r1.106 src/sys/netinet/in_pcb.c
cvs rdiff -r1.34 -r1.35 src/sys/netinet/ip_flow.c
cvs rdiff -r1.232 -r1.233 src/sys/netinet/ip_input.c
cvs rdiff -r1.92 -r1.93 src/sys/netinet/raw_ip.c
cvs rdiff -r1.244 -r1.245 src/sys/netinet/tcp_input.c
cvs rdiff -r1.14 -r1.15 src/sys/netinet/tcp_sack.c
cvs rdiff -r1.199 -r1.200 src/sys/netinet/tcp_subr.c
cvs rdiff -r1.122 -r1.123 src/sys/netinet/tcp_usrreq.c
cvs rdiff -r1.148 -r1.149 src/sys/netinet/udp_usrreq.c
cvs rdiff -r1.72 -r1.73 src/sys/netinet6/in6_pcb.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.