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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 10 Dec 2012 11:50:05 +0100
From:	Samuel Iglesias Gonsalvez <siglesias@...lia.com>
To:	Jens Taprogge <jens.taprogge@...rogge.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	industrypack-devel@...ts.sourceforge.net,
	linux-kernel@...r.kernel.org, devel@...uxdriverproject.org,
	Samuel Iglesias Gonsalvez <siglesias@...lia.com>
Subject: [PATCH 09/12] ipack/devices/ipoctal: protect the channel data processing with a spinlock

We protect important data such as TX buffer pointer, nb_bytes counter and status
registers of the device, from accessing several times at the same time.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@...lia.com>
---
 drivers/ipack/devices/ipoctal.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/ipack/devices/ipoctal.c b/drivers/ipack/devices/ipoctal.c
index d57ac61..8dff66e 100644
--- a/drivers/ipack/devices/ipoctal.c
+++ b/drivers/ipack/devices/ipoctal.c
@@ -191,6 +191,8 @@ static void ipoctal_irq_channel(struct ipoctal_channel *channel)
 	tty = tty_port_tty_get(&channel->tty_port);
 	if (!tty)
 		return;
+
+	spin_lock(&channel->lock);
 	/* The HW is organized in pair of channels.  See which register we need
 	 * to read from */
 	isr = ioread8(&channel->block_regs->r.isr);
@@ -216,6 +218,7 @@ static void ipoctal_irq_channel(struct ipoctal_channel *channel)
 
 	tty_flip_buffer_push(tty);
 	tty_kref_put(tty);
+	spin_unlock(&channel->lock);
 }
 
 static irqreturn_t ipoctal_irq_handler(void *arg)
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