andrew 6aeb44070c Check the index hasn't changed after writing the cmp entry.
If an interrupt fires while writing the cmp entry we may have a partial
entry. Work around this by using atomic_cmpset to set the new index. If it
fails we need to set the previous index value and try again as the entry
may be in an inconsistent state.

This fixes messages similar to the following from syzkaller:
bad comp 224 type 2163727253

Reviewed by:	tuexen
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D19287
2019-02-25 13:15:34 +00:00
..
2018-12-07 15:19:00 +00:00
2018-11-29 03:44:02 +00:00
2019-01-27 00:46:06 +00:00
2018-12-05 16:43:03 +00:00
2018-12-08 06:30:41 +00:00
2018-10-30 21:35:56 +00:00
2018-10-22 02:35:12 +00:00
2017-12-13 16:30:39 +00:00
2019-02-04 21:28:25 +00:00
2018-12-29 21:18:01 +00:00
2018-10-12 00:32:45 +00:00
2018-08-18 19:45:56 +00:00
2018-04-08 16:34:10 +00:00
2018-06-01 13:26:45 +00:00
2019-02-20 09:38:19 +00:00
2018-11-20 14:58:41 +00:00
2018-10-25 15:40:59 +00:00
2018-12-07 15:19:00 +00:00
2019-01-31 22:58:17 +00:00
2018-06-01 13:26:45 +00:00
2019-01-16 05:15:57 +00:00
2018-11-19 00:54:31 +00:00
2018-10-23 21:43:41 +00:00
2019-01-08 09:04:27 +00:00