summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authorlstewart <lstewart@FreeBSD.org>2011-01-23 13:00:25 +0000
committerlstewart <lstewart@FreeBSD.org>2011-01-23 13:00:25 +0000
commit3087aa2fa91d995a820fabb18e1cac1068e9c6b0 (patch)
tree5c026cdda8f4584df332222cd0c784dde2f9fc50 /gnu
parent42a63fe711f3b2bd5f354dc9e6a065d48588c0cb (diff)
downloadFreeBSD-src-3087aa2fa91d995a820fabb18e1cac1068e9c6b0.zip
FreeBSD-src-3087aa2fa91d995a820fabb18e1cac1068e9c6b0.tar.gz
An sbuf configured with SBUF_AUTOEXTEND will call malloc with M_WAITOK when a
write to the buffer causes it to overflow. We therefore can't hold the CC list rwlock over a call to sbuf_printf() for an sbuf configured with SBUF_AUTOEXTEND. Switch to a fixed length sbuf which should be of sufficient size except in the very unlikely event that the sysctl is being processed as one or more new algorithms are loaded. If that happens, we accept the race and may fail the sysctl gracefully if there is insufficient room to print the names of all the algorithms. This should address a WITNESS warning and the potential panic that would occur if the sbuf call to malloc did sleep whilst holding the CC list rwlock. Sponsored by: FreeBSD Foundation Reported by: Nick Hibma Reviewed by: bz MFC after: 3 weeks X-MFC with: r215166
Diffstat (limited to 'gnu')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud