Message ID | 20210330234343.3273561-1-eric.dumazet@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 61431a5907fc36d0738e9a547c7e1556349a03e9 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net] net: ensure mac header is set in virtio_net_hdr_to_skb() | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | success | Link |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Clearly marked for net |
netdev/subject_prefix | success | Link |
netdev/cc_maintainers | warning | 3 maintainers not CCed: mst@redhat.com jasowang@redhat.com virtualization@lists.linux-foundation.org |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 2 this patch: 2 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | warning | WARNING: Possible repeated word: 'Google' |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 2 this patch: 2 |
netdev/header_inline | success | Link |
Hello: This patch was applied to netdev/net.git (refs/heads/master): On Tue, 30 Mar 2021 16:43:43 -0700 you wrote: > From: Eric Dumazet <edumazet@google.com> > > Commit 924a9bc362a5 ("net: check if protocol extracted by virtio_net_hdr_set_proto is correct") > added a call to dev_parse_header_protocol() but mac_header is not yet set. > > This means that eth_hdr() reads complete garbage, and syzbot complained about it [1] > > [...] Here is the summary with links: - [net] net: ensure mac header is set in virtio_net_hdr_to_skb() https://git.kernel.org/netdev/net/c/61431a5907fc You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h index 6b5fcfa1e5553576b0e853ae31a2df655c04204b..98775d7fa69632e2c2da30b581a666f7fbb94b64 100644 --- a/include/linux/virtio_net.h +++ b/include/linux/virtio_net.h @@ -62,6 +62,8 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb, return -EINVAL; } + skb_reset_mac_header(skb); + if (hdr->flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) { u16 start = __virtio16_to_cpu(little_endian, hdr->csum_start); u16 off = __virtio16_to_cpu(little_endian, hdr->csum_offset);