diff options
author | Elena Reshetova | 2017-03-06 15:21:11 +0100 |
---|---|---|
committer | Nicholas Bellinger | 2017-05-02 07:20:43 +0200 |
commit | 5981c245a890db6a6e16fb6d3838cc9fc9fdf0ff (patch) | |
tree | a1aa3f65fa046e1ac40b923e97b8b2f36b347c08 /drivers/target/target_core_iblock.h | |
parent | tcmu: Skip Data-Out blocks before gathering Data-In buffer for BIDI case (diff) | |
download | kernel-qcow2-linux-5981c245a890db6a6e16fb6d3838cc9fc9fdf0ff.tar.gz kernel-qcow2-linux-5981c245a890db6a6e16fb6d3838cc9fc9fdf0ff.tar.xz kernel-qcow2-linux-5981c245a890db6a6e16fb6d3838cc9fc9fdf0ff.zip |
target/iblock: convert iblock_req.pending 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 <elena.reshetova@intel.com>
Signed-off-by: Hans Liljestrand <ishkamiel@gmail.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David Windsor <dwindsor@gmail.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_iblock.h')
-rw-r--r-- | drivers/target/target_core_iblock.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/target/target_core_iblock.h b/drivers/target/target_core_iblock.h index 718d3fcd3e7c..f2a5797217d4 100644 --- a/drivers/target/target_core_iblock.h +++ b/drivers/target/target_core_iblock.h @@ -2,6 +2,7 @@ #define TARGET_CORE_IBLOCK_H #include <linux/atomic.h> +#include <linux/refcount.h> #include <target/target_core_base.h> #define IBLOCK_VERSION "4.0" @@ -10,7 +11,7 @@ #define IBLOCK_LBA_SHIFT 9 struct iblock_req { - atomic_t pending; + refcount_t pending; atomic_t ib_bio_err_cnt; } ____cacheline_aligned; |