linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sound: usb/quirks, fix out-of-bounds access
@ 2013-02-17 13:33 Jiri Slaby
  2013-02-17 17:02 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Slaby @ 2013-02-17 13:33 UTC (permalink / raw)
  To: tiwai; +Cc: perex, jirislaby, linux-kernel, Damien Zammit

bootresponse in snd_usb_mbox2_boot_quirk is only 12 (decimal) u8's
long, but i9s passed to snd_usb_ctl_msg as it would be 0x12 (hexa)
long. Fix that by having proper size of the array, i.e. 0x12.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Damien Zammit <damien@zamaudio.com>
Cc: Takashi Iwai <tiwai@suse.de>
---
 sound/usb/quirks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index 2c97185..0115289 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -533,7 +533,7 @@ static int snd_usb_mbox2_boot_quirk(struct usb_device *dev)
 {
 	struct usb_host_config *config = dev->actconfig;
 	int err;
-	u8 bootresponse[12];
+	u8 bootresponse[0x12];
 	int fwsize;
 	int count;
 
-- 
1.8.1.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] sound: usb/quirks, fix out-of-bounds access
  2013-02-17 13:33 [PATCH] sound: usb/quirks, fix out-of-bounds access Jiri Slaby
@ 2013-02-17 17:02 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2013-02-17 17:02 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: perex, jirislaby, linux-kernel, Damien Zammit

At Sun, 17 Feb 2013 14:33:04 +0100,
Jiri Slaby wrote:
> 
> bootresponse in snd_usb_mbox2_boot_quirk is only 12 (decimal) u8's
> long, but i9s passed to snd_usb_ctl_msg as it would be 0x12 (hexa)
> long. Fix that by having proper size of the array, i.e. 0x12.
> 
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> Cc: Damien Zammit <damien@zamaudio.com>
> Cc: Takashi Iwai <tiwai@suse.de>

A good catch.  Applied now.  Thanks!


Takashi

> ---
>  sound/usb/quirks.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
> index 2c97185..0115289 100644
> --- a/sound/usb/quirks.c
> +++ b/sound/usb/quirks.c
> @@ -533,7 +533,7 @@ static int snd_usb_mbox2_boot_quirk(struct usb_device *dev)
>  {
>  	struct usb_host_config *config = dev->actconfig;
>  	int err;
> -	u8 bootresponse[12];
> +	u8 bootresponse[0x12];
>  	int fwsize;
>  	int count;
>  
> -- 
> 1.8.1.2
> 
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-02-17 17:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-17 13:33 [PATCH] sound: usb/quirks, fix out-of-bounds access Jiri Slaby
2013-02-17 17:02 ` Takashi Iwai

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).