On Thu, 28 Aug 2008, Vegard Nossum wrote:Why not do something like this (as suggested by Ingo, I think)? Yeah, the macro should go into kmemcheck.h but I don't have a tree handy... Pekka Index: linux-2.6/include/linux/bitfield.h =================================================================== --- /dev/null +++ linux-2.6/include/linux/bitfield.h @@ -0,0 +1,10 @@ +#ifndef __LINUX_BITFIELD_H +#define __LINUX_BITFIELD_H + +#ifdef CONFIG_KMEMCHECK +#define KMEMCHECK_BIT_FIELD(field) do { field = 0; } while (0) +#else +#define KMEMCHECK_BIT_FIELD(field) do { } while (0) +#endif /* CONFIG_KMEMCHECK */ + +#endif /* __LINUX_BITFIELD_H */ Index: linux-2.6/net/core/skbuff.c =================================================================== --- linux-2.6.orig/net/core/skbuff.c +++ linux-2.6/net/core/skbuff.c @@ -55,6 +55,7 @@ #include <linux/rtnetlink.h> #include <linux/init.h> #include <linux/scatterlist.h> +#include <linux/bitfield.h> #include <net/protocol.h> #include <net/dst.h> @@ -209,6 +210,11 @@ struct sk_buff *__alloc_skb(unsigned int skb->data = data; skb_reset_tail_pointer(skb); skb->end = skb->tail + size; + KMEMCHECK_BIT_FIELD(skb->local_df); + KMEMCHECK_BIT_FIELD(skb->cloned); + KMEMCHECK_BIT_FIELD(skb->ip_summed); + KMEMCHECK_BIT_FIELD(skb->nohdr); + KMEMCHECK_BIT_FIELD(skb->nfctinfo); /* make sure we initialize shinfo sequentially */ shinfo = skb_shinfo(skb); atomic_set(&shinfo->dataref, 1); --
| david | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Eric Sandeen | Re: [RFC] Heads up on sys_fallocate() |
| Filippos Papadopoulos | Re: INITIO scsi driver fails to work properly |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
git: | |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | [GIT]: Networking |
| Jarek Poplawski | [PATCH take 2] pkt_sched: Protect gen estimators under est_lock. |
| Natalie Protasevich | [BUG] New Kernel Bugs |
