packages: kernel/kernel-imq.patch, kernel/kernel.spec - 2.6.32.7-2; kernel-...

mguevara mguevara at pld-linux.org
Tue Feb 2 16:55:08 CET 2010


Author: mguevara                     Date: Tue Feb  2 15:55:08 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- 2.6.32.7-2; kernel-imq.patch updated to linux-2.6.32-imq-test2.diff

---- Files affected:
packages/kernel:
   kernel-imq.patch (1.5 -> 1.6) , kernel.spec (1.749 -> 1.750) 

---- Diffs:

================================================================
Index: packages/kernel/kernel-imq.patch
diff -u packages/kernel/kernel-imq.patch:1.5 packages/kernel/kernel-imq.patch:1.6
--- packages/kernel/kernel-imq.patch:1.5	Fri Dec  4 20:21:52 2009
+++ packages/kernel/kernel-imq.patch	Tue Feb  2 16:55:02 2010
@@ -1,7 +1,7 @@
-diff -uNr --exclude='*~' linux-2.6.29.1/drivers/net/imq.c linux-2.6.29.1-imq/drivers/net/imq.c
---- linux-2.6.29.1/drivers/net/imq.c	1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.6.29.1-imq/drivers/net/imq.c	2009-04-20 23:22:18.935017702 +0300
-@@ -0,0 +1,571 @@
+diff -U 5 -Nr linux-2.6.32/drivers/net/imq.c linux-2.6.32-imq/drivers/net/imq.c
+--- linux-2.6.32/drivers/net/imq.c	1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.32-imq/drivers/net/imq.c	2009-12-11 15:08:01.958734740 +0200
+@@ -0,0 +1,632 @@
 +/*
 + *             Pseudo-driver for the intermediate queue device.
 + *
@@ -74,6 +74,15 @@
 + *              - Use netdevice feature flags to avoid extra packet handling
 + *                by core networking layer and possibly increase performance.
 + *
++ *             2009/09/26 - (Jussi Kivilinna)
++ *              - Add imq_nf_reinject_lockless to fix deadlock with
++ *                imq_nf_queue/imq_nf_reinject.
++ *
++ *             2009/12/08 - (Jussi Kivilinna)
++ *              - Port to 2.6.32
++ *              - Add check for skb->nf_queue_entry==NULL in imq_dev_xmit()
++ *              - Also add better error checking for skb->nf_queue_entry usage
++ *
 + *	       Also, many thanks to pablo Sebastian Greco for making the initial
 + *	       patch and to those who helped the testing.
 + *
@@ -171,6 +180,8 @@
 +{
 +	struct nf_queue_entry *entry = skb->nf_queue_entry;
 +
++	skb->nf_queue_entry = NULL;
++
 +	if (entry) {
 +		nf_queue_entry_release_refs(entry);
 +		kfree(entry);
@@ -179,6 +190,25 @@
 +	skb_restore_cb(skb); /* kfree backup */
 +}
 +
++/* locking not needed when called from imq_nf_queue */
++static void imq_nf_reinject_lockless(struct nf_queue_entry *entry,
++						unsigned int verdict)
++{
++	int status;
++
++	if (!entry->next_outfn) {
++		nf_reinject(entry, verdict);
++		return;
++	}
++
++	status = entry->next_outfn(entry, entry->next_queuenum);
++	if (status < 0) {
++		nf_queue_entry_release_refs(entry);
++		kfree_skb(entry->skb);
++		kfree(entry);
++	}
++}
++
 +static void imq_nf_reinject(struct nf_queue_entry *entry, unsigned int verdict)
 +{
 +	int status;
@@ -203,19 +233,48 @@
 +	rcu_read_unlock();
 +}
 +
