From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vinod Koul Subject: Re: [PATCH] amixer: add support for TLV byte control read Date: Fri, 29 Jan 2016 19:23:44 +0530 Message-ID: <20160129135343.GV11130@localhost> References: <20160127174749.GB11130@localhost> <20160128042509.GC11130@localhost> <20160128092644.GJ11130@localhost> <20160129065106.GS11130@localhost> <20160129111347.GT11130@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by alsa0.perex.cz (Postfix) with ESMTP id 4626B260504 for ; Fri, 29 Jan 2016 14:49:51 +0100 (CET) Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Takashi Iwai Cc: liam.r.girdwood@linux.intel.com, patches.audio@intel.com, alsa-devel@alsa-project.org, broonie@kernel.org List-Id: alsa-devel@alsa-project.org On Fri, Jan 29, 2016 at 02:17:20PM +0100, Takashi Iwai wrote: > > with this change it works and dumps 4K bytes on my screen > > > > @@ -913,6 +913,13 @@ static int skl_tplg_tlv_control_get(struct snd_kcontrol > > *kcontrol, > > skl_get_module_params(skl->skl_sst, (u32 *)bc->params, > > bc->max, bc->param_id, mconfig); > > > > + /* decrement size for TLV header */ > > + size -= 2 * sizeof(u32); > > The lower bound check is also missing. > > if (size < 2 * sizeof(u32)) > return -EINVAL; I thought core and lib do check this, but yes no harm in adding will do so Thanks -- ~Vinod