Re: [PATCH net] ptr_ring: prevent integer overflow when calculating size

From: David Miller
Date: Sun Feb 11 2018 - 22:34:59 EST


From: Jason Wang <jasowang@xxxxxxxxxx>
Date: Sun, 11 Feb 2018 11:28:12 +0800

> Switch to use dividing to prevent integer overflow when size is too
> big to calculate allocation size properly.
>
> Reported-by: Eric Biggers <ebiggers3@xxxxxxxxx>
> Fixes: 6e6e41c31122 ("ptr_ring: fail early if queue occupies more than KMALLOC_MAX_SIZE")
> Signed-off-by: Jason Wang <jasowang@xxxxxxxxxx>

Applied and queued up for -stable, thanks Jason.