Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1957967yba; Sun, 7 Apr 2019 05:03:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqwmUcT5RUq8r/z9csNpQq6ggh4kUAUM6UTb0EDgiELa6oMbZMODjs/K1qx9F20XkYej9NQA X-Received: by 2002:a17:902:7785:: with SMTP id o5mr24255585pll.33.1554638625155; Sun, 07 Apr 2019 05:03:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554638625; cv=none; d=google.com; s=arc-20160816; b=eDQ5IkQdjY22WBFKLpCsYDSzR6t0P2U99I7U4nnTnMYbQm89SL7VtendT3EZNygcHF 0UzDELBGxFmP1RYGJtQL0FvBa/fEPhGaCkFCH9FB9kLCeKdxHqVuEsbThTyNgyKaUe24 OdRQ2NL+oxxlhSQFeV+jrak7b1/oLLBUwjJynZyMSUVk2uImQ2Wfd8Q0cjLpTJGSYHJG RDPFb5T89rOU02tm7JvdOorSvWZXXW2A+/vl4L/mo254+86iuSTRj5CHjJjW+DMbh2E2 gtxw9+7CW6yOQl+3MIAP+2fNvG0tw2JhzcqLA8LxVjDJZ5F80YH/XGE4+nnpddJOtrLb 6g0A== 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=3g68nY26fjyFh2A0l3hpeP/NfLNnuOvIgdCn1XDeoiA=; b=NSggR4NDPqJC4XaBv/s64sFUOZeYrHMF0FzJuywAATYh/k8teIEiqX3MI34urjAog7 IOHSlbFtpL3iCI9Ef9MPvPSBEYJ3NFEmBGlnB36PvsxS41q+d+cG6g09Wx3O67/lpjYG xtPZqIHTBJkDx/WDzl4UJ8EXIwMZfVZI4u5agbNkH7XWusDiV6wOg7q9uEQiEf2I/Vg0 KZvBJuVKT5fyckfBg0WB6cx9DunRmUQI/UjNI2R6aGSfsMOAwLeoSgNvmGoO5vCkk8ch lgv8LF4IPM2+Tvl9yE0f/xMIN5pIxjtJxNS0JuT9GGVzYijCiShOs9/mpXezNsbCoUac jahA== 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 p8si23470051plq.225.2019.04.07.05.03.27; Sun, 07 Apr 2019 05:03:45 -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 S1726396AbfDGMCr convert rfc822-to-8bit (ORCPT + 99 others); Sun, 7 Apr 2019 08:02:47 -0400 Received: from saturn.retrosnub.co.uk ([46.235.226.198]:34066 "EHLO saturn.retrosnub.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726049AbfDGMCq (ORCPT ); Sun, 7 Apr 2019 08:02:46 -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 6F3269E7723; Sun, 7 Apr 2019 13:02:44 +0100 (BST) Date: Sun, 7 Apr 2019 13:02:42 +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: <20190407130242.6699b510@archlinux> In-Reply-To: <95d93ae2-1b7b-76fc-f72b-014a006f4c21@ti.com> References: <20190331185423.11749-1-vincent.stehle@laposte.net> <95d93ae2-1b7b-76fc-f72b-014a006f4c21@ti.com> 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 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. Thanks, Jonathan