Skip to content

Commit 87ce0e2

Browse files
committed
net: Pass NULL to skb_network_protocol() when we don't care about vlan depth
jira VULN-66198 cve-pre CVE-2022-49872 commit-author Miaohe Lin <linmiaohe@huawei.com> commit 2f63113 When we don't care about vlan depth, we could pass NULL instead of the address of a unused local variable to skb_network_protocol() as a param. Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net> (cherry picked from commit 2f63113) Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
1 parent c05d38b commit 87ce0e2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

net/core/skbuff.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3879,7 +3879,6 @@ struct sk_buff *skb_segment(struct sk_buff *head_skb,
38793879
int err = -ENOMEM;
38803880
int i = 0;
38813881
int pos;
3882-
int dummy;
38833882

38843883
if (list_skb && !list_skb->head_frag && skb_headlen(list_skb) &&
38853884
(skb_shinfo(head_skb)->gso_type & SKB_GSO_DODGY)) {
@@ -3901,7 +3900,7 @@ struct sk_buff *skb_segment(struct sk_buff *head_skb,
39013900
}
39023901

39033902
__skb_push(head_skb, doffset);
3904-
proto = skb_network_protocol(head_skb, &dummy);
3903+
proto = skb_network_protocol(head_skb, NULL);
39053904
if (unlikely(!proto))
39063905
return ERR_PTR(-EINVAL);
39073906

0 commit comments

Comments
 (0)