From: Eric Dumazet Date: Tue, 15 Sep 2009 09:39:20 +0000 (-0700) Subject: [PATCH] net: kmemcheck annotation in struct socket X-Git-Tag: firefly_0821_release~11864^2~357 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=29a020d35f629619c67fa5e32acaaac3f8a1ba90;p=firefly-linux-kernel-4.4.55.git [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 Acked-by: Ingo Molnar Signed-off-by: David S. Miller --- 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 { #include #include #include /* For O_CLOEXEC and O_NONBLOCK */ +#include struct poll_table_struct; struct pipe_inode_info; @@ -127,7 +128,11 @@ enum sock_shutdown_cmd { */ struct socket { socket_state state; + + kmemcheck_bitfield_begin(type); short type; + kmemcheck_bitfield_end(type); + unsigned long flags; /* * 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) sock = SOCKET_I(inode); + kmemcheck_annotate_bitfield(sock, type); inode->i_mode = S_IFSOCK | S_IRWXUGO; inode->i_uid = current_fsuid(); inode->i_gid = current_fsgid();