diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-09-15 05:39:20 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-09-15 05:39:20 -0400 |
commit | 29a020d35f629619c67fa5e32acaaac3f8a1ba90 (patch) | |
tree | 65f9ce8a822633aa1e6cdf25be3aa258d2d21db1 | |
parent | 75c78500ddad74b229cd0691496b8549490496a2 (diff) |
[PATCH] net: kmemcheck annotation in struct socket
struct socket has a 16 bit hole that triggers kmemcheck warnings.
As suggested by Ingo, use kmemcheck annotations
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/linux/net.h | 5 | ||||
-rw-r--r-- | net/socket.c | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/net.h b/include/linux/net.h index 4fc2ffd527f9..9040a10584f7 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -57,6 +57,7 @@ typedef enum { | |||
57 | #include <linux/random.h> | 57 | #include <linux/random.h> |
58 | #include <linux/wait.h> | 58 | #include <linux/wait.h> |
59 | #include <linux/fcntl.h> /* For O_CLOEXEC and O_NONBLOCK */ | 59 | #include <linux/fcntl.h> /* For O_CLOEXEC and O_NONBLOCK */ |
60 | #include <linux/kmemcheck.h> | ||
60 | 61 | ||
61 | struct poll_table_struct; | 62 | struct poll_table_struct; |
62 | struct pipe_inode_info; | 63 | struct pipe_inode_info; |
@@ -127,7 +128,11 @@ enum sock_shutdown_cmd { | |||
127 | */ | 128 | */ |
128 | struct socket { | 129 | struct socket { |
129 | socket_state state; | 130 | socket_state state; |
131 | |||
132 | kmemcheck_bitfield_begin(type); | ||
130 | short type; | 133 | short type; |
134 | kmemcheck_bitfield_end(type); | ||
135 | |||
131 | unsigned long flags; | 136 | unsigned long flags; |
132 | /* | 137 | /* |
133 | * Please keep fasync_list & wait fields in the same cache line | 138 | * Please keep fasync_list & wait fields in the same cache line |
diff --git a/net/socket.c b/net/socket.c index 6d4716559047..2a022c00d85c 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -489,6 +489,7 @@ static struct socket *sock_alloc(void) | |||
489 | 489 | ||
490 | sock = SOCKET_I(inode); | 490 | sock = SOCKET_I(inode); |
491 | 491 | ||
492 | kmemcheck_annotate_bitfield(sock, type); | ||
492 | inode->i_mode = S_IFSOCK | S_IRWXUGO; | 493 | inode->i_mode = S_IFSOCK | S_IRWXUGO; |
493 | inode->i_uid = current_fsuid(); | 494 | inode->i_uid = current_fsuid(); |
494 | inode->i_gid = current_fsgid(); | 495 | inode->i_gid = current_fsgid(); |