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] [day] [month] [year] [list]
Date:	Tue, 13 May 2008 15:07:33 -0700
From:	<gregkh@...e.de>
To:	marcin.slusarz@...il.com, david-b@...bell.net, gregkh@...e.de,
	linux-kernel@...r.kernel.org
Subject: patch usbtest-comment-on-why-this-code-expects-negative-and-positive-errnos.patch added to gregkh-2.6 tree


This is a note to let you know that I've just added the patch titled

     Subject: usbtest: comment on why this code "expects" negative and positive errnos

to my gregkh-2.6 tree.  Its filename is

     usbtest-comment-on-why-this-code-expects-negative-and-positive-errnos.patch

This tree can be found at 
    http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/


>From marcin.slusarz@...il.com  Tue May 13 14:58:09 2008
From: Marcin Slusarz <marcin.slusarz@...il.com>
Date: Mon, 12 May 2008 20:17:25 +0200
Subject: usbtest: comment on why this code "expects" negative and positive errnos
To: David Brownell <david-b@...bell.net>, LKML <linux-kernel@...r.kernel.org>
Cc: Greg Kroah-Hartman <gregkh@...e.de>, linux-usb@...r.kernel.org
Message-ID: <20080512181721.GA6031@joi>
Content-Disposition: inline


On Mon, May 12, 2008 at 01:02:22AM -0700, David Brownell wrote:
> On Sunday 11 May 2008, Marcin Slusarz wrote:
> > 
> > test_ctrl_queue expects (?) positive and negative errnos.
> > what is going on here?
> 
> The sign is just a way to flag something:
> 
>                 /* some faults are allowed, not required */
> 
> The negative ones are required.  Positive codes are optional,
> in the sense that, depending on how the peripheral happens
> to be implemented, they won't necessarily be triggered.
> 
> For example, the test to fetch a device qualifier desriptor
> must succeed if the device is running at high speed.  So that
> test is marked as negative.  But when it's full speed, it
> could legitimately fail; marked as positive.  And so on for
> other tests.
> 
> Look at how the codes are *interpreted* to see it work.

Lets document it.

Based on comment from David Brownell <david-b@...bell.net>.

Signed-off-by: Marcin Slusarz <marcin.slusarz@...il.com>
Cc: David Brownell <david-b@...bell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>

---
 drivers/usb/misc/usbtest.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -856,6 +856,11 @@ test_ctrl_queue (struct usbtest_dev *dev
 		struct urb		*u;
 		struct usb_ctrlrequest	req;
 		struct subcase		*reqp;
+
+		/* sign of this variable means:
+		 *  -: tested code must return this (negative) error code
+		 *  +: tested code may return this (negative too) error code
+		 */
 		int			expected = 0;
 
 		/* requests here are mostly expected to succeed on any


Patches currently in gregkh-2.6 which might be from marcin.slusarz@...il.com are

usb.current/usbtest-comment-on-why-this-code-expects-negative-and-positive-errnos.patch
--
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