From: Guenter Roeck <linux@roeck-us.net>
To: Dan Carpenter <dan.carpenter@oracle.com>,
Wim Van Sebroeck <wim@iguana.be>
Cc: linux-watchdog@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] watchdog: pcwd_usb: overflow in usb_pcwd_send_command()
Date: Thu, 07 Nov 2013 14:27:29 +0000 [thread overview]
Message-ID: <527BA351.10705@roeck-us.net> (raw)
In-Reply-To: <20131107074028.GA21844@elgon.mountain>
On 11/06/2013 11:40 PM, Dan Carpenter wrote:
> We changed "buf" from being an array of 6 chars to being a pointer this
> sizeof(buf) needs to be updated as well.
>
oops ...
> Fixes: 2ddb8089a7e5 ('watchdog: pcwd_usb: Use allocated buffer for usb_control_msg')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/watchdog/pcwd_usb.c b/drivers/watchdog/pcwd_usb.c
> index 53598e8..7031b9b 100644
> --- a/drivers/watchdog/pcwd_usb.c
> +++ b/drivers/watchdog/pcwd_usb.c
> @@ -258,7 +258,7 @@ static int usb_pcwd_send_command(struct usb_pcwd_private *usb_pcwd,
>
> if (usb_control_msg(usb_pcwd->udev, usb_sndctrlpipe(usb_pcwd->udev, 0),
> HID_REQ_SET_REPORT, HID_DT_REPORT,
> - 0x0200, usb_pcwd->interface_number, buf, sizeof(buf),
> + 0x0200, usb_pcwd->interface_number, buf, 6,
> USB_COMMAND_TIMEOUT) != sizeof(buf)) {
Doesn't it have to be fixed here as well ?
Thanks,
Guenter
> dbg("usb_pcwd_send_command: error in usb_control_msg for "
> "cmd 0x%x 0x%x 0x%x\n", cmd, *msb, *lsb);
> --
> To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
WARNING: multiple messages have this Message-ID (diff)
From: Guenter Roeck <linux@roeck-us.net>
To: Dan Carpenter <dan.carpenter@oracle.com>,
Wim Van Sebroeck <wim@iguana.be>
Cc: linux-watchdog@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] watchdog: pcwd_usb: overflow in usb_pcwd_send_command()
Date: Thu, 07 Nov 2013 06:27:29 -0800 [thread overview]
Message-ID: <527BA351.10705@roeck-us.net> (raw)
In-Reply-To: <20131107074028.GA21844@elgon.mountain>
On 11/06/2013 11:40 PM, Dan Carpenter wrote:
> We changed "buf" from being an array of 6 chars to being a pointer this
> sizeof(buf) needs to be updated as well.
>
oops ...
> Fixes: 2ddb8089a7e5 ('watchdog: pcwd_usb: Use allocated buffer for usb_control_msg')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/watchdog/pcwd_usb.c b/drivers/watchdog/pcwd_usb.c
> index 53598e8..7031b9b 100644
> --- a/drivers/watchdog/pcwd_usb.c
> +++ b/drivers/watchdog/pcwd_usb.c
> @@ -258,7 +258,7 @@ static int usb_pcwd_send_command(struct usb_pcwd_private *usb_pcwd,
>
> if (usb_control_msg(usb_pcwd->udev, usb_sndctrlpipe(usb_pcwd->udev, 0),
> HID_REQ_SET_REPORT, HID_DT_REPORT,
> - 0x0200, usb_pcwd->interface_number, buf, sizeof(buf),
> + 0x0200, usb_pcwd->interface_number, buf, 6,
> USB_COMMAND_TIMEOUT) != sizeof(buf)) {
Doesn't it have to be fixed here as well ?
Thanks,
Guenter
> dbg("usb_pcwd_send_command: error in usb_control_msg for "
> "cmd 0x%x 0x%x 0x%x\n", cmd, *msb, *lsb);
> --
> To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
next prev parent reply other threads:[~2013-11-07 14:27 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-07 7:40 [patch] watchdog: pcwd_usb: overflow in usb_pcwd_send_command() Dan Carpenter
2013-11-07 7:40 ` Dan Carpenter
2013-11-07 7:47 ` Wim Van Sebroeck
2013-11-07 7:47 ` Wim Van Sebroeck
2013-11-07 14:27 ` Guenter Roeck [this message]
2013-11-07 14:27 ` Guenter Roeck
2013-11-07 14:33 ` Dan Carpenter
2013-11-07 14:33 ` Dan Carpenter
2013-11-08 9:24 ` [patch v2] " Dan Carpenter
2013-11-08 9:24 ` Dan Carpenter
2013-11-08 14:24 ` Guenter Roeck
2013-11-08 14:24 ` Guenter Roeck
2013-11-11 16:00 ` Guenter Roeck
2013-11-11 16:00 ` Guenter Roeck
2013-11-17 19:06 ` Wim Van Sebroeck
2013-11-17 19:06 ` Wim Van Sebroeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=527BA351.10705@roeck-us.net \
--to=linux@roeck-us.net \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=wim@iguana.be \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.