From 6dc618cdd6b896791313926becb1f86ede0e046a Mon Sep 17 00:00:00 2001 From: Elena Reshetova Date: Thu, 9 Mar 2017 13:46:58 +0200 Subject: scsi: libiscsi: qedi: convert iscsi_task.refcount from atomic_t to refcount_t refcount_t type and corresponding API should be used instead of atomic_t when the variable is used as a reference counter. This allows to avoid accidental refcounter overflows that might lead to use-after-free situations. Signed-off-by: Elena Reshetova Signed-off-by: Hans Liljestrand Signed-off-by: Kees Cook Signed-off-by: David Windsor Acked-by: Chris Leech Signed-off-by: Martin K. Petersen --- include/scsi/libiscsi.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/scsi/libiscsi.h') diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h index b0e275de6dec..24d74b5bcb24 100644 --- a/include/scsi/libiscsi.h +++ b/include/scsi/libiscsi.h @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -139,7 +140,7 @@ struct iscsi_task { /* state set/tested under session->lock */ int state; - atomic_t refcount; + refcount_t refcount; struct list_head running; /* running cmd list */ void *dd_data; /* driver/transport data */ }; -- cgit v1.2.3