-+static int imq_dev_xmit(struct sk_buff *skb, struct net_device *dev)
++static netdev_tx_t imq_dev_xmit(struct sk_buff *skb, struct net_device *dev)
 +{
++	struct nf_queue_entry *entry = skb->nf_queue_entry;
++
++	skb->nf_queue_entry = NULL;
++	dev->trans_start = jiffies;
++
 +	dev->stats.tx_bytes += skb->len;
 +	dev->stats.tx_packets++;
 +
++	if (entry == NULL) {
++		/* We don't know what is going on here.. packet is queued for
++		 * imq device, but (probably) not by us.
++		 *
++		 * If this packet was not send here by imq_nf_queue(), then
++		 * skb_save_cb() was not used and skb_free() should not show:
++		 *   WARNING: IMQ: kfree_skb: skb->cb_next:..
++		 * and/or
++		 *   WARNING: IMQ: kfree_skb: skb->nf_queue_entry...
++		 *
++		 * However if this message is shown, then IMQ is somehow broken
++		 * and you should report this to linuximq.net.
++		 */
++
++		/* imq_dev_xmit is black hole that eats all packets, report that
++		 * we eat this packet happily and increase dropped counters.
++		 */
++
++		dev->stats.tx_dropped++;
++		dev_kfree_skb(skb);
++
++		return NETDEV_TX_OK;
++	}
++
++	skb_restore_cb(skb); /* restore skb->cb */
++
 +	skb->imq_flags = 0;
 +	skb->destructor = NULL;
 +
-+	skb_restore_cb(skb); /* restore skb->cb */
++	imq_nf_reinject(entry, NF_ACCEPT);
 +
-+	dev->trans_start = jiffies;
-+	imq_nf_reinject(skb->nf_queue_entry, NF_ACCEPT);
-+	return 0;
++	return NETDEV_TX_OK;
 +}
 +
 +static int imq_nf_queue(struct nf_queue_entry *entry, unsigned queue_num)
@@ -258,7 +317,7 @@
 +
 +	if (unlikely(!(dev->flags & IFF_UP))) {
 +		entry->skb->imq_flags = 0;
-+		imq_nf_reinject(entry, NF_ACCEPT);
++		imq_nf_reinject_lockless(entry, NF_ACCEPT);
 +		retval = 0;
 +		goto out;
 +	}
@@ -316,6 +375,7 @@
 +		goto out;
 +	} else {
 +		skb_restore_cb(skb_shared); /* restore skb->cb */
++		skb->nf_queue_entry = NULL;
 +		/* qdisc dropped packet and decreased skb reference count of
 +		 * skb, so we don't really want to and try refree as that would
 +		 * actually destroy the skb. */
@@ -379,6 +439,7 @@
 +	dev->features           = NETIF_F_SG | NETIF_F_FRAGLIST |
 +				  NETIF_F_GSO | NETIF_F_HW_CSUM |
 +				  NETIF_F_HIGHDMA;
++	dev->priv_flags		&= ~IFF_XMIT_DST_RELEASE;
 +}
 +
 +static int imq_validate(struct nlattr *tb[], struct nlattr *data[])
@@ -573,10 +634,12 @@
 +MODULE_LICENSE("GPL");
 +MODULE_ALIAS_RTNL_LINK("imq");
 +
-diff -uNr --exclude='*~' linux-2.6.29.1/drivers/net/Kconfig linux-2.6.29.1-imq/drivers/net/Kconfig
---- linux-2.6.29.1/drivers/net/Kconfig	2009-04-02 23:55:27.000000000 +0300
-+++ linux-2.6.29.1-imq/drivers/net/Kconfig	2009-04-12 22:28:22.372333533 +0300
-@@ -110,6 +110,129 @@
+diff -U 5 -Nr linux-2.6.32/drivers/net/Kconfig linux-2.6.32-imq/drivers/net/Kconfig
+--- linux-2.6.32/drivers/net/Kconfig	2009-12-03 05:51:21.000000000 +0200
++++ linux-2.6.32-imq/drivers/net/Kconfig	2009-12-11 14:16:42.678730699 +0200
+@@ -107,10 +107,133 @@
+ 	  <http://www.tldp.org/docs.html#howto>.
+ 
  	  To compile this driver as a module, choose M here: the module
  	  will be called eql.  If unsure, say N.
  
