From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:47490 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751708AbeGALiD (ORCPT ); Sun, 1 Jul 2018 07:38:03 -0400 Date: Sun, 1 Jul 2018 13:37:59 +0200 From: Greg Kroah-Hartman To: Ben Hutchings Cc: stable@vger.kernel.org, Martin Kelly , Jonathan Cameron Subject: Re: [PATCH 4.9] iio:buffer: make length types match kfifo types Message-ID: <20180701113759.GE21328@kroah.com> References: <20180618195827.c3jeeee265odla3g@xylophone.i.decadent.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180618195827.c3jeeee265odla3g@xylophone.i.decadent.org.uk> Sender: stable-owner@vger.kernel.org List-ID: On Mon, Jun 18, 2018 at 08:58:27PM +0100, Ben Hutchings wrote: > From: Martin Kelly > > commit c043ec1ca5baae63726aae32abbe003192bc6eec upstream. > > Currently, we use int for buffer length and bytes_per_datum. However, > kfifo uses unsigned int for length and size_t for element size. We need > to make sure these matches or we will have bugs related to overflow (in > the range between INT_MAX and UINT_MAX for length, for example). > > In addition, set_bytes_per_datum uses size_t while bytes_per_datum is an > int, which would cause bugs for large values of bytes_per_datum. > > Change buffer length to use unsigned int and bytes_per_datum to use > size_t. > > Signed-off-by: Martin Kelly > Signed-off-by: Jonathan Cameron > [bwh: Backported to 4.9: > - Drop change to iio_dma_buffer_set_length() > - Adjust filename, context] > Signed-off-by: Ben Hutchings > --- > drivers/iio/buffer/kfifo_buf.c | 4 ++-- > include/linux/iio/buffer.h | 6 +++--- > 2 files changed, 5 insertions(+), 5 deletions(-) Thanks for this and the 4.4 backport, now queued up. greg k-h