linux/arch/sparc
Elena Reshetova cdf5976fcb sparc64: convert mdesc_handle.refcnt 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 mdesc_handle.refcnt 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>
Acked-by: Shannon Nelson <shannon.nelson@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-15 14:28:23 +09:00
..
boot sparc: Add "install" target 2014-08-04 20:45:59 -07:00
configs sparc64: vcc: Enable VCC module in linux 2017-08-15 21:33:50 -07:00
crypto crypto: algapi - make crypto_xor() take separate dst and src arguments 2017-08-04 09:27:15 +08:00
include sparc64: Define SPARC default __fls function 2017-11-15 14:26:46 +09:00
kernel sparc64: convert mdesc_handle.refcnt from atomic_t to refcount_t 2017-11-15 14:28:23 +09:00
lib sparc64: Use sparc optimized fls and __fls for T4 and above 2017-11-15 14:26:46 +09:00
math-emu Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
mm sparc64: Cleanup hugepage table walk functions 2017-08-15 21:48:07 -07:00
net bpf, sparc64: implement jiting of BPF_J{LT, LE, SLT, SLE} 2017-08-09 16:53:57 -07:00
oprofile
power sparc64: Prevent perf from running during super critical sections 2017-07-18 11:25:52 -07:00
prom sparc: fixing ident and beautifying code 2016-10-06 01:46:40 -04:00
vdso vDSO for sparc 2017-11-15 14:21:03 +09:00
Kbuild vDSO for sparc 2017-11-15 14:21:03 +09:00
Kconfig vDSO for sparc 2017-11-15 14:21:03 +09:00
Kconfig.debug
Makefile vDSO for sparc 2017-11-15 14:21:03 +09:00