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:	Thu, 23 Apr 2009 12:23:14 +0200
From:	Roel Kluin <roel.kluin@...il.com>
To:	Greg KH <greg@...ah.com>
CC:	fmhess@...rs.sourceforge.net, Greg KH <gregkh@...e.de>,
	lkml <linux-kernel@...r.kernel.org>,
	Ian Abbott <abbotti@....co.uk>, David Schleef <ds@...leef.org>
Subject: Re: staging: comedi: non working tests on unsigned cmd->convert_arg

Greg KH wrote:
> On Wed, Apr 22, 2009 at 02:11:10PM -0400, Frank Mori Hess wrote:
>> On Wednesday 22 April 2009, Greg KH wrote:
>>> On Tue, Apr 21, 2009 at 03:18:10PM +0200, Roel Kluin wrote:
>>>> vi drivers/staging/comedi/comedi.h +342
>>>>
>>>> and note that cmd->convert_arg in s626_ai_cmdtest() is unsigned.
>>>> Should there maybe be a test:
>>>>
>>>> if (cmd->convert_src == TRIG_EXT && cmd->convert_arg > MAX)
>>>>
>>>> (and what should MAX be then?)
>>> I don't know.  Let's ask the comedi developers :)
>>>
>>> Frank, what do you think about this?
>>
>> It looks like there already is such a test, right below the useless one the 
>> patch removes.
> 
> Ok, thanks for checking.  Roel, care to resend these patches then?
> 
> thanks,
> 
> greg k-h
> 
So you don't want to set cmd->*_arg to 0 when beyond 39 or below 0?
------------------------------>8-------------8<---------------------------------
Remove tests for negative unsigned.

Signed-off-by: Roel Kluin <roel.kluin@...il.com> 
---
diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c
index 30dec9d..a48b244 100644
--- a/drivers/staging/comedi/drivers/s626.c
+++ b/drivers/staging/comedi/drivers/s626.c
@@ -1886,31 +1886,16 @@ static int s626_ai_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s
 		err++;
 	}
 
-	if (cmd->start_src == TRIG_EXT && cmd->start_arg < 0) {
-		cmd->start_arg = 0;
-		err++;
-	}
-
 	if (cmd->start_src == TRIG_EXT && cmd->start_arg > 39) {
 		cmd->start_arg = 39;
 		err++;
 	}
 
-	if (cmd->scan_begin_src == TRIG_EXT && cmd->scan_begin_arg < 0) {
-		cmd->scan_begin_arg = 0;
-		err++;
-	}
-
 	if (cmd->scan_begin_src == TRIG_EXT && cmd->scan_begin_arg > 39) {
 		cmd->scan_begin_arg = 39;
 		err++;
 	}
 
-	if (cmd->convert_src == TRIG_EXT && cmd->convert_arg < 0) {
-		cmd->convert_arg = 0;
-		err++;
-	}
-
 	if (cmd->convert_src == TRIG_EXT && cmd->convert_arg > 39) {
 		cmd->convert_arg = 39;
 		err++;
--
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