* [PATCH] USB: core: Fix misuse of USB_DT_USB_SSP_CAP_SIZE()
@ 2017-12-19 18:14 Masakazu Mokuno
2018-01-09 15:06 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Masakazu Mokuno @ 2017-12-19 18:14 UTC (permalink / raw)
To: linux-usb; +Cc: Mathias Nyman, linux-stable
As USB_DT_USB_SSP_CAP_SIZE() takes SSAC value as an argument, the low
bound of the size for struct usb_ssp_cap_descriptor should be described
by USB_DT_USB_SSP_CAP_SIZE(0), not by USB_DT_USB_SSP_CAP_SIZE(1)
The type-specific length check patch was added to stable and needs to be
fixed as well.
Fixes: 81cf4a45360f ("USB: core: Add type-specific length check of BOS
descriptors")
Cc: linux-stable <stable@vger.kernel.org>
Cc: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Masakazu Mokuno <masakazu.mokuno@gmail.com>
--
drivers/usb/core/config.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index 78e92d2..33a3ab7 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -911,7 +911,7 @@ void usb_release_bos_descriptor(struct usb_device *dev)
[USB_CAP_TYPE_WIRELESS_USB] = USB_DT_USB_WIRELESS_CAP_SIZE,
[USB_CAP_TYPE_EXT] = USB_DT_USB_EXT_CAP_SIZE,
[USB_SS_CAP_TYPE] = USB_DT_USB_SS_CAP_SIZE,
- [USB_SSP_CAP_TYPE] = USB_DT_USB_SSP_CAP_SIZE(1),
+ [USB_SSP_CAP_TYPE] = USB_DT_USB_SSP_CAP_SIZE(0),
[CONTAINER_ID_TYPE] = USB_DT_USB_SS_CONTN_ID_SIZE,
[USB_PTM_CAP_TYPE] = USB_DT_USB_PTM_ID_SIZE,
};
--
Masakazu Mokuno
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] USB: core: Fix misuse of USB_DT_USB_SSP_CAP_SIZE()
2017-12-19 18:14 [PATCH] USB: core: Fix misuse of USB_DT_USB_SSP_CAP_SIZE() Masakazu Mokuno
@ 2018-01-09 15:06 ` Greg KH
2018-01-11 15:47 ` Masakazu Mokuno
0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2018-01-09 15:06 UTC (permalink / raw)
To: Masakazu Mokuno; +Cc: linux-usb, Mathias Nyman, linux-stable
On Wed, Dec 20, 2017 at 03:14:09AM +0900, Masakazu Mokuno wrote:
> As USB_DT_USB_SSP_CAP_SIZE() takes SSAC value as an argument, the low
> bound of the size for struct usb_ssp_cap_descriptor should be described
> by USB_DT_USB_SSP_CAP_SIZE(0), not by USB_DT_USB_SSP_CAP_SIZE(1)
>
> The type-specific length check patch was added to stable and needs to be
> fixed as well.
>
> Fixes: 81cf4a45360f ("USB: core: Add type-specific length check of BOS
> descriptors")
> Cc: linux-stable <stable@vger.kernel.org>
> Cc: Mathias Nyman <mathias.nyman@linux.intel.com>
> Signed-off-by: Masakazu Mokuno <masakazu.mokuno@gmail.com>
>
> --
>
> drivers/usb/core/config.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
> index 78e92d2..33a3ab7 100644
> --- a/drivers/usb/core/config.c
> +++ b/drivers/usb/core/config.c
> @@ -911,7 +911,7 @@ void usb_release_bos_descriptor(struct usb_device *dev)
> [USB_CAP_TYPE_WIRELESS_USB] = USB_DT_USB_WIRELESS_CAP_SIZE,
> [USB_CAP_TYPE_EXT] = USB_DT_USB_EXT_CAP_SIZE,
> [USB_SS_CAP_TYPE] = USB_DT_USB_SS_CAP_SIZE,
> - [USB_SSP_CAP_TYPE] = USB_DT_USB_SSP_CAP_SIZE(1),
> + [USB_SSP_CAP_TYPE] = USB_DT_USB_SSP_CAP_SIZE(0),
> [CONTAINER_ID_TYPE] = USB_DT_USB_SS_CONTN_ID_SIZE,
> [USB_PTM_CAP_TYPE] = USB_DT_USB_PTM_ID_SIZE,
> };
>
> --
> Masakazu Mokuno
Patch is corrupted and can not be applied :(
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] USB: core: Fix misuse of USB_DT_USB_SSP_CAP_SIZE()
2018-01-09 15:06 ` Greg KH
@ 2018-01-11 15:47 ` Masakazu Mokuno
0 siblings, 0 replies; 3+ messages in thread
From: Masakazu Mokuno @ 2018-01-11 15:47 UTC (permalink / raw)
To: Greg KH; +Cc: linux-usb, Mathias Nyman, linux-stable
Hi,
On Tue, 9 Jan 2018 16:06:41 +0100
Greg KH <gregkh@linuxfoundation.org> wrote:
> On Wed, Dec 20, 2017 at 03:14:09AM +0900, Masakazu Mokuno wrote:
> > As USB_DT_USB_SSP_CAP_SIZE() takes SSAC value as an argument, the low
> > bound of the size for struct usb_ssp_cap_descriptor should be described
> > by USB_DT_USB_SSP_CAP_SIZE(0), not by USB_DT_USB_SSP_CAP_SIZE(1)
> >
> > The type-specific length check patch was added to stable and needs to be
> > fixed as well.
> >
> > Fixes: 81cf4a45360f ("USB: core: Add type-specific length check of BOS
> > descriptors")
> > Cc: linux-stable <stable@vger.kernel.org>
> > Cc: Mathias Nyman <mathias.nyman@linux.intel.com>
> > Signed-off-by: Masakazu Mokuno <masakazu.mokuno@gmail.com>
> >
> > --
> >
> > drivers/usb/core/config.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
> > index 78e92d2..33a3ab7 100644
> > --- a/drivers/usb/core/config.c
> > +++ b/drivers/usb/core/config.c
> > @@ -911,7 +911,7 @@ void usb_release_bos_descriptor(struct usb_device *dev)
> > [USB_CAP_TYPE_WIRELESS_USB] = USB_DT_USB_WIRELESS_CAP_SIZE,
> > [USB_CAP_TYPE_EXT] = USB_DT_USB_EXT_CAP_SIZE,
> > [USB_SS_CAP_TYPE] = USB_DT_USB_SS_CAP_SIZE,
> > - [USB_SSP_CAP_TYPE] = USB_DT_USB_SSP_CAP_SIZE(1),
> > + [USB_SSP_CAP_TYPE] = USB_DT_USB_SSP_CAP_SIZE(0),
> > [CONTAINER_ID_TYPE] = USB_DT_USB_SS_CONTN_ID_SIZE,
> > [USB_PTM_CAP_TYPE] = USB_DT_USB_PTM_ID_SIZE,
> > };
> >
> > --
> > Masakazu Mokuno
>
> Patch is corrupted and can not be applied :(
I'm sorry. Tabs were expaned to white spaces. I'll resend fixed patch.
--
Masakazu Mokuno
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-01-11 15:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-19 18:14 [PATCH] USB: core: Fix misuse of USB_DT_USB_SSP_CAP_SIZE() Masakazu Mokuno
2018-01-09 15:06 ` Greg KH
2018-01-11 15:47 ` Masakazu Mokuno
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).