Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp287326pxb; Sat, 10 Apr 2021 02:53:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDJSh6K81wx7giaEweZ2d302KqzPUFSI7pytVc95+w0q2vV+e/dMEhJg8HixNg/2J8cKEg X-Received: by 2002:aa7:d2cc:: with SMTP id k12mr20727542edr.374.1618048386194; Sat, 10 Apr 2021 02:53:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618048386; cv=none; d=google.com; s=arc-20160816; b=fOHkqvj+IhmdtQoSu7Nd53G8oNGiyqT5/nwk6Ml9JYOrTbcS5XineT0ISVteFwxAVu 6FJv4c40Qclc2uJX37nwceB1ix+NbuH96oJYaJSTWSu50/v+bbRuCmpk2fNryCwAEEX/ UKebHym10UaKSXYCYSoQoKt6vc65BEUQHh1K4wbmw/NIxHg+EVptyr/IJ1vrO28UCI6V a7F8DsoX2EycNruKPR+G7UeTydlYK/AA3N/tGsok0DpEhdkrT6awh8flb3xIOimlcoRE zxlXZj54Bm00tQ6V+cSwv6Cf7MyA+U0IGlMhcypjH7QG0JpRdoppKTjJB62QZYgntFMO Yazw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=15ioqRn6Fo545fxwUFF9JCSdykE1utM0Wbzea0PS/lI=; b=i1/kb7Q4jtsvUPPG8Syj8K3oR3Mo5Oze2KJ6fJLG6FDI0V7reBj+4sHANMUPQKsd2k XcEGuuHMNgXIpPBkoNQhXvM8rSm6wklMH9KCgvHBQRrv+SV4NLUpQUyGjYw0w7d74ewT 6iKE/KS//IkKTLgYeCdOohFLBWQFbWbJ1bOA9iORBM2kSKH8lXz/jWUG9m92hpRX+Rf9 6hn+iyGALqOFgaqM0IQUIY7N5eNiNn6+vl0nN6CnMxPkw0sQta/Ke0svVyL4IiJ0UVQk B7csX8eSKywJnlDXMybiyKbEtrWwFv2de9JKUiqHg4rGBGs4vx2iIUSLv7O82HKJDLX0 BQjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@philpotter-co-uk.20150623.gappssmtp.com header.s=20150623 header.b=DUaQJScv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f7si4189862edd.239.2021.04.10.02.52.43; Sat, 10 Apr 2021 02:53:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@philpotter-co-uk.20150623.gappssmtp.com header.s=20150623 header.b=DUaQJScv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234663AbhDJJwH (ORCPT + 99 others); Sat, 10 Apr 2021 05:52:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234433AbhDJJwG (ORCPT ); Sat, 10 Apr 2021 05:52:06 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3212C061762 for ; Sat, 10 Apr 2021 02:51:51 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id a6so7914951wrw.8 for ; Sat, 10 Apr 2021 02:51:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philpotter-co-uk.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=15ioqRn6Fo545fxwUFF9JCSdykE1utM0Wbzea0PS/lI=; b=DUaQJScvbKkaGH6B3Vx4t/g/QjX87xQS1im5Q1eY/4J+pfm+nzXhzwVd/Kz5MFdd/E x9VZBDHqFNn/nL4z3vRBGL15J2Df+jmrbo2Iw3GKpKh912OgADO8XpJN+XFjqBQ74cFt PV+TrHgaNUxs9hfZnLvibDWaS967mShOaS8q3Rr6oaiCg9UbIWD8PJD8eWyLVGzx/1V4 fs7e+yQarLPt+CLJo49vIfFsoCX4Kqzz3HDG60Ctjv39rgZk+03IqTpSjwdkERtx8i6z PxBcq2MQPqalFbUJPPTCIr8smpsL2XZGrUxVpW6rofuccJy/ABgtrjKUIUt9Tgm2t7oe 1vqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=15ioqRn6Fo545fxwUFF9JCSdykE1utM0Wbzea0PS/lI=; b=D28YCaz6nptZvkdaharrsGyCIc28wQlxkGGQvPhAj3FxNajuPEKRjaE71OiJpRuK9/ mQBtpQWZMOux+KIrs7hEI/GJbNGZuaZxpwknex4s5vcpVjBKPua9qzbcNlHxvSR2v0QC G9UAaFbXJFy+cByBddiYQ7xtstATOy/zxpq+UOwO/CXLOA+1v65/p+cDZQMU/EOSmdXf ip87/LpO3LFaLEGlg56R+BFI32PXmLqrc83u/SPTeSVrWYFbThDPcVlVyZ7Xo7ShmwSQ XOTWRqK8VxE7YxsR62soyppwYY6i1KH5Cc7pQ7jHCOzVhujJnx6sX8149/loXBlGhUi/ 4fRw== X-Gm-Message-State: AOAM531NZJlhAuUpvbQsT23+yIA90rnPoD/knDMI6LwcfSQuNUdyBjBl 9XpaVd1J4R895fPBDXhmLxZpXw== X-Received: by 2002:a5d:5152:: with SMTP id u18mr21196851wrt.289.1618048310745; Sat, 10 Apr 2021 02:51:50 -0700 (PDT) Received: from localhost.localdomain (2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.a.1.e.e.d.f.d.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:dfde:e1a0::2]) by smtp.gmail.com with ESMTPSA id h9sm7183469wmb.35.2021.04.10.02.51.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Apr 2021 02:51:50 -0700 (PDT) From: Phillip Potter To: davem@davemloft.net Cc: kuba@kernel.org, willemb@google.com, linmiaohe@huawei.com, edumazet@google.com, linyunsheng@huawei.com, alobakin@pm.me, elver@google.com, gnault@redhat.com, dseok.yi@samsung.com, viro@zeniv.linux.org.uk, vladimir.oltean@nxp.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] net: core: sk_buff: zero-fill skb->data in __alloc_skb function Date: Sat, 10 Apr 2021 10:51:49 +0100 Message-Id: <20210410095149.3708143-1-phil@philpotter.co.uk> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Zero-fill skb->data in __alloc_skb function of net/core/skbuff.c, up to start of struct skb_shared_info bytes. Fixes a KMSAN-found uninit-value bug reported by syzbot at: https://syzkaller.appspot.com/bug?id=abe95dc3e3e9667fc23b8d81f29ecad95c6f106f Reported-by: syzbot+2e406a9ac75bb71d4b7a@syzkaller.appspotmail.com Signed-off-by: Phillip Potter --- net/core/skbuff.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 785daff48030..9ac26cdb5417 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -215,6 +215,7 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask, * to allow max possible filling before reallocation. */ size = SKB_WITH_OVERHEAD(ksize(data)); + memset(data, 0, size); prefetchw(data + size); /* -- 2.30.2