linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Wim Van Sebroeck <wim@iguana.be>,
	linux-watchdog@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] watchdog: pcwd_usb: overflow in usb_pcwd_send_command()
Date: Thu, 7 Nov 2013 17:33:57 +0300	[thread overview]
Message-ID: <20131107143356.GP20521@mwanda> (raw)
In-Reply-To: <527BA351.10705@roeck-us.net>

On Thu, Nov 07, 2013 at 06:27:29AM -0800, Guenter Roeck wrote:
> 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 ?

Yeah.  Good eye.  I'll send a v2.

regards,
dan carpenter

  reply	other threads:[~2013-11-07 14:33 UTC|newest]

Thread overview: 8+ 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:47 ` Wim Van Sebroeck
2013-11-07 14:27 ` Guenter Roeck
2013-11-07 14:33   ` Dan Carpenter [this message]
2013-11-08  9:24   ` [patch v2] " Dan Carpenter
2013-11-08 14:24     ` Guenter Roeck
2013-11-11 16:00     ` Guenter Roeck
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=20131107143356.GP20521@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --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 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).