All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Abbott <abbotti@mev.co.uk>
To: Hartley Sweeten <HartleyS@visionengravers.com>,
	"driverdev-devel@linuxdriverproject.org" 
	<driverdev-devel@linuxdriverproject.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 5/7] staging: comedi: don't allow write() on async command set up for "read"
Date: Thu, 30 Oct 2014 20:29:21 +0000	[thread overview]
Message-ID: <54529FA1.8000702@mev.co.uk> (raw)
In-Reply-To: <DC148C5AA1CEBA4E87973D432B1C2D882600D3B7@P3PWEX4MB008.ex4.secureserver.net>

On 30/10/14 18:07, Hartley Sweeten wrote:
> On Thursday, October 30, 2014 5:43 AM, Ian Abbott wrote:
[snip]
>>   	add_wait_queue(&async->wait_head, &wait);
>>   	on_wait_queue = true;
>> @@ -2146,6 +2150,10 @@ static ssize_t comedi_write(struct file *file, const char __user *buf,
>>   				retval = -EACCES;
>>   				break;
>>   			}
>> +			if (!(async->cmd.flags & CMDF_WRITE)) {
>> +				retval = -EINVAL;
>> +				break;
>> +			}
>
> Same question as with PATCH 4/7.
>
> Is this test needed in the while () loop. Also, are the s->busy tests needed here?

Yes, for similar reasons.

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-

  reply	other threads:[~2014-10-30 20:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-30 12:42 [PATCH 0/7] staging: comedi: enforce data transfer direction Ian Abbott
2014-10-30 12:42 ` [PATCH 1/7] staging: comedi: maybe force CMDF_WRITE command flag Ian Abbott
2014-10-30 12:42 ` [PATCH 2/7] staging: comedi: me4000: don't clobber command flags Ian Abbott
2014-10-30 12:42 ` [PATCH 3/7] staging: comedi: ni_mio_common: don't change CMDF_WRITE flag Ian Abbott
2014-10-30 12:42 ` [PATCH 4/7] staging: comedi: don't allow read() on async command set up for "write" Ian Abbott
2014-10-30 18:05   ` Hartley Sweeten
2014-10-30 20:27     ` Ian Abbott
2014-10-30 20:45       ` Hartley Sweeten
2014-10-30 21:00         ` Ian Abbott
2014-10-30 12:42 ` [PATCH 5/7] staging: comedi: don't allow write() on async command set up for "read" Ian Abbott
2014-10-30 18:07   ` Hartley Sweeten
2014-10-30 20:29     ` Ian Abbott [this message]
2014-10-30 12:42 ` [PATCH 6/7] staging: comedi: check command direction in poll() file operation Ian Abbott
2014-10-30 12:42 ` [PATCH 7/7] staging: comedi: check actual data direction for COMEDI_BUFINFO ioctl Ian Abbott
2014-10-30 21:29 ` [PATCH 0/7] staging: comedi: enforce data transfer direction Hartley Sweeten

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54529FA1.8000702@mev.co.uk \
    --to=abbotti@mev.co.uk \
    --cc=HartleyS@visionengravers.com \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.