All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Ben Hutchings <ben.hutchings@codethink.co.uk>
Cc: stable@vger.kernel.org, Martin Kelly <mkelly@xevo.com>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCH 4.9] iio:buffer: make length types match kfifo types
Date: Sun, 1 Jul 2018 13:37:59 +0200	[thread overview]
Message-ID: <20180701113759.GE21328@kroah.com> (raw)
In-Reply-To: <20180618195827.c3jeeee265odla3g@xylophone.i.decadent.org.uk>

On Mon, Jun 18, 2018 at 08:58:27PM +0100, Ben Hutchings wrote:
> From: Martin Kelly <mkelly@xevo.com>
> 
> 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 <mkelly@xevo.com>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> [bwh: Backported to 4.9:
>  - Drop change to iio_dma_buffer_set_length()
>  - Adjust filename, context]
> Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
> ---
>  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

      reply	other threads:[~2018-07-01 11:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-18 19:58 [PATCH 4.9] iio:buffer: make length types match kfifo types Ben Hutchings
2018-07-01 11:37 ` Greg Kroah-Hartman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180701113759.GE21328@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=ben.hutchings@codethink.co.uk \
    --cc=mkelly@xevo.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.