Prevent races in accesses of the software crypto session array.
authorBenno Rice <benno@FreeBSD.org>
Tue, 28 Jan 2014 22:02:29 +0000 (22:02 +0000)
committerBenno Rice <benno@FreeBSD.org>
Tue, 28 Jan 2014 22:02:29 +0000 (22:02 +0000)
commit109919c67af0a8cdad4d5ebc6bd5336d47566d97
treed27f15fbb585771adf8ec735b4e8c29683e18da8
parentd7d8b00becd9b5a7c3fa5ba84e2c4668eb30bc88
Prevent races in accesses of the software crypto session array.

swcr_newsession can change the pointer for swcr_sessions which races with
swcr_process which is looking up entries in this array.

Add a rwlock that protects changes to the array pointer so that
swcr_newsession and swcr_process no longer race.

Original patch by: Steve O'Hara-Smith <Steve.OHaraSmith@isilon.com>
Reviewed by: jmg
Sponsored by: EMC / Isilon Storage Division
sys/opencrypto/cryptosoft.c