aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/sock.h2
-rw-r--r--net/core/sock.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index 4bb1ff9fd15b..d933da00d505 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -218,9 +218,11 @@ struct sock {
218#define sk_hash __sk_common.skc_hash 218#define sk_hash __sk_common.skc_hash
219#define sk_prot __sk_common.skc_prot 219#define sk_prot __sk_common.skc_prot
220#define sk_net __sk_common.skc_net 220#define sk_net __sk_common.skc_net
221 kmemcheck_bitfield_begin(flags);
221 unsigned char sk_shutdown : 2, 222 unsigned char sk_shutdown : 2,
222 sk_no_check : 2, 223 sk_no_check : 2,
223 sk_userlocks : 4; 224 sk_userlocks : 4;
225 kmemcheck_bitfield_end(flags);
224 unsigned char sk_protocol; 226 unsigned char sk_protocol;
225 unsigned short sk_type; 227 unsigned short sk_type;
226 int sk_rcvbuf; 228 int sk_rcvbuf;
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