Subject: Re: KASAN: slab-out-of-bounds Read in bitmap_port_destroy

From: Dan Carpenter <[email-masked]>
Date: Fri, 24 Jan 2020 12:11:44 +0300

On Fri, Jan 24, 2020 at 04:55:21PM +0800, Hillf Danton wrote:
> Ensure four bytes and ask slab to do the rest.
> 
> --- a/include/linux/netfilter/ipset/ip_set.h
> +++ b/include/linux/netfilter/ipset/ip_set.h
> @@ -430,7 +430,7 @@ ip6addrptr(const struct sk_buff *skb, bo
>  static inline int
>  bitmap_bytes(u32 a, u32 b)
>  {
> -	return 4 * ((((b - a + 8) / 8) + 3) / 4);
> +	return 4 + (b - a) / 8;
>  }
>  

Thanks, but this was already fixed by:

https://lore.kernel.org/netfilter-devel/[email-masked]/

regards,
dan carpenter