@@ -706,10 +769,14 @@
  config TUN
  	tristate "Universal TUN/TAP device driver support"
  	select CRC32
-diff -uNr --exclude='*~' linux-2.6.29.1/drivers/net/Makefile linux-2.6.29.1-imq/drivers/net/Makefile
---- linux-2.6.29.1/drivers/net/Makefile	2009-04-02 23:55:27.000000000 +0300
-+++ linux-2.6.29.1-imq/drivers/net/Makefile	2009-04-12 22:28:22.372333533 +0300
-@@ -150,6 +150,7 @@
+ 	---help---
+ 	  TUN/TAP provides packet reception and transmission for user space
+diff -U 5 -Nr linux-2.6.32/drivers/net/Makefile linux-2.6.32-imq/drivers/net/Makefile
+--- linux-2.6.32/drivers/net/Makefile	2009-12-03 05:51:21.000000000 +0200
++++ linux-2.6.32-imq/drivers/net/Makefile	2009-12-11 14:16:42.678730699 +0200
+@@ -163,10 +163,11 @@
+ obj-$(CONFIG_SLHC) += slhc.o
+ 
  obj-$(CONFIG_XEN_NETDEV_FRONTEND) += xen-netfront.o
  
  obj-$(CONFIG_DUMMY) += dummy.o
@@ -717,9 +784,11 @@
  obj-$(CONFIG_IFB) += ifb.o
  obj-$(CONFIG_MACVLAN) += macvlan.o
  obj-$(CONFIG_DE600) += de600.o
-diff -uNr --exclude='*~' linux-2.6.29.1/include/linux/imq.h linux-2.6.29.1-imq/include/linux/imq.h
---- linux-2.6.29.1/include/linux/imq.h	1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.6.29.1-imq/include/linux/imq.h	2009-04-12 22:28:22.372333533 +0300
+ obj-$(CONFIG_DE620) += de620.o
+ obj-$(CONFIG_LANCE) += lance.o
+diff -U 5 -Nr linux-2.6.32/include/linux/imq.h linux-2.6.32-imq/include/linux/imq.h
+--- linux-2.6.32/include/linux/imq.h	1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.32-imq/include/linux/imq.h	2009-12-11 14:16:42.678730699 +0200
 @@ -0,0 +1,13 @@
 +#ifndef _IMQ_H
 +#define _IMQ_H
@@ -734,10 +803,12 @@
 +
 +#endif /* _IMQ_H */
 +
-diff -uNr --exclude='*~' linux-2.6.29.1/include/linux/netdevice.h linux-2.6.29.1-imq/include/linux/netdevice.h
---- linux-2.6.29.1/include/linux/netdevice.h	2009-04-02 23:55:27.000000000 +0300
-+++ linux-2.6.29.1-imq/include/linux/netdevice.h	2009-04-12 22:28:22.373333509 +0300
-@@ -1071,6 +1071,7 @@
+diff -U 5 -Nr linux-2.6.32/include/linux/netdevice.h linux-2.6.32-imq/include/linux/netdevice.h
+--- linux-2.6.32/include/linux/netdevice.h	2009-12-03 05:51:21.000000000 +0200
++++ linux-2.6.32-imq/include/linux/netdevice.h	2009-12-11 14:16:42.679730960 +0200
+@@ -1112,10 +1112,11 @@
+ extern struct net_device	*__dev_get_by_name(struct net *net, const char *name);
+ extern int		dev_alloc_name(struct net_device *dev, const char *name);
  extern int		dev_open(struct net_device *dev);
  extern int		dev_close(struct net_device *dev);
  extern void		dev_disable_lro(struct net_device *dev);
@@ -745,9 +816,11 @@
  extern int		dev_queue_xmit(struct sk_buff *skb);
  extern int		register_netdevice(struct net_device *dev);
  extern void		unregister_netdevice(struct net_device *dev);
