Commit 29a020d3 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

[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: default avatarEric Dumazet <eric.dumazet@gmail.com>
Acked-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 75c78500
...@@ -57,6 +57,7 @@ typedef enum { ...@@ -57,6 +57,7 @@ typedef enum {
#include <linux/random.h> #include <linux/random.h>
#include <linux/wait.h> #include <linux/wait.h>
#include <linux/fcntl.h> /* For O_CLOEXEC and O_NONBLOCK */ #include <linux/fcntl.h> /* For O_CLOEXEC and O_NONBLOCK */
#include <linux/kmemcheck.h>
struct poll_table_struct; struct poll_table_struct;
struct pipe_inode_info; struct pipe_inode_info;
...@@ -127,7 +128,11 @@ enum sock_shutdown_cmd { ...@@ -127,7 +128,11 @@ enum sock_shutdown_cmd {
*/ */
struct socket { struct socket {
socket_state state; socket_state state;
kmemcheck_bitfield_begin(type);
short type; short type;
kmemcheck_bitfield_end(type);
unsigned long flags; unsigned long flags;
/* /*
* Please keep fasync_list & wait fields in the same cache line * Please keep fasync_list & wait fields in the same cache line
......
...@@ -489,6 +489,7 @@ static struct socket *sock_alloc(void) ...@@ -489,6 +489,7 @@ static struct socket *sock_alloc(void)
sock = SOCKET_I(inode); sock = SOCKET_I(inode);
kmemcheck_annotate_bitfield(sock, type);
inode->i_mode = S_IFSOCK | S_IRWXUGO; inode->i_mode = S_IFSOCK | S_IRWXUGO;
inode->i_uid = current_fsuid(); inode->i_uid = current_fsuid();
inode->i_gid = current_fsgid(); inode->i_gid = current_fsgid();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment