From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66B5F4219EE; Wed, 20 May 2026 18:45:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779302739; cv=none; b=SVjptIBjcoI4AeGmSMMHm7hA268q+2Nl7rHT64G6ET1b+2K2nZ3vJXHC6T+C4IqnvAgF/e/TRkUAU1lxPG0BZijCwGzCmO1t8L77hIPU5bWsxXEbjLGR5ItD6FqpLQsWTceQjF/v8DJrknIRFoZ2s/aGSOsDgPB/78oU0sFXkr4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779302739; c=relaxed/simple; bh=433LdXqElNnUi9pjcks0kINgTuZCBANp4/gjNufgQdI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f6LD0v5OBtZt710zjbw4jdzM1Op5DTFuaRt+AfMCyydI8i/52hDdrzR7AaTcxEM+a+OMOBlUo8llpyJIC8yqUW4F/7KZhEvM9b+ZbBNLhXu8pJSyR4z2mpLGgPkErqGJenmhb14O/hmepQ6YNn4BdJ10WQw8iyQkE+RyxfhZMgE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=FB/wbabn; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="FB/wbabn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A89E81F000E9; Wed, 20 May 2026 18:45:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779302738; bh=NOTjhjThPM59dEBGud26FOkoh+fip3F8TMnKV6Rglkk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=FB/wbabnoq76fhPM731VL7b+5mWRo4mQYT9gyQ6W9U1yGcxE1T18bBBeVzSAQZf0i dSPv3vOY3nNgqk3JguKbXRBI8X4YDfwM4UtPhnS6itgTyASt4PCuGSgNFGqEddVwUY 7lxvisDK0NH0+4dzWPOQrHifW/KwyrMt1B0LftRs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "Nikola Z. Ivanov" , Eric Dumazet , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.6 380/508] netdevsim: zero initialize struct iphdr in dummy sk_buff Date: Wed, 20 May 2026 18:23:23 +0200 Message-ID: <20260520162106.856143056@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260520162058.573354582@linuxfoundation.org> References: <20260520162058.573354582@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nikola Z. Ivanov [ Upstream commit 35eaa6d8d6c2ee65e96f507add856e0eacf24591 ] Syzbot reports a KMSAN uninit-value originating from nsim_dev_trap_skb_build, with the allocation also being performed in the same function. Fix this by calling skb_put_zero instead of skb_put to guarantee zero initialization of the whole IP header. Closes: https://syzkaller.appspot.com/bug?extid=23d7fcd204e3837866ff Fixes: da58f90f11f5 ("netdevsim: Add devlink-trap support") Signed-off-by: Nikola Z. Ivanov Reviewed-by: Eric Dumazet Link: https://patch.msgid.link/20260426201434.742030-1-zlatistiv@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/netdevsim/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/netdevsim/dev.c b/drivers/net/netdevsim/dev.c index 2614d6509954c..daec92570c2e3 100644 --- a/drivers/net/netdevsim/dev.c +++ b/drivers/net/netdevsim/dev.c @@ -758,7 +758,7 @@ static struct sk_buff *nsim_dev_trap_skb_build(void) skb->protocol = htons(ETH_P_IP); skb_set_network_header(skb, skb->len); - iph = skb_put(skb, sizeof(struct iphdr)); + iph = skb_put_zero(skb, sizeof(struct iphdr)); iph->protocol = IPPROTO_UDP; iph->saddr = in_aton("192.0.2.1"); iph->daddr = in_aton("198.51.100.1"); -- 2.53.0