Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932094Ab1CRGzQ (ORCPT ); Fri, 18 Mar 2011 02:55:16 -0400 Received: from cantor.suse.de ([195.135.220.2]:33978 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752742Ab1CRGzL (ORCPT ); Fri, 18 Mar 2011 02:55:11 -0400 Date: Fri, 18 Mar 2011 07:55:09 +0100 Message-ID: From: Takashi Iwai To: Dan Rosenberg Cc: Jaroslav Kysela , security@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] sound/pci/asihpi: check adapter index in hpi_ioctl In-Reply-To: <1300401144.1796.4.camel@dan> References: <1300401144.1796.4.camel@dan> User-Agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.7 Emacs/23.2 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1230 Lines: 41 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 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) { > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/