All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antti Palosaari <crope@iki.fi>
To: Gianluca Gennari <gennarone@gmail.com>
Cc: linux-media@vger.kernel.org, mchehab@redhat.com, mkrufky@linuxtv.org
Subject: Re: [PATCH v2] rtl28xxu: fix buffer overflow when probing Rafael Micro r820t tuner
Date: Mon, 03 Jun 2013 00:32:44 +0300	[thread overview]
Message-ID: <51ABB9FC.6000601@iki.fi> (raw)
In-Reply-To: <1370208264-10276-1-git-send-email-gennarone@gmail.com>

On 06/03/2013 12:24 AM, Gianluca Gennari wrote:
> As suggested by Antti, this patch replaces:
> https://patchwork.kernel.org/patch/2649861/
>
> The buffer overflow is fixed by reading only the r820t ID register.
>
> Signed-off-by: Gianluca Gennari <gennarone@gmail.com>

Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>

> ---
>   drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
> index 22015fe..2cc8ec7 100644
> --- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
> +++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
> @@ -376,7 +376,7 @@ static int rtl2832u_read_config(struct dvb_usb_device *d)
>   	struct rtl28xxu_req req_mxl5007t = {0xd9c0, CMD_I2C_RD, 1, buf};
>   	struct rtl28xxu_req req_e4000 = {0x02c8, CMD_I2C_RD, 1, buf};
>   	struct rtl28xxu_req req_tda18272 = {0x00c0, CMD_I2C_RD, 2, buf};
> -	struct rtl28xxu_req req_r820t = {0x0034, CMD_I2C_RD, 5, buf};
> +	struct rtl28xxu_req req_r820t = {0x0034, CMD_I2C_RD, 1, buf};
>
>   	dev_dbg(&d->udev->dev, "%s:\n", __func__);
>
> @@ -481,9 +481,9 @@ static int rtl2832u_read_config(struct dvb_usb_device *d)
>   		goto found;
>   	}
>
> -	/* check R820T by reading tuner stats at I2C addr 0x1a */
> +	/* check R820T ID register; reg=00 val=69 */
>   	ret = rtl28xxu_ctrl_msg(d, &req_r820t);
> -	if (ret == 0) {
> +	if (ret == 0 && buf[0] == 0x69) {
>   		priv->tuner = TUNER_RTL2832_R820T;
>   		priv->tuner_name = "R820T";
>   		goto found;
>


-- 
http://palosaari.fi/

      reply	other threads:[~2013-06-02 21:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-02 21:24 [PATCH v2] rtl28xxu: fix buffer overflow when probing Rafael Micro r820t tuner Gianluca Gennari
2013-06-02 21:32 ` Antti Palosaari [this message]

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=51ABB9FC.6000601@iki.fi \
    --to=crope@iki.fi \
    --cc=gennarone@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.com \
    --cc=mkrufky@linuxtv.org \
    /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.