Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1958662yba; Sun, 7 Apr 2019 05:04:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqyzgq6k21ofh8Yq8NWgWaHQMR3JgFh7UeQIz33yglh4HTeeJS3DIMdwXzswYxBEkbtfuhyt X-Received: by 2002:a63:2747:: with SMTP id n68mr22694511pgn.317.1554638672179; Sun, 07 Apr 2019 05:04:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554638672; cv=none; d=google.com; s=arc-20160816; b=NxYF/EsmrKPc3rxuXwsAA0qddr5MS3AMKkWrxGKZF8gW2PcPBvjzE3gboUTWNucStP yela7eC7lMHqyjx0sxYiSs9I1NQJHc/YLhuelvwAfY/g25fGfCWd7LLBVhWRlZ5WmRcY UWaBwKZdbzVfQBgUp9yMDZiE5+A6U7FhBqhNOy/EBAMAjVlHmBLKvBTJaiuiqH9h+yPw o+2YU3JnGLr6/wJRdug8Ngkd4OqDgWjo8Rymtm8zzsEoYghW3muXZ7STvd6xI2BWRKLE 7FMW3UFSqaaUhY7cJrImxLXsamJay2kQ6IzJA2+n1BgEH2ENefXedYS+ctclTZvZiSOq xuHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=lkmXYLar/v1JEeEUpVH8S3sqtMCi/FETBe1YoitxlRg=; b=bdcb0SE37Y6gY+xQkjHYQDwKUUkVHI4N/S2YxhgRwmGXAk3pgtrHleIFPAfzooKbzA AfUNlNxinG+H1Du03OvWikqTnsWh6WTtC5MdBGFVx1MeJr7K9KS0WxYLz7jIf1w/kOCC Z7sSVxNLvsxVrFZTx0VH+PZTqa64Xk5dg7KR5KfDfppjABpLtS4uD3A3+Ok4BCvc2QPP Xf+bJqv7S1EAS+doxpIbGDdtjhE4F3kjZS/lmbgezvqz02tX2hA/9TSDFAAk0l+o1j6w wRzP076SLGe7yOijfYT2Xwoz6gLBKCwDO/ZXsaA8Rm1Rc9IktfP3rDiiOXc9FqCtJSCN rz/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n1si6803718pld.280.2019.04.07.05.04.16; Sun, 07 Apr 2019 05:04:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726487AbfDGMDU convert rfc822-to-8bit (ORCPT + 99 others); Sun, 7 Apr 2019 08:03:20 -0400 Received: from saturn.retrosnub.co.uk ([46.235.226.198]:34070 "EHLO saturn.retrosnub.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726049AbfDGMDU (ORCPT ); Sun, 7 Apr 2019 08:03:20 -0400 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) by saturn.retrosnub.co.uk (Postfix; Retrosnub mail submission) with ESMTPSA id 5BADD9E7522; Sun, 7 Apr 2019 13:03:18 +0100 (BST) Date: Sun, 7 Apr 2019 13:03:16 +0100 From: Jonathan Cameron To: Dan Murphy Cc: Vincent =?UTF-8?B?U3RlaGzDqQ==?= , , , Jonathan Cameron Subject: Re: [PATCH] iio: adc: ads124: avoid buffer overflow Message-ID: <20190407130316.2ff07791@archlinux> In-Reply-To: <20190407130242.6699b510@archlinux> References: <20190331185423.11749-1-vincent.stehle@laposte.net> <95d93ae2-1b7b-76fc-f72b-014a006f4c21@ti.com> <20190407130242.6699b510@archlinux> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 7 Apr 2019 13:02:42 +0100 Jonathan Cameron wrote: > On Mon, 1 Apr 2019 07:41:37 -0500 > Dan Murphy wrote: > > > On 3/31/19 1:54 PM, Vincent Stehlé wrote: > > > When initializing the priv->data array starting from index 1, there is one > > > less element to consider than when initializing the full array. > > > > > > Fixes: e717f8c6dfec8f76 ("iio: adc: Add the TI ads124s08 ADC code") > > > Signed-off-by: Vincent Stehlé > > > Cc: Dan Murphy > > > Cc: Jonathan Cameron > > > --- > > > drivers/iio/adc/ti-ads124s08.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/iio/adc/ti-ads124s08.c b/drivers/iio/adc/ti-ads124s08.c > > > index 53f17e4f2f230..552c2be8d87ad 100644 > > > --- a/drivers/iio/adc/ti-ads124s08.c > > > +++ b/drivers/iio/adc/ti-ads124s08.c > > > @@ -202,7 +202,7 @@ static int ads124s_read(struct iio_dev *indio_dev, unsigned int chan) > > > }; > > > > > > priv->data[0] = ADS124S08_CMD_RDATA; > > > - memset(&priv->data[1], ADS124S08_CMD_NOP, sizeof(priv->data)); > > > + memset(&priv->data[1], ADS124S08_CMD_NOP, sizeof(priv->data) - 1); > > > > > > ret = spi_sync_transfer(priv->spi, t, ARRAY_SIZE(t)); > > > if (ret < 0) > > > > > > > Reviewed-by: Dan Murphy > > Applied to the fixes-togreg branch of iio.git and pushed out as testing > for the autobuilders to play with it. Wrong finger memory. Not pushed out as testing. Pushed out as fixes-togreg! Jonathan > > Thanks, > > Jonathan