diff options
-rw-r--r-- | include/linux/skbuff.h | 7 | ||||
-rw-r--r-- | net/core/skbuff.c | 8 |
2 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 5fd389162f01..ed6537fc5b48 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #define _LINUX_SKBUFF_H | 15 | #define _LINUX_SKBUFF_H |
16 | 16 | ||
17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/kmemcheck.h> | ||
18 | #include <linux/compiler.h> | 19 | #include <linux/compiler.h> |
19 | #include <linux/time.h> | 20 | #include <linux/time.h> |
20 | #include <linux/cache.h> | 21 | #include <linux/cache.h> |
@@ -346,6 +347,7 @@ struct sk_buff { | |||
346 | }; | 347 | }; |
347 | }; | 348 | }; |
348 | __u32 priority; | 349 | __u32 priority; |
350 | kmemcheck_bitfield_begin(flags1); | ||
349 | __u8 local_df:1, | 351 | __u8 local_df:1, |
350 | cloned:1, | 352 | cloned:1, |
351 | ip_summed:2, | 353 | ip_summed:2, |
@@ -356,6 +358,7 @@ struct sk_buff { | |||
356 | ipvs_property:1, | 358 | ipvs_property:1, |
357 | peeked:1, | 359 | peeked:1, |
358 | nf_trace:1; | 360 | nf_trace:1; |
361 | kmemcheck_bitfield_end(flags1); | ||
359 | __be16 protocol; | 362 | __be16 protocol; |
360 | 363 | ||
361 | void (*destructor)(struct sk_buff *skb); | 364 | void (*destructor)(struct sk_buff *skb); |
@@ -375,6 +378,8 @@ struct sk_buff { | |||
375 | __u16 tc_verd; /* traffic control verdict */ | 378 | __u16 tc_verd; /* traffic control verdict */ |
376 | #endif | 379 | #endif |
377 | #endif | 380 | #endif |
381 | |||
382 | kmemcheck_bitfield_begin(flags2); | ||
378 | #ifdef CONFIG_IPV6_NDISC_NODETYPE | 383 | #ifdef CONFIG_IPV6_NDISC_NODETYPE |
379 | __u8 ndisc_nodetype:2; | 384 | __u8 ndisc_nodetype:2; |
380 | #endif | 385 | #endif |
@@ -382,6 +387,8 @@ struct sk_buff { | |||
382 | __u8 do_not_encrypt:1; | 387 | __u8 do_not_encrypt:1; |
383 | __u8 requeue:1; | 388 | __u8 requeue:1; |
384 | #endif | 389 | #endif |
390 | kmemcheck_bitfield_end(flags2); | ||
391 | |||
385 | /* 0/13/14 bit hole */ | 392 | /* 0/13/14 bit hole */ |
386 | 393 | ||
387 | #ifdef CONFIG_NET_DMA | 394 | #ifdef CONFIG_NET_DMA |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index c2e4fb8f3546..f0c4c6ad774b 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/module.h> | 39 | #include <linux/module.h> |
40 | #include <linux/types.h> | 40 | #include <linux/types.h> |
41 | #include <linux/kernel.h> | 41 | #include <linux/kernel.h> |
42 | #include <linux/kmemcheck.h> | ||
42 | #include <linux/mm.h> | 43 | #include <linux/mm.h> |
43 | #include <linux/interrupt.h> | 44 | #include <linux/interrupt.h> |
44 | #include <linux/in.h> | 45 | #include <linux/in.h> |
@@ -201,6 +202,8 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask, | |||
201 | skb->data = data; | 202 | skb->data = data; |
202 | skb_reset_tail_pointer(skb); | 203 | skb_reset_tail_pointer(skb); |
203 | skb->end = skb->tail + size; | 204 | skb->end = skb->tail + size; |
205 | kmemcheck_annotate_bitfield(skb, flags1); | ||
206 | kmemcheck_annotate_bitfield(skb, flags2); | ||
204 | /* make sure we initialize shinfo sequentially */ | 207 | /* make sure we initialize shinfo sequentially */ |
205 | shinfo = skb_shinfo(skb); | 208 | shinfo = skb_shinfo(skb); |
206 | atomic_set(&shinfo->dataref, 1); | 209 | atomic_set(&shinfo->dataref, 1); |
@@ -217,6 +220,8 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask, | |||
217 | struct sk_buff *child = skb + 1; | 220 | struct sk_buff *child = skb + 1; |
218 | atomic_t *fclone_ref = (atomic_t *) (child + 1); | 221 | atomic_t *fclone_ref = (atomic_t *) (child + 1); |
219 | 222 | ||
223 | kmemcheck_annotate_bitfield(child, flags1); | ||
224 | kmemcheck_annotate_bitfield(child, flags2); | ||
220 | skb->fclone = SKB_FCLONE_ORIG; | 225 | skb->fclone = SKB_FCLONE_ORIG; |
221 | atomic_set(fclone_ref, 1); | 226 | atomic_set(fclone_ref, 1); |
222 | 227 | ||
@@ -633,6 +638,9 @@ struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t gfp_mask) | |||
633 | n = kmem_cache_alloc(skbuff_head_cache, gfp_mask); | 638 | n = kmem_cache_alloc(skbuff_head_cache, gfp_mask); |
634 | if (!n) | 639 | if (!n) |
635 | return NULL; | 640 | return NULL; |
641 | |||
642 | kmemcheck_annotate_bitfield(n, flags1); | ||
643 | kmemcheck_annotate_bitfield(n, flags2); | ||
636 | n->fclone = SKB_FCLONE_UNAVAILABLE; | 644 | n->fclone = SKB_FCLONE_UNAVAILABLE; |
637 | } | 645 | } |
638 | 646 | ||