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: <1404298936-5594-1-git-send-email-abbotti@mev.co.uk>
Date:	Wed,  2 Jul 2014 12:02:16 +0100
From:	Ian Abbott <abbotti@....co.uk>
To:	driverdev-devel@...uxdriverproject.org
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Ian Abbott <abbotti@....co.uk>,
	H Hartley Sweeten <hartleys@...ionengravers.com>,
	linux-kernel@...r.kernel.org
Subject: [PATCH] staging: comedi: allow COMEDI_BUFINFO, COMEDI_CANCEL and COMEDI_POLL on locked subdevice

Comedi subdevices can be locked for mostly exclusive access by a
particular file object by means of the COMEDI_LOCK ioctl.  Some
operations disregard the lock.  For example, the read() and write() file
operations are allowed for the file object that set up an asynchronous
command on the subdevice (making it "busy") regardless of whether it is
locked.

The COMEDI_BUFINFO, COMEDI_CANCEL and COMEDI_POLL ioctls are also
associated with the file object that made the subdevice "busy" with a
command.  They currently obey the exclusive access lock on the subdevice
as well, but it makes more sense for them to ignore it like the read()
and write() file operations.  Remove the exclusive subdevice access
checks for these ioctls.

Signed-off-by: Ian Abbott <abbotti@....co.uk>
---
 drivers/staging/comedi/comedi_fops.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index d4904cc..e8e3809 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -968,9 +968,6 @@ static int do_bufinfo_ioctl(struct comedi_device *dev,
 
 	s = &dev->subdevices[bi.subdevice];
 
-	if (s->lock && s->lock != file)
-		return -EACCES;
-
 	async = s->async;
 
 	if (!async) {
@@ -1744,9 +1741,6 @@ static int do_cancel_ioctl(struct comedi_device *dev, unsigned int arg,
 	if (s->async == NULL)
 		return -EINVAL;
 
-	if (s->lock && s->lock != file)
-		return -EACCES;
-
 	if (!s->busy)
 		return 0;
 
@@ -1781,9 +1775,6 @@ static int do_poll_ioctl(struct comedi_device *dev, unsigned int arg,
 		return -EINVAL;
 	s = &dev->subdevices[arg];
 
-	if (s->lock && s->lock != file)
-		return -EACCES;
-
 	if (!s->busy)
 		return 0;
 
-- 
2.0.0

--
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