linux_dsm_epyc7002/drivers/net/hamradio
Elena Reshetova 956cc1e70c drivers, net, hamradio: convert sixpack.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 sixpack.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>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-10-22 02:22:39 +01:00
..
6pack.c drivers, net, hamradio: convert sixpack.refcnt from atomic_t to refcount_t 2017-10-22 02:22:39 +01:00
baycom_epp.c hamradio: baycom: use new parport device model 2017-09-18 16:40:25 -07:00
baycom_par.c hamradio: baycom_par: use new parport device model 2017-10-16 21:16:23 +01:00
baycom_ser_fdx.c hamradio: baycom: make hdlcdrv_ops const 2017-08-07 14:26:46 -07:00
baycom_ser_hdx.c hamradio: baycom: make hdlcdrv_ops const 2017-08-07 14:26:46 -07:00
bpqether.c net: Fix inconsistent teardown and release of private netdev state. 2017-06-07 15:53:24 -04:00
dmascc.c hamradio: dmascc: avoid -Wformat-overflow warning 2017-07-26 09:32:44 -07:00
hdlcdrv.c hdlcdrv: Fix divide by zero in hdlcdrv_ioctl 2017-05-27 18:44:17 -04:00
Kconfig tty: Added a CONFIG_TTY option to allow removal of TTY 2013-01-18 16:15:27 -08:00
Makefile Fix common misspellings 2011-03-31 11:26:23 -03:00
mkiss.c mkiss: remove redundant check on len being zero 2017-09-30 05:44:28 +01:00
scc.c hamradio/scc: Convert timers to use timer_setup() 2017-10-18 12:40:26 +01:00
yam.c yam: use memdup_user 2017-05-08 15:02:10 -04:00
z8530.h