Files
kernel_arpi/include/linux
Elena Reshetova a4b51a9f83 drivers, net, mlx5: convert mlx5_cq.refcount from atomic_t to refcount_t
atomic_t variables are currently used to implement reference
counters with the following properties:
 - counter is initialized to 1 using atomic_set()
 - a resource is freed upon counter reaching zero
 - once counter reaches zero, its further
   increments aren't allowed
 - counter schema uses basic atomic operations
   (set, inc, inc_not_zero, dec_and_test, etc.)

Such atomic variables should be converted to a newly provided
refcount_t type and API that prevents accidental counter overflows
and underflows. This is important since overflows and underflows
can lead to use-after-free situation and be exploitable.

The variable mlx5_cq.refcount is used as pure reference counter.
Convert it to refcount_t and fix up the operations.

Suggested-by: Kees Cook <keescook@chromium.org>
Reviewed-by: David Windsor <dwindsor@gmail.com>
Reviewed-by: Hans Liljestrand <ishkamiel@gmail.com>
Signed-off-by: Elena Reshetova <elena.reshetova@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-10-22 02:22:38 +01:00
..
2017-09-06 19:56:49 +02:00
2017-10-04 10:22:55 +02:00
2017-10-09 10:21:26 -07:00
2017-09-01 16:35:50 -05:00
2017-09-08 18:26:49 -07:00
2017-08-30 14:40:40 +02:00
2017-09-04 00:05:22 +02:00
2017-09-04 00:06:02 +02:00
2017-09-05 12:53:11 +02:00
2017-08-24 13:23:03 -07:00
2017-08-03 19:09:26 -07:00
2017-08-07 17:22:14 +02:00
2017-09-08 18:26:46 -07:00
2017-08-15 18:23:52 +02:00
2017-08-14 13:33:39 -07:00
2017-08-17 15:33:39 -04:00
2017-08-28 20:51:22 +02:00
2017-09-07 11:53:11 +02:00
2017-08-18 15:32:01 -07:00
2017-08-20 13:04:12 -04:00
2017-09-25 08:56:05 -06:00
2017-10-09 20:26:23 -07:00
2017-09-06 17:27:26 -07:00
2017-08-06 20:55:29 -07:00
2017-08-06 20:55:29 -07:00
2017-08-21 12:47:31 -07:00
2017-09-08 18:26:47 -07:00
2017-08-16 16:28:47 -07:00
2017-08-24 16:34:51 +02:00
2017-08-16 16:28:47 -07:00
2017-08-03 21:37:29 -07:00
2017-09-11 12:29:41 -04:00
2017-09-15 16:57:10 +02:00
2017-08-28 16:15:42 +02:00
2017-09-08 18:26:48 -07:00
2017-08-31 18:50:14 +02:00
2017-09-05 06:34:17 -07:00
2017-08-15 09:02:07 -07:00
2017-08-15 09:02:08 -07:00