summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLevin, Alexander (Sasha Levin) <alexander.levin@verizon.com>2017-11-15 20:35:51 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-15 21:21:04 -0500
commit4950276672fce5c241857540f8561c440663673d (patch)
tree014141bd67d83260a5d5de744e5d62a5cbf6c83b /net
parentcdb07bdea28ebf1286a979501620745680596365 (diff)
kmemcheck: remove annotations
Patch series "kmemcheck: kill kmemcheck", v2. As discussed at LSF/MM, kill kmemcheck. KASan is a replacement that is able to work without the limitation of kmemcheck (single CPU, slow). KASan is already upstream. We are also not aware of any users of kmemcheck (or users who don't consider KASan as a suitable replacement). The only objection was that since KASAN wasn't supported by all GCC versions provided by distros at that time we should hold off for 2 years, and try again. Now that 2 years have passed, and all distros provide gcc that supports KASAN, kill kmemcheck again for the very same reasons. This patch (of 4): Remove kmemcheck annotations, and calls to kmemcheck from the kernel. [alexander.levin@verizon.com: correctly remove kmemcheck call from dma_map_sg_attrs] Link: http://lkml.kernel.org/r/20171012192151.26531-1-alexander.levin@verizon.com Link: http://lkml.kernel.org/r/20171007030159.22241-2-alexander.levin@verizon.com Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Cc: Alexander Potapenko <glider@google.com> Cc: Eric W. Biederman <ebiederm@xmission.com> Cc: Michal Hocko <mhocko@kernel.org> Cc: Pekka Enberg <penberg@kernel.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Tim Hansen <devtimhansen@gmail.com> Cc: Vegard Nossum <vegardno@ifi.uio.no> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net')
-rw-r--r--net/core/skbuff.c5
-rw-r--r--net/core/sock.c2
-rw-r--r--net/ipv4/inet_timewait_sock.c3
-rw-r--r--net/ipv4/tcp_input.c1
-rw-r--r--net/socket.c1
5 files changed, 0 insertions, 12 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index e140ba49b30a..6cd057b41f34 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -41,7 +41,6 @@
41#include <linux/module.h> 41#include <linux/module.h>
42#include <linux/types.h> 42#include <linux/types.h>
43#include <linux/kernel.h> 43#include <linux/kernel.h>
44#include <linux/kmemcheck.h>
45#include <linux/mm.h> 44#include <linux/mm.h>
46#include <linux/interrupt.h> 45#include <linux/interrupt.h>
47#include <linux/in.h> 46#include <linux/in.h>
@@ -234,14 +233,12 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask,
234 shinfo = skb_shinfo(skb); 233 shinfo = skb_shinfo(skb);
235 memset(shinfo, 0, offsetof(struct skb_shared_info, dataref)); 234 memset(shinfo, 0, offsetof(struct skb_shared_info, dataref));
236 atomic_set(&shinfo->dataref, 1); 235 atomic_set(&shinfo->dataref, 1);
237 kmemcheck_annotate_variable(shinfo->destructor_arg);
238 236
239 if (flags & SKB_ALLOC_FCLONE) { 237 if (flags & SKB_ALLOC_FCLONE) {
240 struct sk_buff_fclones *fclones; 238 struct sk_buff_fclones *fclones;
241 239
242 fclones = container_of(skb, struct sk_buff_fclones, skb1); 240 fclones = container_of(skb, struct sk_buff_fclones, skb1);
243 241
244 kmemcheck_annotate_bitfield(&fclones->skb2, flags1);
245 skb->fclone = SKB_FCLONE_ORIG; 242 skb->fclone = SKB_FCLONE_ORIG;
246 refcount_set(&fclones->fclone_ref, 1); 243 refcount_set(&fclones->fclone_ref, 1);
247 244
@@ -301,7 +298,6 @@ struct sk_buff *__build_skb(void *data, unsigned int frag_size)
301 shinfo = skb_shinfo(skb); 298 shinfo = skb_shinfo(skb);
302 memset(shinfo, 0, offsetof(struct skb_shared_info, dataref)); 299 memset(shinfo, 0, offsetof(struct skb_shared_info, dataref));
303 atomic_set(&shinfo->dataref, 1); 300 atomic_set(&shinfo->dataref, 1);
304 kmemcheck_annotate_variable(shinfo->destructor_arg);
305 301
306 return skb; 302 return skb;
307} 303}
@@ -1283,7 +1279,6 @@ struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t gfp_mask)
1283 if (!n) 1279 if (!n)
1284 return NULL; 1280 return NULL;
1285 1281
1286 kmemcheck_annotate_bitfield(n, flags1);
1287 n->fclone = SKB_FCLONE_UNAVAILABLE; 1282 n->fclone = SKB_FCLONE_UNAVAILABLE;
1288 } 1283 }
1289 1284
diff --git a/net/core/sock.c b/net/core/sock.c
index 415f441c63b9..78401fa33ce8 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1469,8 +1469,6 @@ static struct sock *sk_prot_alloc(struct proto *prot, gfp_t priority,
1469 sk = kmalloc(prot->obj_size, priority); 1469 sk = kmalloc(prot->obj_size, priority);
1470 1470
1471 if (sk != NULL) { 1471 if (sk != NULL) {
1472 kmemcheck_annotate_bitfield(sk, flags);
1473
1474 if (security_sk_alloc(sk, family, priority)) 1472 if (security_sk_alloc(sk, family, priority))
1475 goto out_free; 1473 goto out_free;
1476 1474
diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c
index 5b039159e67a..d451b9f19b59 100644
--- a/net/ipv4/inet_timewait_sock.c
+++ b/net/ipv4/inet_timewait_sock.c
@@ -9,7 +9,6 @@
9 */ 9 */
10 10
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/kmemcheck.h>
13#include <linux/slab.h> 12#include <linux/slab.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <net/inet_hashtables.h> 14#include <net/inet_hashtables.h>
@@ -167,8 +166,6 @@ struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk,
167 if (tw) { 166 if (tw) {
168 const struct inet_sock *inet = inet_sk(sk); 167 const struct inet_sock *inet = inet_sk(sk);
169 168
170 kmemcheck_annotate_bitfield(tw, flags);
171
172 tw->tw_dr = dr; 169 tw->tw_dr = dr;
173 /* Give us an identity. */ 170 /* Give us an identity. */
174 tw->tw_daddr = inet->inet_daddr; 171 tw->tw_daddr = inet->inet_daddr;
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 887585045b27..c04d60a677a7 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -6195,7 +6195,6 @@ struct request_sock *inet_reqsk_alloc(const struct request_sock_ops *ops,
6195 if (req) { 6195 if (req) {
6196 struct inet_request_sock *ireq = inet_rsk(req); 6196 struct inet_request_sock *ireq = inet_rsk(req);
6197 6197
6198 kmemcheck_annotate_bitfield(ireq, flags);
6199 ireq->ireq_opt = NULL; 6198 ireq->ireq_opt = NULL;
6200#if IS_ENABLED(CONFIG_IPV6) 6199#if IS_ENABLED(CONFIG_IPV6)
6201 ireq->pktopts = NULL; 6200 ireq->pktopts = NULL;
diff --git a/net/socket.c b/net/socket.c
index c729625eb5d3..42d8e9c9ccd5 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -568,7 +568,6 @@ struct socket *sock_alloc(void)
568 568
569 sock = SOCKET_I(inode); 569 sock = SOCKET_I(inode);
570 570
571 kmemcheck_annotate_bitfield(sock, type);
572 inode->i_ino = get_next_ino(); 571 inode->i_ino = get_next_ino();
573 inode->i_mode = S_IFSOCK | S_IRWXUGO; 572 inode->i_mode = S_IFSOCK | S_IRWXUGO;
574 inode->i_uid = current_fsuid(); 573 inode->i_uid = current_fsuid();