-diff -uNr --exclude='*~' linux-2.6.29.1/include/linux/netfilter/xt_IMQ.h linux-2.6.29.1-imq/include/linux/netfilter/xt_IMQ.h
---- linux-2.6.29.1/include/linux/netfilter/xt_IMQ.h	1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.6.29.1-imq/include/linux/netfilter/xt_IMQ.h	2009-04-12 22:28:22.373333509 +0300
+ extern void		free_netdev(struct net_device *dev);
+ extern void		synchronize_net(void);
+diff -U 5 -Nr linux-2.6.32/include/linux/netfilter/xt_IMQ.h linux-2.6.32-imq/include/linux/netfilter/xt_IMQ.h
+--- linux-2.6.32/include/linux/netfilter/xt_IMQ.h	1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.32-imq/include/linux/netfilter/xt_IMQ.h	2009-12-11 14:16:42.679730960 +0200
 @@ -0,0 +1,9 @@
 +#ifndef _XT_IMQ_H
 +#define _XT_IMQ_H
@@ -758,9 +831,9 @@
 +
 +#endif /* _XT_IMQ_H */
 +
-diff -uNr --exclude='*~' linux-2.6.29.1/include/linux/netfilter_ipv4/ipt_IMQ.h linux-2.6.29.1-imq/include/linux/netfilter_ipv4/ipt_IMQ.h
---- linux-2.6.29.1/include/linux/netfilter_ipv4/ipt_IMQ.h	1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.6.29.1-imq/include/linux/netfilter_ipv4/ipt_IMQ.h	2009-04-12 22:28:22.373333509 +0300
+diff -U 5 -Nr linux-2.6.32/include/linux/netfilter_ipv4/ipt_IMQ.h linux-2.6.32-imq/include/linux/netfilter_ipv4/ipt_IMQ.h
+--- linux-2.6.32/include/linux/netfilter_ipv4/ipt_IMQ.h	1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.32-imq/include/linux/netfilter_ipv4/ipt_IMQ.h	2009-12-11 14:16:42.679730960 +0200
 @@ -0,0 +1,10 @@
 +#ifndef _IPT_IMQ_H
 +#define _IPT_IMQ_H
@@ -772,9 +845,9 @@
 +
 +#endif /* _IPT_IMQ_H */
 +
-diff -uNr --exclude='*~' linux-2.6.29.1/include/linux/netfilter_ipv6/ip6t_IMQ.h linux-2.6.29.1-imq/include/linux/netfilter_ipv6/ip6t_IMQ.h
---- linux-2.6.29.1/include/linux/netfilter_ipv6/ip6t_IMQ.h	1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.6.29.1-imq/include/linux/netfilter_ipv6/ip6t_IMQ.h	2009-04-12 22:28:22.373333509 +0300
+diff -U 5 -Nr linux-2.6.32/include/linux/netfilter_ipv6/ip6t_IMQ.h linux-2.6.32-imq/include/linux/netfilter_ipv6/ip6t_IMQ.h
+--- linux-2.6.32/include/linux/netfilter_ipv6/ip6t_IMQ.h	1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.32-imq/include/linux/netfilter_ipv6/ip6t_IMQ.h	2009-12-11 14:16:42.679730960 +0200
 @@ -0,0 +1,10 @@
 +#ifndef _IP6T_IMQ_H
 +#define _IP6T_IMQ_H
@@ -786,10 +859,12 @@
 +
 +#endif /* _IP6T_IMQ_H */
 +
-diff -uNr --exclude='*~' linux-2.6.29.1/include/linux/skbuff.h linux-2.6.29.1-imq/include/linux/skbuff.h
---- linux-2.6.29.1/include/linux/skbuff.h	2009-04-02 23:55:27.000000000 +0300
-+++ linux-2.6.29.1-imq/include/linux/skbuff.h	2009-04-12 22:28:22.374333398 +0300
-@@ -28,6 +28,9 @@
+diff -U 5 -Nr linux-2.6.32/include/linux/skbuff.h linux-2.6.32-imq/include/linux/skbuff.h
+--- linux-2.6.32/include/linux/skbuff.h	2009-12-03 05:51:21.000000000 +0200
++++ linux-2.6.32-imq/include/linux/skbuff.h	2009-12-11 14:16:42.680730834 +0200
+@@ -27,10 +27,13 @@
+ #include <linux/textsearch.h>
+ #include <net/checksum.h>
  #include <linux/rcupdate.h>
  #include <linux/dmaengine.h>
  #include <linux/hrtimer.h>
