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]
Message-ID: <20110523123135.GA10785@linutronix.de>
Date:	Mon, 23 May 2011 14:31:36 +0200
From:	Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To:	Mike Frysinger <vapier@...too.org>
Cc:	greg@...ah.com, linux-usb@...r.kernel.org,
	linux-arm-msm@...r.kernel.org, balbi@...com, ablay@...eaurora.org,
	open list <linux-kernel@...r.kernel.org>,
	Tatyana Brokhman <tlinder@...eaurora.org>
Subject: Re: [PATCH v12 4/8] usb:gadget: Add SuperSpeed support to the
 Gadget Framework

* Tatyana Brokhman | 2011-05-23 09:41:13 [+0300]:
>diff --git a/drivers/usb/gadget/composite.c
>b/drivers/usb/gadget/composite.c
>index 1c6bd66..7738302 100644
>--- a/drivers/usb/gadget/composite.c
>+++ b/drivers/usb/gadget/composite.c
>@@ -1015,6 +1175,62 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
> 		*((u8 *)req->buf) = value;
> 		value = min(w_length, (u16) 1);
> 		break;
>+
>+	/*
>+	 * USB 3.0 additions:
>+	 * Function driver should handle get_status request. If such cb
>+	 * wasn't supplied we respond with default value = 0
>+	 * Note: function driver should supply such cb only for the first
>+	 * interface of the function
>+	 */
>+	case USB_REQ_GET_STATUS:
>+		if (!gadget_is_superspeed(gadget))
>+			goto unknown;
>+		if (ctrl->bRequestType != (USB_DIR_IN | USB_RECIP_INTERFACE))
>+			goto unknown;
>+		value = 2;	/* This is the length of the get_status reply */
>+		*((__le16 *)req->buf) = 0;

Mike please correct me if I'm wrong bug this looks like a case for
put_unaligned_le16().
Is someone actually using gadget support on blackfin? I'm asking because
config_buf() (same file, upstream) is using req->buf to build the
descriptors in place and one element is le16 which should be affected.

>+		if (!cdev->config || intf >= MAX_CONFIG_INTERFACES)
>+			break;
>+		f = cdev->config->interface[intf];
>+		if (!f)
>+			break;
>+		status = f->get_status ? f->get_status(f) : 0;
>+		if (status < 0)
>+			break;
>+		*((__le16 *)req->buf) = cpu_to_le16(status & 0x0000ffff);
and here.

>+		break;

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