lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <14d6e454-49c3-0a85-68f1-3f003ad032e6@ugent.be>
Date:   Mon, 21 Feb 2022 01:03:52 +0100
From:   Niels Dossche <niels.dossche@...nt.be>
To:     Adaptec OEM Raid Solutions <aacraid@...rosemi.com>
Cc:     linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] scsi: aacraid: add missing manage_lock on
 management_fib_count

All other places modify the management_fib_count under the manage_lock.
Avoid a possible race condition by also applying that lock in
aac_src_intr_message.

Signed-off-by: Niels Dossche <niels.dossche@...nt.be>
---
 drivers/scsi/aacraid/src.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/aacraid/src.c b/drivers/scsi/aacraid/src.c
index 11ef58204e96..ca73439587ed 100644
--- a/drivers/scsi/aacraid/src.c
+++ b/drivers/scsi/aacraid/src.c
@@ -91,7 +91,9 @@ static irqreturn_t aac_src_intr_message(int irq, void *dev_id)
                                        dev->sync_fib);
                        spin_lock_irqsave(&dev->sync_fib->event_lock, sflags);
                        if (dev->sync_fib->flags & FIB_CONTEXT_FLAG_WAIT) {
+                               spin_lock(&dev->manage_lock);
                                dev->management_fib_count--;
+                               spin_unlock(&dev->manage_lock);
                                complete(&dev->sync_fib->event_wait);
                        }
                        spin_unlock_irqrestore(&dev->sync_fib->event_lock,
-- 
2.35.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