@@ -797,9 +872,13 @@
 +#include <linux/imq.h>
 +#endif
  
- #define HAVE_ALLOC_SKB		/* For the drivers to know */
- #define HAVE_ALIGNABLE_SKB	/* Ditto 8)		   */
-@@ -282,6 +285,9 @@
+ /* Don't change this without changing skb_csum_unnecessary! */
+ #define CHECKSUM_NONE 0
+ #define CHECKSUM_UNNECESSARY 1
+ #define CHECKSUM_COMPLETE 2
+@@ -328,10 +331,13 @@
+ 	 * layer. Please put your private variables there. If you
+ 	 * want to keep them across layers you have to do a skb_clone()
  	 * first. This is owned by whoever has the skb queued ATM.
  	 */
  	char			cb[48];
@@ -809,7 +888,11 @@
  
  	unsigned int		len,
  				data_len;
-@@ -312,6 +318,9 @@
+ 	__u16			mac_len,
+ 				hdr_len;
+@@ -360,10 +366,13 @@
+ 	void			(*destructor)(struct sk_buff *skb);
+ #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
  	struct nf_conntrack	*nfct;
  	struct sk_buff		*nfct_reasm;
  #endif
@@ -819,19 +902,28 @@
  #ifdef CONFIG_BRIDGE_NETFILTER
  	struct nf_bridge_info	*nf_bridge;
  #endif
-@@ -332,6 +341,9 @@
- 	__u8			requeue:1;
+ 
+ 	int			iif;
+@@ -381,10 +390,14 @@
  #endif
+ 	kmemcheck_bitfield_end(flags2);
+ 
  	/* 0/14 bit hole */
+ 
 +#if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE)
 +	__u8			imq_flags:IMQ_F_BITS;
 +#endif
- 
++
  #ifdef CONFIG_NET_DMA
  	dma_cookie_t		dma_cookie;
-@@ -372,6 +384,12 @@
- 			  enum dma_data_direction dir);
  #endif
+ #ifdef CONFIG_NETWORK_SECMARK
+ 	__u32			secmark;
+@@ -435,10 +448,16 @@
+ static inline struct rtable *skb_rtable(const struct sk_buff *skb)
+ {
+ 	return (struct rtable *)skb_dst(skb);
+ }
  
 +
 +#if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE)
@@ -840,9 +932,13 @@
 +#endif
 +
  extern void kfree_skb(struct sk_buff *skb);
+ extern void consume_skb(struct sk_buff *skb);
  extern void	       __kfree_skb(struct sk_buff *skb);
  extern struct sk_buff *__alloc_skb(unsigned int size,
-@@ -1844,6 +1862,10 @@
+ 				   gfp_t priority, int fclone, int node);
+@@ -1970,10 +1989,14 @@
+ 	nf_conntrack_get(src->nfct);
+ 	dst->nfctinfo = src->nfctinfo;
  	dst->nfct_reasm = src->nfct_reasm;
  	nf_conntrack_get_reasm(src->nfct_reasm);
  #endif
@@ -853,10 +949,14 @@
  #ifdef CONFIG_BRIDGE_NETFILTER
  	dst->nf_bridge  = src->nf_bridge;
  	nf_bridge_get(src->nf_bridge);
