Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Eliot Blennerhassett <eliot@blennerhassett.gen.nz>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
	Jaroslav Kysela <perex@perex.cz>,
	alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] ALSA: asihpi: fix an information leak in asihpi_hpi_ioctl()
Date: Wed, 31 Dec 2014 09:40:00 +0100	[thread overview]
Message-ID: <s5hoaqkgqlb.wl-tiwai@suse.de> (raw)
In-Reply-To: <54A3972B.5010703@blennerhassett.gen.nz>

At Wed, 31 Dec 2014 19:26:51 +1300,
Eliot Blennerhassett wrote:
> 
> Add missing limits to keep copied data within allocated buffer.
> 
> Signed-off-by: Eliot Blennerhassett <eliot@blennerhassett.gen.nz>

hpi6000.c changes can't be applied.  I guess it's for your development
branch?

Please split and send the currently applicable one (for hpioctl.c) for
merging to 3.19-rc kernel, and include the rest to the next update
batch.


thanks,

Takashi

> ---
>  sound/pci/asihpi/hpi6000.c | 6 +++++-
>  sound/pci/asihpi/hpioctl.c | 2 ++
>  2 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/pci/asihpi/hpi6000.c b/sound/pci/asihpi/hpi6000.c
> index e0c6715..794df30 100644
> --- a/sound/pci/asihpi/hpi6000.c
> +++ b/sound/pci/asihpi/hpi6000.c
> @@ -46,6 +46,7 @@
>  
>  /* operational/messaging errors */
>  #define HPI6000_ERROR_MSG_RESP_IDLE_TIMEOUT		901
> +#define HPI6000_ERROR_RESP_GET_LEN			902
>  #define HPI6000_ERROR_MSG_RESP_GET_RESP_ACK		903
>  #define HPI6000_ERROR_MSG_GET_ADR			904
>  #define HPI6000_ERROR_RESP_GET_ADR			905
> @@ -1363,7 +1364,10 @@ static short hpi6000_message_response_sequence(struct hpi_adapter_obj *pao,
>  		length = hpi_read_word(pdo, HPI_HIF_ADDR(length));
>  	} while (hpi6000_check_PCI2040_error_flag(pao, H6READ) && --timeout);
>  	if (!timeout)
> -		length = sizeof(struct hpi_response);
> +		return HPI6000_ERROR_RESP_GET_LEN;
> +
> +	if (length > phr->size)
> +		return HPI_ERROR_RESPONSE_BUFFER_TOO_SMALL;
>  
>  	/* get the response */
>  	p_data = (u32 *)phr;
> diff --git a/sound/pci/asihpi/hpioctl.c b/sound/pci/asihpi/hpioctl.c
> index 6aa677e..72af66b 100644
> --- a/sound/pci/asihpi/hpioctl.c
> +++ b/sound/pci/asihpi/hpioctl.c
> @@ -153,6 +153,8 @@ long asihpi_hpi_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
>  		goto out;
>  	}
>  
> +	res_max_size = min_t(size_t, res_max_size, sizeof(*hr));
> +
>  	switch (hm->h.function) {
>  	case HPI_SUBSYS_CREATE_ADAPTER:
>  	case HPI_ADAPTER_DELETE:
> -- 
> 1.9.1
> 
> 

  reply	other threads:[~2014-12-31  8:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-22  7:49 [patch] ALSA: asihpi: fix an information leak in asihpi_hpi_ioctl() Dan Carpenter
2014-12-26 11:07 ` Takashi Iwai
2014-12-30  8:07   ` Eliot Blennerhassett
2014-12-31  6:26     ` Eliot Blennerhassett
2014-12-31  8:40       ` Takashi Iwai [this message]
     [not found]         ` <54A3D480.8050104@blennerhassett.gen.nz>
2014-12-31 13:17           ` [patch v2] " Takashi Iwai
2015-01-05  9:33       ` [patch] " Dan Carpenter
2015-01-05  9:34         ` Takashi Iwai

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=s5hoaqkgqlb.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=dan.carpenter@oracle.com \
    --cc=eliot@blennerhassett.gen.nz \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=perex@perex.cz \
    /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