Forwarded: [PATCH net] net/core : fix KMSAN: uninit value in tipc_rcv

syzbot posted 1 patch 1 week, 5 days ago
net/core/skbuff.c | 1 +
1 file changed, 1 insertion(+)
Forwarded: [PATCH net] net/core : fix KMSAN: uninit value in tipc_rcv
Posted by syzbot 1 week, 5 days ago
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.

***

Subject: [PATCH net] net/core : fix KMSAN: uninit value in tipc_rcv
Author: hariconscious@gmail.com

From: HariKrishna Sagala <hariconscious@gmail.com>

syzbot KMSAN points to the unint value in the socket buffer creation.
In the skbuff.c, kmalloc_reserve API takes gfp flags option, appended the
flag "GFP_ZERO" to the existing flags to get the zeroed buffer.

Reported-by:syzbot+9a4fbb77c9d4aacd3388@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=9a4fbb77c9d4aacd3388
Signed-off-by: HariKrishna Sagala <hariconscious@gmail.com>
---

#syz test

 net/core/skbuff.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index ee0274417948..2308ebf99bbd 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -573,6 +573,7 @@ static void *kmalloc_reserve(unsigned int *size, gfp_t flags, int node,
 	void *obj;
 
 	obj_size = SKB_HEAD_ALIGN(*size);
+	flags |= __GFP_ZERO;
 	if (obj_size <= SKB_SMALL_HEAD_CACHE_SIZE &&
 	    !(flags & KMALLOC_NOT_NORMAL_BITS)) {
 		obj = kmem_cache_alloc_node(net_hotdata.skb_small_head_cache,
-- 
2.43.0