-diff -uNr --exclude='*~' linux-2.6.29.1/include/net/netfilter/nf_queue.h linux-2.6.29.1-imq/include/net/netfilter/nf_queue.h
---- linux-2.6.29.1/include/net/netfilter/nf_queue.h	2009-04-02 23:55:27.000000000 +0300
-+++ linux-2.6.29.1-imq/include/net/netfilter/nf_queue.h	2009-04-12 22:28:22.374333398 +0300
-@@ -13,6 +13,12 @@
+ #endif
+ }
+diff -U 5 -Nr linux-2.6.32/include/net/netfilter/nf_queue.h linux-2.6.32-imq/include/net/netfilter/nf_queue.h
+--- linux-2.6.32/include/net/netfilter/nf_queue.h	2009-12-03 05:51:21.000000000 +0200
++++ linux-2.6.32-imq/include/net/netfilter/nf_queue.h	2009-12-11 14:16:42.680730834 +0200
+@@ -11,10 +11,16 @@
+ 	u_int8_t		pf;
+ 	unsigned int		hook;
  	struct net_device	*indev;
  	struct net_device	*outdev;
  	int			(*okfn)(struct sk_buff *);
@@ -869,7 +969,11 @@
  };
  
  #define nf_queue_entry_reroute(x) ((void *)x + sizeof(struct nf_queue_entry))
-@@ -30,5 +36,11 @@
+ 
+ /* Packet queuing */
+@@ -28,7 +34,13 @@
+ 				     const struct nf_queue_handler *qh);
+ extern int nf_unregister_queue_handler(u_int8_t pf,
  				       const struct nf_queue_handler *qh);
  extern void nf_unregister_queue_handlers(const struct nf_queue_handler *qh);
  extern void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict);
@@ -881,10 +985,12 @@
 +#endif
  
  #endif /* _NF_QUEUE_H */
-diff -uNr --exclude='*~' linux-2.6.29.1/net/core/dev.c linux-2.6.29.1-imq/net/core/dev.c
---- linux-2.6.29.1/net/core/dev.c	2009-04-02 23:55:27.000000000 +0300
-+++ linux-2.6.29.1-imq/net/core/dev.c	2009-04-12 22:28:22.375333463 +0300
-@@ -96,6 +96,9 @@
+diff -U 5 -Nr linux-2.6.32/net/core/dev.c linux-2.6.32-imq/net/core/dev.c
+--- linux-2.6.32/net/core/dev.c	2009-12-03 05:51:21.000000000 +0200
++++ linux-2.6.32-imq/net/core/dev.c	2009-12-11 14:16:42.681731014 +0200
+@@ -94,10 +94,13 @@
+ #include <linux/notifier.h>
+ #include <linux/skbuff.h>
  #include <net/net_namespace.h>
  #include <net/sock.h>
  #include <linux/rtnetlink.h>
@@ -894,9 +1000,13 @@
  #include <linux/proc_fs.h>
  #include <linux/seq_file.h>
  #include <linux/stat.h>
