linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Changming Liu <charley.ashbringer@gmail.com>
Cc: linux-usb@vger.kernel.org, thomas@winischhofer.net
Subject: Re: [PATCH 3/4] USB: sisusbvga: change the buffer in sisusb_recv_bulk_msg from char to u8
Date: Sat, 27 Jun 2020 13:30:04 +0200	[thread overview]
Message-ID: <20200627113004.GC1596272@kroah.com> (raw)
In-Reply-To: <1593200057-245-4-git-send-email-charley.ashbringer@gmail.com>

On Fri, Jun 26, 2020 at 03:34:16PM -0400, Changming Liu wrote:
> This patch changes the userbuffer of sisusb_recv_bulk_msg from char to u8
> to avoid related UB.
> 
> Also, for kernbuffer declared as void* in the function header, force cast 
> the passed-in parameters from char* to u8*.
> 
> Signed-off-by: Changming Liu <charley.ashbringer@gmail.com>
> ---
>  drivers/usb/misc/sisusbvga/sisusb.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c
> index 8878c28..86638c1 100644
> --- a/drivers/usb/misc/sisusbvga/sisusb.c
> +++ b/drivers/usb/misc/sisusbvga/sisusb.c
> @@ -448,7 +448,7 @@ static int sisusb_send_bulk_msg(struct sisusb_usb_data *sisusb, int ep, int len,
>   */
>  
>  static int sisusb_recv_bulk_msg(struct sisusb_usb_data *sisusb, int ep, int len,
> -		void *kernbuffer, char __user *userbuffer, ssize_t *bytes_read,
> +		void *kernbuffer, u8 __user *userbuffer, ssize_t *bytes_read,

Same as before, I do not think you need to change these, do you?

thanks,

greg k-h

  reply	other threads:[~2020-06-27 11:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-26 19:34 [PATCH 0/4] USB: sisusbvga: cleaning up char buffers to u8 buffer Changming Liu
2020-06-26 19:34 ` [PATCH 1/4] USB: sisusbvga: change the char buffer from char to u8 for sisusb_write_mem_bulk and sisusb_send_bulk_msg Changming Liu
2020-06-27 11:28   ` Greg KH
2020-07-10  5:23     ` charley.ashbringer
2020-06-26 19:34 ` [PATCH 2/4] USB: sisusbvga: change the buffer members in sisusb_usb_data from char to u8 Changming Liu
2020-06-27 11:29   ` Greg KH
2020-06-26 19:34 ` [PATCH 3/4] USB: sisusbvga: change the buffer in sisusb_recv_bulk_msg " Changming Liu
2020-06-27 11:30   ` Greg KH [this message]
2020-06-26 19:34 ` [PATCH 4/4] USB: sisusbvga: change the buffers in sisusb_read_mem_bulk " Changming Liu

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=20200627113004.GC1596272@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=charley.ashbringer@gmail.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=thomas@winischhofer.net \
    /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).