linux_dsm_epyc7002/include/linux/mlx5
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
..
cmd.h
cq.h drivers, net, mlx5: convert mlx5_cq.refcount from atomic_t to refcount_t 2017-10-22 02:22:38 +01:00
device.h net/mlx5: Fix FPGA capability location 2017-09-28 07:23:09 +03:00
doorbell.h IB/mlx5: Use blue flame register allocator in mlx5_ib 2017-01-09 20:25:08 +02:00
driver.h net/mlx5: PTP code migration to driver core section 2017-10-14 11:22:06 -07:00
fs.h net/mlx5: Use underlay QPN from the root name space 2017-05-14 13:33:45 +03:00
mlx5_ifc_fpga.h net/mlx5: Accel, Add IPSec acceleration interface 2017-06-27 16:36:47 +03:00
mlx5_ifc.h net/mlx5: Check device capability for maximum flow counters 2017-09-28 07:23:09 +03:00
port.h net/mlx5e: Add support for reading connector type from PTYS 2017-06-08 14:12:00 +03:00
qp.h RDMA/mlx5: Fix existence check for extended address vector 2017-08-04 14:24:05 -04:00
srq.h net/mlx5: Add XRQ support 2017-08-29 08:30:20 -04:00
transobj.h
vport.h net/mlx5: Add raw ethernet local loopback firmware command 2017-07-24 10:26:16 -04:00