Thread (1 message) 1 message, 1 author, 2020-01-24

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

From: Dan Carpenter <hidden>
Date: 2020-01-24 09:12:32
Also in: lkml, netfilter-devel

On Fri, Jan 24, 2020 at 04:55:21PM +0800, Hillf Danton wrote:
quoted hunk
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/alpine.DEB.2.20.2001192203200.18095@blackhole.kfki.hu/ (local)

regards,
dan carpenter
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help