Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Eric Dumazet and committed by
David S. Miller
29a020d3 75c78500

+6
+5
include/linux/net.h
··· 57 57 #include <linux/random.h> 58 58 #include <linux/wait.h> 59 59 #include <linux/fcntl.h> /* For O_CLOEXEC and O_NONBLOCK */ 60 + #include <linux/kmemcheck.h> 60 61 61 62 struct poll_table_struct; 62 63 struct pipe_inode_info; ··· 128 127 */ 129 128 struct socket { 130 129 socket_state state; 130 + 131 + kmemcheck_bitfield_begin(type); 131 132 short type; 133 + kmemcheck_bitfield_end(type); 134 + 132 135 unsigned long flags; 133 136 /* 134 137 * Please keep fasync_list & wait fields in the same cache line
+1
net/socket.c
··· 489 489 490 490 sock = SOCKET_I(inode); 491 491 492 + kmemcheck_annotate_bitfield(sock, type); 492 493 inode->i_mode = S_IFSOCK | S_IRWXUGO; 493 494 inode->i_uid = current_fsuid(); 494 495 inode->i_gid = current_fsgid();