Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2019-03-20 12:44:25 +0100
committerHannes Reinecke <hare@suse.de>2019-03-20 12:44:29 +0100
commitf2b1f56b609581115ad84929f3c667bd94ba91a0 (patch)
treea2e4026517f99be74f2db85ccbacb4b71ebb6c2c
parent278fbe15c609daa9c708d53983178fe08cdb1f7b (diff)
ch: add missing mutex_lock()/mutex_unlock() in ch_release()
(bsc#1124235).
-rw-r--r--patches.fixes/ch-add-missing-mutex_lock-mutex_unlock-in-ch_release.patch35
-rw-r--r--series.conf1
2 files changed, 36 insertions, 0 deletions
diff --git a/patches.fixes/ch-add-missing-mutex_lock-mutex_unlock-in-ch_release.patch b/patches.fixes/ch-add-missing-mutex_lock-mutex_unlock-in-ch_release.patch
new file mode 100644
index 0000000000..a6d69bb55f
--- /dev/null
+++ b/patches.fixes/ch-add-missing-mutex_lock-mutex_unlock-in-ch_release.patch
@@ -0,0 +1,35 @@
+From: Hannes Reinecke <hare@suse.de>
+Date: Mon, 20 Apr 2015 11:28:58 +0200
+Subject: [PATCH 1/2] ch: add missing mutex_lock()/mutex_unlock() in
+ ch_release()
+References: bsc#1124235
+Patch-Mainline: submitted linux-scsi 2019/03/20
+
+The 'ch_mutex" is meant to guard against modifications of
+file->private_data, so we need to take in in ch_release() as
+well as in ch_open().
+
+Signed-off-by: Hannes Reinecke <hare@suse.de>
+---
+ drivers/scsi/ch.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c
+index 1c5051b1c125..8f426903d7e4 100644
+--- a/drivers/scsi/ch.c
++++ b/drivers/scsi/ch.c
+@@ -577,9 +577,11 @@ ch_release(struct inode *inode, struct file *file)
+ {
+ scsi_changer *ch = file->private_data;
+
++ mutex_lock(&ch_mutex);
+ scsi_device_put(ch->device);
+ ch->device = NULL;
+ file->private_data = NULL;
++ mutex_unlock(&ch_mutex);
+ kref_put(&ch->ref, ch_destroy);
+ return 0;
+ }
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index 091f670bef..9d5fe4574f 100644
--- a/series.conf
+++ b/series.conf
@@ -20965,6 +20965,7 @@
patches.suse/0001-drm-vmwgfx-Don-t-double-free-the-mode-stored-in-par-.patch
patches.arch/pseries-energy-Use-OF-accessor-function-to-read-ibm-.patch
patches.fixes/bio-Introduce-BIO_ALLOCED-flag-and-check-it-in-bio_f.patch
+ patches.fixes/ch-add-missing-mutex_lock-mutex_unlock-in-ch_release.patch
########################################################
# end of sorted patches