* [PATCH] sound/pci/asihpi: check adapter index in hpi_ioctl
@ 2011-03-17 22:32 Dan Rosenberg
2011-03-17 22:54 ` [stable] " Greg KH
2011-03-18 6:55 ` Takashi Iwai
0 siblings, 2 replies; 3+ messages in thread
From: Dan Rosenberg @ 2011-03-17 22:32 UTC (permalink / raw)
To: Jaroslav Kysela, Takashi Iwai; +Cc: security, stable, linux-kernel
The user-supplied index into the adapters array needs to be checked, or
an out-of-bounds kernel pointer could be accessed and used, leading to
potentially exploitable memory corruption.
Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
---
sound/pci/asihpi/hpioctl.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/sound/pci/asihpi/hpioctl.c b/sound/pci/asihpi/hpioctl.c
index 22dbd91..448dd01 100644
--- a/sound/pci/asihpi/hpioctl.c
+++ b/sound/pci/asihpi/hpioctl.c
@@ -155,6 +155,11 @@ long asihpi_hpi_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
goto out;
}
+ if (hm->h.adapter_index >= HPI_MAX_ADAPTERS) {
+ err = -EINVAL;
+ goto out;
+ }
+
pa = &adapters[hm->h.adapter_index];
hr->h.size = 0;
if (hm->h.object == HPI_OBJ_SUBSYSTEM) {
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [stable] [PATCH] sound/pci/asihpi: check adapter index in hpi_ioctl
2011-03-17 22:32 [PATCH] sound/pci/asihpi: check adapter index in hpi_ioctl Dan Rosenberg
@ 2011-03-17 22:54 ` Greg KH
2011-03-18 6:55 ` Takashi Iwai
1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2011-03-17 22:54 UTC (permalink / raw)
To: Dan Rosenberg
Cc: Jaroslav Kysela, Takashi Iwai, security, stable, linux-kernel
On Thu, Mar 17, 2011 at 06:32:24PM -0400, Dan Rosenberg wrote:
> The user-supplied index into the adapters array needs to be checked, or
> an out-of-bounds kernel pointer could be accessed and used, leading to
> potentially exploitable memory corruption.
>
> Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
> ---
> sound/pci/asihpi/hpioctl.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
<formletter>
This is not the correct way to submit patches for inclusion in the
stable kernel tree. Please read Documentation/stable_kernel_rules.txt
for how to do this properly.
</formletter>
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] sound/pci/asihpi: check adapter index in hpi_ioctl
2011-03-17 22:32 [PATCH] sound/pci/asihpi: check adapter index in hpi_ioctl Dan Rosenberg
2011-03-17 22:54 ` [stable] " Greg KH
@ 2011-03-18 6:55 ` Takashi Iwai
1 sibling, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2011-03-18 6:55 UTC (permalink / raw)
To: Dan Rosenberg; +Cc: Jaroslav Kysela, security, linux-kernel
At Thu, 17 Mar 2011 18:32:24 -0400,
Dan Rosenberg wrote:
>
> The user-supplied index into the adapters array needs to be checked, or
> an out-of-bounds kernel pointer could be accessed and used, leading to
> potentially exploitable memory corruption.
>
> Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
Applied now (with Cc to stable kernel). Thanks.
Takashi
> ---
> sound/pci/asihpi/hpioctl.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/sound/pci/asihpi/hpioctl.c b/sound/pci/asihpi/hpioctl.c
> index 22dbd91..448dd01 100644
> --- a/sound/pci/asihpi/hpioctl.c
> +++ b/sound/pci/asihpi/hpioctl.c
> @@ -155,6 +155,11 @@ long asihpi_hpi_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
> goto out;
> }
>
> + if (hm->h.adapter_index >= HPI_MAX_ADAPTERS) {
> + err = -EINVAL;
> + goto out;
> + }
> +
> pa = &adapters[hm->h.adapter_index];
> hr->h.size = 0;
> if (hm->h.object == HPI_OBJ_SUBSYSTEM) {
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-03-18 6:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-17 22:32 [PATCH] sound/pci/asihpi: check adapter index in hpi_ioctl Dan Rosenberg
2011-03-17 22:54 ` [stable] " Greg KH
2011-03-18 6:55 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox