aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/core/skbuff.c8
-rw-r--r--net/core/sock.c2
-rw-r--r--net/ipv4/inet_timewait_sock.c3
3 files changed, 13 insertions, 0 deletions
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
diff --git a/net/core/sock.c b/net/core/sock.c
index 7dbf3ffb35cc..ce72c0ae4245 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -941,6 +941,8 @@ static struct sock *sk_prot_alloc(struct proto *prot, gfp_t priority,
941 sk = kmalloc(prot->obj_size, priority); 941 sk = kmalloc(prot->obj_size, priority);
942 942
943 if (sk != NULL) { 943 if (sk != NULL) {
944 kmemcheck_annotate_bitfield(sk, flags);
945
944 if (security_sk_alloc(sk, family, priority)) 946 if (security_sk_alloc(sk, family, priority))
945 goto out_free; 947 goto out_free;
946 948
diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c
index 8554d0ea1719..03169fc84877 100644
--- a/net/ipv4/inet_timewait_sock.c
+++ b/net/ipv4/inet_timewait_sock.c
@@ -9,6 +9,7 @@
9 */ 9 */
10 10
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/kmemcheck.h>
12#include <net/inet_hashtables.h> 13#include <net/inet_hashtables.h>
13#include <net/inet_timewait_sock.h> 14#include <net/inet_timewait_sock.h>
14#include <net/ip.h> 15#include <net/ip.h>
@@ -117,6 +118,8 @@ struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, const int stat
117 if (tw != NULL) { 118 if (tw != NULL) {
118 const struct inet_sock *inet = inet_sk(sk); 119 const struct inet_sock *inet = inet_sk(sk);
119 120
121 kmemcheck_annotate_bitfield(tw, flags);
122
120 /* Give us an identity. */ 123 /* Give us an identity. */
121 tw->tw_daddr = inet->daddr; 124 tw->tw_daddr = inet->daddr;
122 tw->tw_rcv_saddr = inet->rcv_saddr; 125 tw->tw_rcv_saddr = inet->rcv_saddr;