skbuff: skb_mac_header_was_set is always true on >32 bit
Subsystems (2)
RFC 1/1 skbuff: skb_mac_header_was_set is always true on >32 bit
Looking at the crash in log_martians(), one suspect is that the check for mac header being set is not correct. The value of mac_header defaults to 0 on allocation, therefore skb_mac_header_was_set will always be true on platforms using NET_SKBUFF_USES_OFFSET.
Arnaldo, is this correct?
net/core/skbuff.c +4 -0
@@ -201,6 +201,10 @@ struct sk_buff *__alloc_skb(unsigned int skb->data = data;skb_reset_tail_pointer (skb); skb->end = skb->tail + size; +#ifdef NET_SKBUFF_DATA_USES_OFFSET + skb->mac_header = ~0U ; +#endif +/* make sure we initialize shinfo sequentially */ shinfo =skb_shinfo (skb);atomic_set (&shinfo->dataref,1 );
Em Wed, Jun 17, 2009 at 08:23:27AM -0700, Stephen Hemminger escreveu:
Quoted 8 lines
Looking at the crash in
log_martians(), one suspect is that the check for mac header being set is not correct. The value ofmac_headerdefaults to 0 on allocation, thereforeskb_mac_header_was_setwill always be true on platforms usingNET_SKBUFF_USES_OFFSET.Arnaldo, is this correct?
Signed-off-by Stephen Hemminger <[email protected]>
Yeah, looks right, I forgot to initialize it to the value I changed the test in skb_mac_header_was_set when doing the offset patch :-\
Thanks!
Quoted 13 lines
net/core/skbuff.c +4
-0@@ -201,6 +201,10 @@ struct sk_buff *__alloc_skb(unsigned int skb->data = data;skb_reset_tail_pointer (skb); skb->end = skb->tail + size; +#ifdef NET_SKBUFF_DATA_USES_OFFSET + skb->mac_header = ~0U ; +#endif +/* make sure we initialize shinfo sequentially */ shinfo =skb_shinfo (skb);atomic_set (&shinfo->dataref,1 );
From: Arnaldo Carvalho de Melo <[email protected]>
Date: Wed, 17 Jun 2009 13:37:16 -0300
Quoted 8 lines
Em Wed, Jun 17, 2009 at 08:23:27AM -0700, Stephen Hemminger escreveu:
Quoted 7 lines
Looking at the crash in
log_martians(), one suspect is that the check for mac header being set is not correct. The value ofmac_headerdefaults to 0 on allocation, thereforeskb_mac_header_was_setwill always be true on platforms usingNET_SKBUFF_USES_OFFSET.Arnaldo, is this correct?
Quoted 8 lines
Quoted 1 line
Signed-off-by Stephen Hemminger <[email protected]>Yeah, looks right, I forgot to initialize it to the value I changed the test in
skb_mac_header_was_setwhen doing the offset patch :-\Thanks!
Applied.