netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: "David S . Miller" <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Eric Dumazet <eric.dumazet@gmail.com>
Subject: [PATCH net 4/8] net: initialize skb->peeked when cloning
Date: Sat,  7 Apr 2018 13:42:39 -0700	[thread overview]
Message-ID: <20180407204243.176626-5-edumazet@google.com> (raw)
In-Reply-To: <20180407204243.176626-1-edumazet@google.com>

syzbot reported __skb_try_recv_from_queue() was using skb->peeked
while it was potentially unitialized.

We need to clear it in __skb_clone()

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
---
 net/core/skbuff.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 1bca1e0fc8f70eb394f63c995e06bbc5a9261e51..345b51837ca80bb709bfffe04d58eedbba0b9907 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -857,6 +857,7 @@ static struct sk_buff *__skb_clone(struct sk_buff *n, struct sk_buff *skb)
 	n->hdr_len = skb->nohdr ? skb_headroom(skb) : skb->hdr_len;
 	n->cloned = 1;
 	n->nohdr = 0;
+	n->peeked = 0;
 	n->destructor = NULL;
 	C(tail);
 	C(end);
-- 
2.17.0.484.g0c8726318c-goog

  parent reply	other threads:[~2018-04-07 20:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-07 20:42 [PATCH net 0/8] net: fix uninit-values in networking stack Eric Dumazet
2018-04-07 20:42 ` [PATCH net 1/8] crypto: af_alg - fix possible uninit-value in alg_bind() Eric Dumazet
2018-04-07 20:42 ` [PATCH net 2/8] netlink: fix uninit-value in netlink_sendmsg Eric Dumazet
2018-04-07 20:42 ` [PATCH net 3/8] net: fix rtnh_ok() Eric Dumazet
2018-04-07 20:42 ` Eric Dumazet [this message]
2018-04-07 20:42 ` [PATCH net 5/8] net: fix uninit-value in __hw_addr_add_ex() Eric Dumazet
2018-04-07 20:42 ` [PATCH net 6/8] dccp: initialize ireq->ir_mark Eric Dumazet
2018-04-07 20:42 ` [PATCH net 7/8] ipv4: fix uninit-value in ip_route_output_key_hash_rcu() Eric Dumazet
2018-04-07 20:42 ` [PATCH net 8/8] soreuseport: initialise timewait reuseport field Eric Dumazet
2018-04-08  2:40 ` [PATCH net 0/8] net: fix uninit-values in networking stack David Miller
2018-04-08 16:38   ` Eric Dumazet
2018-04-08 16:49     ` David Miller
2018-04-08 16:55       ` Eric Dumazet
2018-04-08 21:18         ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180407204243.176626-5-edumazet@google.com \
    --to=edumazet@google.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).