-@@ -1671,7 +1674,11 @@
+ #include <linux/if_bridge.h>
+ #include <linux/if_macvlan.h>
+@@ -1702,11 +1705,15 @@
+ {
+ 	const struct net_device_ops *ops = dev->netdev_ops;
+ 	int rc;
  
- 	prefetch(&dev->netdev_ops->ndo_start_xmit);
  	if (likely(!skb->next)) {
 -		if (!list_empty(&ptype_all))
 +		if (!list_empty(&ptype_all)
@@ -907,9 +1017,13 @@
  			dev_queue_xmit_nit(skb, dev);
  
  		if (netif_needs_gso(dev, skb)) {
-@@ -1762,8 +1769,7 @@
+ 			if (unlikely(dev_gso_segment(skb)))
+ 				goto out_kfree_skb;
+@@ -1787,12 +1794,11 @@
+ 
  	return (u16) (((u64) hash * dev->real_num_tx_queues) >> 32);
  }
+ EXPORT_SYMBOL(skb_tx_hash);
  
 -static struct netdev_queue *dev_pick_tx(struct net_device *dev,
 -					struct sk_buff *skb)
@@ -917,18 +1031,26 @@
  {
  	const struct net_device_ops *ops = dev->netdev_ops;
  	u16 queue_index = 0;
-@@ -1776,6 +1782,7 @@
+ 
+ 	if (ops->ndo_select_queue)
+@@ -1801,10 +1807,11 @@
+ 		queue_index = skb_tx_hash(dev, skb);
+ 
  	skb_set_queue_mapping(skb, queue_index);
  	return netdev_get_tx_queue(dev, queue_index);
  }
 +EXPORT_SYMBOL(dev_pick_tx);
  
- /**
-  *	dev_queue_xmit - transmit a buffer
-diff -uNr --exclude='*~' linux-2.6.29.1/net/core/skbuff.c linux-2.6.29.1-imq/net/core/skbuff.c
---- linux-2.6.29.1/net/core/skbuff.c	2009-04-02 23:55:27.000000000 +0300
-+++ linux-2.6.29.1-imq/net/core/skbuff.c	2009-04-12 22:28:22.376333314 +0300
-@@ -69,6 +69,9 @@
+ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q,
+ 				 struct net_device *dev,
+ 				 struct netdev_queue *txq)
+ {
+diff -U 5 -Nr linux-2.6.32/net/core/skbuff.c linux-2.6.32-imq/net/core/skbuff.c
+--- linux-2.6.32/net/core/skbuff.c	2009-12-03 05:51:21.000000000 +0200
++++ linux-2.6.32-imq/net/core/skbuff.c	2009-12-11 15:12:39.294981618 +0200
+@@ -70,10 +70,13 @@
+ 
+ #include "kmap_skb.h"
  
  static struct kmem_cache *skbuff_head_cache __read_mostly;
  static struct kmem_cache *skbuff_fclone_cache __read_mostly;
@@ -938,7 +1060,11 @@
  
  static void sock_pipe_buf_release(struct pipe_inode_info *pipe,
  				  struct pipe_buffer *buf)
-@@ -88,6 +91,80 @@
+ {
+ 	put_page(buf->page);
+@@ -89,10 +92,87 @@
+ 			       struct pipe_buffer *buf)
+ {
  	return 1;
  }
  
@@ -998,17 +1124,20 @@
 +}
 +EXPORT_SYMBOL(skb_restore_cb);
 +
-+static void skb_copy_stored_cb(struct sk_buff *new, struct sk_buff *old)
++static void skb_copy_stored_cb(struct sk_buff *new, const struct sk_buff *__old)
 +{
 +	struct skb_cb_table *next;
++	struct sk_buff *old;
 +
-+	if (!old->cb_next) {
-+		new->cb_next = 0;
++	if (!__old->cb_next) {
++		new->cb_next = NULL;
 +		return;
 +	}
 +
 +	spin_lock(&skb_cb_store_lock);
 +
++	old = (struct sk_buff *)__old;
++
 +	next = old->cb_next;
 +	atomic_inc(&next->refcnt);
 +	new->cb_next = next;
@@ -1019,7 +1148,11 @@
  
  /* Pipe buffer operations for a socket. */
  static struct pipe_buf_operations sock_pipe_buf_ops = {
-@@ -381,6 +458,15 @@
+ 	.can_merge = 0,
+ 	.map = generic_pipe_buf_map,
+@@ -396,10 +476,30 @@
+ #endif
+ 	if (skb->destructor) {
  		WARN_ON(in_irq());
  		skb->destructor(skb);
  	}
@@ -1027,15 +1160,30 @@
 +	/* This should not happen. When it does, avoid memleak by restoring
 +	the chain of cb-backups. */
 +	while(skb->cb_next != NULL) {
-+		printk(KERN_WARNING "kfree_skb: skb->cb_next: %08x\n",
-+			skb->cb_next);
++		if (net_ratelimit())
++			printk(KERN_WARNING "IMQ: kfree_skb: skb->cb_next: "
++				"%08x\n", (unsigned int)skb->cb_next);
++
 +		skb_restore_cb(skb);
 +	}
++	/* This should not happen either, nf_queue_entry is nullified in
++	 * imq_dev_xmit(). If we have non-NULL nf_queue_entry then we are
++	 * leaking entry pointers, maybe memory. We don't know if this is
++	 * pointer to already freed memory, or should this be freed.
++	 * If this happens we need to add refcounting, etc for nf_queue_entry.
++	 */
++	if (skb->nf_queue_entry && net_ratelimit())
++		printk(KERN_WARNING
++				"IMQ: kfree_skb: skb->nf_queue_entry != NULL");
 +#endif
  #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
  	nf_conntrack_put(skb->nfct);
  	nf_conntrack_put_reasm(skb->nfct_reasm);
-@@ -621,6 +621,9 @@
+ #endif
+ #ifdef CONFIG_BRIDGE_NETFILTER
+@@ -533,10 +633,13 @@
+ 	skb_dst_set(new, dst_clone(skb_dst(old)));
+ #ifdef CONFIG_XFRM
  	new->sp			= secpath_get(old->sp);
  #endif
  	memcpy(new->cb, old->cb, sizeof(old->cb));
@@ -1045,7 +1193,11 @@
  	new->csum		= old->csum;
  	new->local_df		= old->local_df;
  	new->pkt_type		= old->pkt_type;
-@@ -2664,6 +2753,13 @@
+ 	new->ip_summed		= old->ip_summed;
+ 	skb_copy_queue_mapping(new, old);
+@@ -2774,10 +2877,17 @@
+ 						(2*sizeof(struct sk_buff)) +
+ 						sizeof(atomic_t),
  						0,
  						SLAB_HWCACHE_ALIGN|SLAB_PANIC,
  						NULL);
@@ -1059,12 +1211,16 @@
  }
  
  /**
-diff -uNr --exclude='*~' linux-2.6.29.1/net/netfilter/Kconfig linux-2.6.29.1-imq/net/netfilter/Kconfig
---- linux-2.6.29.1/net/netfilter/Kconfig	2009-04-02 23:55:27.000000000 +0300
-+++ linux-2.6.29.1-imq/net/netfilter/Kconfig	2009-04-12 22:28:22.376333314 +0300
-@@ -357,6 +357,18 @@
+  *	skb_to_sgvec - Fill a scatter-gather list from a socket buffer
+  *	@skb: Socket buffer containing the buffers to be mapped
+diff -U 5 -Nr linux-2.6.32/net/netfilter/Kconfig linux-2.6.32-imq/net/netfilter/Kconfig
+--- linux-2.6.32/net/netfilter/Kconfig	2009-12-03 05:51:21.000000000 +0200
++++ linux-2.6.32-imq/net/netfilter/Kconfig	2009-12-11 14:16:42.681731014 +0200
+@@ -394,10 +394,22 @@
+ 	    echo netfilter-ssh > /sys/class/leds/<ledname>/trigger
  
- 	  To compile it as a module, choose M here.  If unsure, say N.
+ 	  For more information on the LEDs available on your system, see
+ 	  Documentation/leds-class.txt
  
 +config NETFILTER_XT_TARGET_IMQ
 +        tristate '"IMQ" target support'
@@ -1081,21 +1237,29 @@
  config NETFILTER_XT_TARGET_MARK
  	tristate '"MARK" target support'
  	default m if NETFILTER_ADVANCED=n
-diff -uNr --exclude='*~' linux-2.6.29.1/net/netfilter/Makefile linux-2.6.29.1-imq/net/netfilter/Makefile
---- linux-2.6.29.1/net/netfilter/Makefile	2009-04-02 23:55:27.000000000 +0300
-+++ linux-2.6.29.1-imq/net/netfilter/Makefile	2009-04-12 22:28:22.377333406 +0300
-@@ -45,6 +45,7 @@
+ 	help
+ 	  This option adds a `MARK' target, which allows you to create rules
+diff -U 5 -Nr linux-2.6.32/net/netfilter/Makefile linux-2.6.32-imq/net/netfilter/Makefile
+--- linux-2.6.32/net/netfilter/Makefile	2009-12-03 05:51:21.000000000 +0200
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/kernel/kernel-imq.patch?r1=1.5&r2=1.6&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/kernel/kernel.spec?r1=1.749&r2=1.750&f=u



More information about the pld-cvs-commit mailing list