id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
67d92ab765a29cd18674b2b87e9f931782a245e3
Analyze and fix the following issue in the Linux kernel code: cxgb3 - Fix resources release.
Problem Details: Remove sysfs entries before unregistering the net devices. Signed-off-by: Divy Le Ray <divy@chelsio.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
```diff diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c index d92da8fe4a50..9d14652ffdc3 100644 --- a/drivers/net/cxgb3/cxgb3_main.c +++ b/drivers/net/cxgb3/cxgb3_main.c @@ -2585,10 +2585,6 @@ static void __devexit remove_one(struct pci_dev *pdev) sysfs_remove_group(&adapter->port[0]->de...
42256f57d894a4e4aa5af42d04191d7a12f10df9
Analyze and fix the following issue in the Linux kernel code: cxgb3 - fix MSI-X failure path
Problem Details: Return error code when msi-x settings fail. Signed-off-by: Divy Le Ray <divy@chelsio.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
```diff diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c index 61ffc925eae7..bb0d1c841c0f 100644 --- a/drivers/net/cxgb3/cxgb3_main.c +++ b/drivers/net/cxgb3/cxgb3_main.c @@ -839,7 +839,8 @@ static int cxgb_up(struct adapter *adap) if (err) goto irq_err; - if (request_msix_data_irq...
092427be8cef341c957a93ec2469890501a09bff
Analyze and fix the following issue in the Linux kernel code: drivers/net/r6040: fix obvious problems (but more remain)
Problem Details: - checkpatch fixes - fix bogus and uninitialized return codes in r6040_start_xmit() - netdev_get_settings() fix obvious locking bug flagged by compiler warning - set DMA consistent mask - remove unnecessary setting of dev->base_addr Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
```diff diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c index edce5a4c7f20..1d7efa2b6cbc 100644 --- a/drivers/net/r6040.c +++ b/drivers/net/r6040.c @@ -42,12 +42,12 @@ #include <linux/ethtool.h> #include <linux/crc32.h> #include <linux/spinlock.h> +#include <linux/bitops.h> +#include <linux/io.h> +#include <l...
4790654c71b250018ecc234f6b9f1ed96a55572d
Analyze and fix the following issue in the Linux kernel code: [netdrvr] netxen: checkpatch fixes (98% trim trailing whitespace)
Problem Details: Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
```diff diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index b9d2191e03c9..724f75560ddb 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h @@ -113,8 +113,8 @@ #define FLUSH_SCHEDULED_WORK() flush_workqueue(netxen_workq) extern struct workqueue_struct *ne...
7734f6e6bcd7ba78b00e93e74a4ddafd9886cdea
Analyze and fix the following issue in the Linux kernel code: Fix e100 on systems that have cache incoherent DMA
Problem Details: On the systems that have cache incoherent DMA, including ARM, there is a race condition between software allocating a new receive buffer and hardware writing into a buffer. The two race on touching the last Receive Frame Descriptor (RFD). It has its el-bit set and its next link equal to 0. When hard...
```diff diff --git a/drivers/net/e100.c b/drivers/net/e100.c index 597fd2953658..d87636dbdea5 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c @@ -106,6 +106,13 @@ * the RFD, the RFD must be dma_sync'ed to maintain a consistent * view from software and hardware. * + * In order to keep updates to the RFD l...
3957d63da0067ad6a7dc8261b7eeb824f9dc42b4
Analyze and fix the following issue in the Linux kernel code: ixgbe: Fix copper PHY initialization code
Problem Details: While cleaning up the internal API focussing on Fiber and CX4 code we found that I had broken the copper PHY initialization code. This patch restores the PHY-specific code. This is mostly uninteresting since no copper PHY boards are yet available. The changes have been tested against Fiber only as I do...
```diff diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h index bc51432b8d26..a021a6e72641 100644 --- a/drivers/net/ixgbe/ixgbe.h +++ b/drivers/net/ixgbe/ixgbe.h @@ -234,14 +234,10 @@ enum ixbge_state_t { }; enum ixgbe_boards { - board_82598AF, - board_82598EB, - board_82598AT, + board_82598, }; ...
1eae4eb2a1c784bf35ee4f8f158cd21cf8c387c1
Analyze and fix the following issue in the Linux kernel code: e1000e: Disable L1 ASPM power savings for 82573 mobile variants
Problem Details: L1 ASPM link (pci-e link power savings) has significant benefits (~1W savings when link is active) but unfortunately does not work correctly on any of the chipsets that have 82573 on mobile platforms which causes various nuisances: - eeprom reads return garbage information leading to bad eeprom che...
```diff diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c index b6401abc17d6..45f5ee29343f 100644 --- a/drivers/net/e1000e/82571.c +++ b/drivers/net/e1000e/82571.c @@ -1343,7 +1343,6 @@ struct e1000_info e1000_82573_info = { | FLAG_HAS_STATS_ICR_ICT | FLAG_HAS_SMART_POWER_DOWN | ...
28fc1f5a0c375cb6375fa48e9a8b393f2a189be6
Analyze and fix the following issue in the Linux kernel code: [netdrvr] irq handler minor cleanups in several drivers
Problem Details: * use irq_handler_t where appropriate * no need to use 'irq' function arg, its already stored in a data struct * rename irq handler 'irq' argument to 'dummy', where the function has been analyzed and proven not to use its first argument. * remove always-false "dev_id == NULL" test from irq handler...
```diff diff --git a/arch/ia64/hp/sim/simeth.c b/arch/ia64/hp/sim/simeth.c index 08b117e2c54b..9898febf609a 100644 --- a/arch/ia64/hp/sim/simeth.c +++ b/arch/ia64/hp/sim/simeth.c @@ -497,11 +497,6 @@ simeth_interrupt(int irq, void *dev_id) { struct net_device *dev = dev_id; - if ( dev == NULL ) { - printk(KERN_WA...
f59d9782751bf1a2c51e7e1e9f614ffec35fb52e
Analyze and fix the following issue in the Linux kernel code: wireless: fix '!x & y' typo's
Problem Details: Fix priority mistakes similar to '!x & y' Signed-off-by: Roel Kluin <12o3l@tiscali.nl> Signed-off-by: John W. Linville <linville@tuxdriver.com>
```diff diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index 074055e18c5c..e3eca6d047c7 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c @@ -6407,7 +6407,7 @@ static int airo_set_encode(struct net_device *dev, set_wep_key(local, index, NULL, 0, perm, 1); } else ...
af7cca2a441f6e2ebeb2a920ef5af1bec8df96e8
Analyze and fix the following issue in the Linux kernel code: iwlwifi: rename restricted_mem to targ_mem
Problem Details: This patch renames restricted_mem suffix with more proper name targ_mem for function accessing memory on the nic in target mode Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
```diff diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index 59e2fa270924..077fa1023fe5 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c @@ -96,7 +96,7 @@ const struct iwl_rate_info iwl_rates[IWL_RATE_COUNT] = { * ... ...
d860965200c867e7e3e81ede8572cffff8c7eb24
Analyze and fix the following issue in the Linux kernel code: iwlwifi: replace restricted_reg with prph
Problem Details: This patch renames restricted_reg suffix with more proper name prhp for function accessing registers on the periphery bus. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
```diff diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index 1fda41107df1..59e2fa270924 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c @@ -733,7 +733,7 @@ static int iwl3945_nic_set_pwr_src(struct iwl_priv *priv, int pwr...
dc2453ae81785f7e4f48485013b89df0a951421e
Analyze and fix the following issue in the Linux kernel code: iwlwifi: rs-4965 fix return values
Problem Details: This patch cleans up style of 'return' of rate scale 4965 functions. It renames return name variables rc to ret, change functions to void if no meaningful value was returned it add return of -EINVAL for checks of wrong arguments. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Zh...
```diff diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c index 2227ee4ad1af..b557faa6ff08 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c @@ -202,8 +202,6 @@ static int rs_send_lq_cmd(struct iwl_priv *priv, #if...
01ebd063e11bdcf1ddc605d968ea89aef48e34e0
Analyze and fix the following issue in the Linux kernel code: iwlwifi: fix various spelling and typos
Problem Details: Fixing various spelling errors and typos. Mostly in comments. In total 27 words were corrected, some of which occurred more than ones. Signed-Of-By: Ian Schram <ischram@telenet.be> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
```diff diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-hw.h b/drivers/net/wireless/iwlwifi/iwl-3945-hw.h index fb5f0649f4f6..90d4249fa7f2 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945-hw.h +++ b/drivers/net/wireless/iwlwifi/iwl-3945-hw.h @@ -8,7 +8,7 @@ * Copyright(c) 2005 - 2007 Intel Corporation. All right...
2676c94d4e5994f92e57fa3ea680f1d652049d03
Analyze and fix the following issue in the Linux kernel code: rt2x00: Rework rt73 antenna selection
Problem Details: This patch changes rt73 antenna selection to what I believe is the correct way. It also fixes a small selection bug that switched the antennas by accident. Signed-off-by: Mattias Nissler <mattias.nissler@gmx.de> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville...
```diff diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index 6b6649624470..0cc815000d62 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c @@ -399,6 +399,7 @@ static void rt73usb_config_antenna_5x(struct rt2x00_dev *rt2x00dev, u8 ...
16b1951f53c6097d7355e76ed9ca64b056f88f31
Analyze and fix the following issue in the Linux kernel code: [PATCH] rt2x00: Fix antenna selection.
Problem Details: In the config() handler, make sure that we do configure an antenna if the current active antenna is uninitialized. Furthermore, don't overwrite the active antenna with bogus values if we didn't touch the antenna setup. Signed-off-by: Mattias Nissler <mattias.nissler@gmx.de> Signed-off-by: Ivo van Door...
```diff diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c b/drivers/net/wireless/rt2x00/rt2x00config.c index 2b0edd20eea5..b4fad744503e 100644 --- a/drivers/net/wireless/rt2x00/rt2x00config.c +++ b/drivers/net/wireless/rt2x00/rt2x00config.c @@ -166,6 +166,8 @@ void rt2x00lib_config(struct rt2x00_dev *rt2x00dev, ...
ddc827f93a2f2a7dcfda5b691d046af4dfe76427
Analyze and fix the following issue in the Linux kernel code: [PATCH] rt2x00: Cleanup if-statements
Problem Details: Cleanup if-statements for simple 1/0 register field values. This also fixes a endian bug in rt2500usb when working with the PHY_CSR2 initialization. As well as a bug in the enabling of the LED in rt73usb. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdr...
```diff diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c index 5b3adbae4820..fc162122617e 100644 --- a/drivers/net/wireless/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/rt2x00/rt2400pci.c @@ -524,18 +524,10 @@ static void rt2400pci_enable_led(struct rt2x00_dev *rt2x00dev) ...
66688ea7c8e5cb3ea987d8945fffd099ce80a299
Analyze and fix the following issue in the Linux kernel code: [SCTP]: Fix build warning in sctp_sf_do_5_1C_ack().
Problem Details: Reported by Andrew Morton. net/sctp/sm_statefuns.c: In function 'sctp_sf_do_5_1C_ack': net/sctp/sm_statefuns.c:484: warning: 'error' may be used uninitialized in this function Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index b1267519183b..6e127573594e 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c @@ -481,7 +481,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep, sctp_init_chunk_t *initchunk; struct sctp_chunk *err_c...
b59cfbf77dc8368c2c90b012c79553613f4d70c3
Analyze and fix the following issue in the Linux kernel code: [FIB]: Fix rcu_dereference() abuses in fib_trie.c
Problem Details: node_parent() and tnode_get_child() currently use rcu_dereference(). These functions are called from both - readers only paths (where rcu_dereference() is needed), and - writer path (where rcu_dereference() is not needed) To make explicit where rcu_dereference() is really needed, I introduced new nod...
```diff diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index fbc80d15827b..a52334d30cf8 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c @@ -165,9 +165,13 @@ static struct kmem_cache *fn_alias_kmem __read_mostly; static inline struct tnode *node_parent(struct node *node) { - struct tnode *ret; + r...
13b0e83b5b52d1a0ab87772ecc93fe91b2740386
Analyze and fix the following issue in the Linux kernel code: [NETFILTER]: xt_pkttype: Add explicit check for IPv4
Problem Details: In the PACKET_LOOPBACK case, the skb data was always interpreted as IPv4, but that is not valid for IPv6, obviously. Fix this by adding an extra condition to check for AF_INET. Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David...
```diff diff --git a/net/netfilter/xt_pkttype.c b/net/netfilter/xt_pkttype.c index 276244902ab5..080f3246eee7 100644 --- a/net/netfilter/xt_pkttype.c +++ b/net/netfilter/xt_pkttype.c @@ -31,7 +31,8 @@ pkttype_mt(const struct sk_buff *skb, const struct net_device *in, const struct xt_pkttype_info *info = matchinfo; ...
cdfe8b9797f1a47fe24a9bf9e98a351bae11ab99
Analyze and fix the following issue in the Linux kernel code: [NETFILTER]: xt_TOS: Properly set the TOS field
Problem Details: Fix incorrect mask value passed to ipv4_change_dsfield/ipv6_change_dsfield. Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/netfilter/xt_DSCP.c b/net/netfilter/xt_DSCP.c index 9951e7f85e32..3d216d650c82 100644 --- a/net/netfilter/xt_DSCP.c +++ b/net/netfilter/xt_DSCP.c @@ -134,7 +134,7 @@ tos_tg(struct sk_buff *skb, const struct net_device *in, if (!skb_make_writable(skb, sizeof(struct iphdr))) return NF_DROP...
2db82b534bd52b349f1b2ab3e63aa40ca0e466ab
Analyze and fix the following issue in the Linux kernel code: [NETNS]: Make arp code network namespace consistent.
Problem Details: Some calls in the arp.c have network namespace as an argument. Getting init_net inside these functions is simply inconsistent. Fix this. Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index d12f31b0c107..357e8987146b 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c @@ -973,13 +973,13 @@ static int arp_req_set_public(struct net *net, struct arpreq *r, if (mask && mask != htonl(0xFFFFFFFF)) return -EINVAL; if (!dev && (r->arp_flags & ATF_COM)...
8d96544475b236a0f319e492f4828aa8c0801c7f
Analyze and fix the following issue in the Linux kernel code: [FIB]: full_children & empty_children should be uint, not ushort
Problem Details: If declared as unsigned short, these fields can overflow, and whole trie logic is broken. I could not make the machine crash, but some tnode can never be freed. Note for 64 bit arches : By reordering t_key and parent in [node, leaf, tnode] structures, we can use 32 bits hole after t_key so that sizeof...
```diff diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index da6681ddc509..18fb73958a49 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c @@ -97,13 +97,13 @@ typedef unsigned int t_key; #define IS_LEAF(n) (n->parent & T_LEAF) struct node { - t_key key; unsigned long parent; + t_key key; }; st...
3f4afb6443aaa1d69b2d8f0461c8191e40d54c3c
Analyze and fix the following issue in the Linux kernel code: [XFRM]: Fix struct xfrm_algo code formatting.
Problem Details: Realign struct members. Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index f8507eed0b79..9b5b00c4ef9d 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h @@ -91,9 +91,9 @@ struct xfrm_replay_state }; struct xfrm_algo { - char alg_name[64]; + char alg_name[64]; unsigned int alg_key_len; /* in bits */ - ch...
c95aaf9af5a1f6dee56d1f2ab4915cd722d608da
Analyze and fix the following issue in the Linux kernel code: [IPV4] fib_trie: Fix sparse warnings.
Problem Details: Make FIB TRIE go through sparse checker without warnings. Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index 2075eea7eea7..3e94a4dddb0c 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c @@ -653,7 +653,6 @@ static struct node *resize(struct trie *t, struct tnode *tn) static struct tnode *inflate(struct trie *t, struct tnode *tn) { - struct tnode ...
66a2f7fd2fddee1ddc5d1d286cd832e50a97258e
Analyze and fix the following issue in the Linux kernel code: [IPV4] fib_trie: Add statistics.
Problem Details: The FIB TRIE code has a bunch of statistics, but the code is hidden behind an ifdef that was never implemented. Since it was dead code, it was broken as well. This patch fixes that by making it a config option. Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com> Signed-off-by: David S. Mi...
```diff diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig index 9f9fd2c6f6e2..24e2b7294bf8 100644 --- a/net/ipv4/Kconfig +++ b/net/ipv4/Kconfig @@ -85,6 +85,13 @@ endchoice config IP_FIB_HASH def_bool ASK_IP_FIB_HASH || !IP_ADVANCED_ROUTER +config IP_FIB_TRIE_STATS + bool "FIB TRIE statistics" + depends on IP_FIB_T...
a6db9010922f2c02db2bbea8c17c50e451be38d9
Analyze and fix the following issue in the Linux kernel code: [IPV4] FIB: printk related cleanups
Problem Details: printk related cleanups: * Get rid of unused printk wrappers. * Make bug checks into KERN_WARNING because KERN_DEBUG gets ignored * Turn one cryptic old message into something real * Make sure all messages have KERN_XXX Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com> Signed-off-by:...
```diff diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 64421c520a0e..02b5ff73357f 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c @@ -47,8 +47,6 @@ #include <net/ip_fib.h> #include <net/rtnetlink.h> -#define FFprint(a...) printk(KERN_DEBUG a) - #ifndef CONFIG_IP_MULTIPLE_TA...
e5d69b9f4a6ce17f0d09595da45e37b870fee5ae
Analyze and fix the following issue in the Linux kernel code: [ATM]: Oops reading net/atm/arp
Problem Details: cat /proc/net/atm/arp causes the NULL pointer dereference in the get_proc_net+0xc/0x3a. This happens as proc_get_net believes that the parent proc dir entry contains struct net. Fix this assumption for "net/atm" case. The problem is introduced by the commit c0097b07abf5f92ab135d024dd41bd2aada1512f fr...
```diff diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c index cfc4f6c072f1..4823c9677fac 100644 --- a/fs/proc/proc_net.c +++ b/fs/proc/proc_net.c @@ -96,6 +96,17 @@ static struct proc_dir_entry *proc_net_shadow(struct task_struct *task, return task->nsproxy->net_ns->proc_net; } +struct proc_dir_entry *proc_ne...
1b507e7e538ee1c8a25e698911a44604d6be3954
Analyze and fix the following issue in the Linux kernel code: rc80211-pid: fix definition of rate control interval
Problem Details: Fix the rate control interval definition. Thanks to Mattias Nissler for spotting this out. Cc: Mattias Nissler <mattias.nissler@gmx.de> Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/mac80211/rc80211_pid.h b/net/mac80211/rc80211_pid.h index b98e16afe4d1..04afc13ed825 100644 --- a/net/mac80211/rc80211_pid.h +++ b/net/mac80211/rc80211_pid.h @@ -10,8 +10,8 @@ #ifndef RC80211_PID_H #define RC80211_PID_H -/* Sampling period for measuring percentage of failed frames. */ -#def...
13e05aa631b195ce30737b320da17e7542c82ead
Analyze and fix the following issue in the Linux kernel code: rc80211-pid: fix sta_info refcounting
Problem Details: Fix a bug which caused uncorrect refcounting of PHYs in mac80211. Thanks to Johannes Berg for spotting this out. Cc: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Mille...
```diff diff --git a/net/mac80211/rc80211_pid_algo.c b/net/mac80211/rc80211_pid_algo.c index 3e26280d3142..da3529017da1 100644 --- a/net/mac80211/rc80211_pid_algo.c +++ b/net/mac80211/rc80211_pid_algo.c @@ -254,7 +254,7 @@ static void rate_control_pid_tx_status(void *priv, struct net_device *dev, /* Ignore all frames...
fa44327c06492c9bd625dbc8dbe35e5d5965fec6
Analyze and fix the following issue in the Linux kernel code: rc80211-pid: simplify and fix shift_adjust
Problem Details: Simplify and fix rate_control_pid_shift_adjust(). A bug prevented correct mapping of sorted rates, and readability was seriously flawed. Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net...
```diff diff --git a/net/mac80211/rc80211_pid_algo.c b/net/mac80211/rc80211_pid_algo.c index b84e51480c84..3e26280d3142 100644 --- a/net/mac80211/rc80211_pid_algo.c +++ b/net/mac80211/rc80211_pid_algo.c @@ -74,29 +74,27 @@ static int rate_control_pid_shift_adjust(struct rc_pid_rateinfo *r, { int i, j, k, tmp; - if...
69f817b654d683265118188bbfb8bc0d8978cce6
Analyze and fix the following issue in the Linux kernel code: mac80211: Restore rx.fc before every invocation of ieee80211_invoke_rx_handlers
Problem Details: This patch fixes a problem with rx handling on multiple interfaces. Especially when using hardware-scanning and a wireless driver (i.e. iwlwifi) which is able to receive data while scanning. The rx handlers can modify the skb and the frame control field (see ieee80211_rx_h_remove_qos_control) but sinc...
```diff diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 505159f8dffc..306e6fc25d8f 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -1746,6 +1746,7 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, prev->dev->name); continue; } + rx.fc = le16_to_cpu(hdr->frame_co...
40ccbf525e55fc6d1f3a88c1e98b13db4dd618db
Analyze and fix the following issue in the Linux kernel code: [PACKET]: Fix sparse warnings in af_packet.c
Problem Details: CHECK net/packet/af_packet.c net/packet/af_packet.c:1876:14: warning: context imbalance in 'packet_seq_start' - wrong count at exit net/packet/af_packet.c:1888:13: warning: context imbalance in 'packet_seq_stop' - unexpected unlock Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: Dav...
```diff diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 43e49f46ad43..b8b827c7062d 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -1870,6 +1870,7 @@ static inline struct sock *packet_seq_idx(struct net *net, loff_t off) } static void *packet_seq_start(struct seq_file *seq, lo...
64c31b3f76482bb64459e786f9eca3bd0164d153
Analyze and fix the following issue in the Linux kernel code: [XFRM] xfrm_policy_destroy: Rename and relative fixes.
Problem Details: Since __xfrm_policy_destroy is used to destory the resources allocated by xfrm_policy_alloc. So using the name __xfrm_policy_destroy is not correspond with xfrm_policy_alloc. Rename it to xfrm_policy_destroy. And along with some instances that call xfrm_policy_alloc but not using xfrm_policy_destroy t...
```diff diff --git a/include/net/xfrm.h b/include/net/xfrm.h index a419a4372e21..5ebb9ba479b1 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -626,12 +626,12 @@ static inline void xfrm_pol_hold(struct xfrm_policy *policy) atomic_inc(&policy->refcnt); } -extern void __xfrm_policy_destroy(struct xfrm_po...
c4e18dade1f878db33ed38927de22e63d550970d
Analyze and fix the following issue in the Linux kernel code: [CCID3]: Kill some bloat
Problem Details: Without a number of CONFIG.*DEBUG: net/dccp/ccids/ccid3.c: ccid3_hc_tx_update_x | -170 ccid3_hc_tx_packet_sent | -175 ccid3_hc_tx_packet_recv | -169 ccid3_hc_tx_no_feedback_timer | -192 ccid3_hc_tx_send_packet | -144 5 functions changed, 850 bytes removed, diff: -...
```diff diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c index d292f23c002e..e76f460af0ea 100644 --- a/net/dccp/ccids/ccid3.c +++ b/net/dccp/ccids/ccid3.c @@ -97,7 +97,7 @@ static inline u64 rfc3390_initial_rate(struct sock *sk) /* * Recalculate t_ipi and delta (should be called whenever X changes) */ ...
cf35f43e6e41b160d8dedd80a127210fd3be9ada
Analyze and fix the following issue in the Linux kernel code: [XFRM]: Kill some bloat
Problem Details: net/xfrm/xfrm_state.c: xfrm_audit_state_delete | -589 xfrm_replay_check | -542 xfrm_audit_state_icvfail | -520 xfrm_audit_state_add | -589 xfrm_audit_state_replay_overflow | -523 xfrm_audit_state_notfound_simple | -509 xfrm_audit_state_notfound ...
```diff diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 65f5ea4ae4c1..2585e4b0d27f 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -2010,8 +2010,8 @@ void __init xfrm_state_init(void) } #ifdef CONFIG_AUDITSYSCALL -static inline void xfrm_audit_helper_sainfo(struct xfrm_state *x, -...
dbb1db8b59fb84d620ab5266366b52c8052ee75c
Analyze and fix the following issue in the Linux kernel code: [IPSEC]: Return EOVERFLOW when output sequence number overflows
Problem Details: Previously we made it an error on the output path if the sequence number overflowed. However we did not set the err variable accordingly. This patch sets err to -EOVERFLOW in that case. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c index 81ad8eb2b283..f4a1047a5573 100644 --- a/net/xfrm/xfrm_output.c +++ b/net/xfrm/xfrm_output.c @@ -66,6 +66,7 @@ static int xfrm_output_one(struct sk_buff *skb, int err) if (unlikely(x->replay.oseq == 0)) { x->replay.oseq--; xfrm_audi...
0883ae0e5599656b5f3b0e9ce474e01dee7dfee4
Analyze and fix the following issue in the Linux kernel code: [IPSEC]: Fix transport-mode async resume on intput without netfilter
Problem Details: When netfilter is off the transport-mode async resumption doesn't work because we don't push back the IP header. This patch fixes that by moving most of the code outside of ifdef NETFILTER since the only part that's not common is the short-circuit in the protocol handler. Signed-off-by: Herbert Xu <h...
```diff diff --git a/net/ipv4/xfrm4_input.c b/net/ipv4/xfrm4_input.c index 33f990d56c91..390dcb1354a5 100644 --- a/net/ipv4/xfrm4_input.c +++ b/net/ipv4/xfrm4_input.c @@ -51,7 +51,11 @@ int xfrm4_transport_finish(struct sk_buff *skb, int async) iph->protocol = XFRM_MODE_SKB_CB(skb)->protocol; -#ifdef CONFIG_NETFI...
fcb8c156c8277ee9d71c8c81587d494c9c5240b3
Analyze and fix the following issue in the Linux kernel code: [IPSEC]: Fix double free on skb on async output
Problem Details: When the output transform returns EINPROGRESS due to async operation we'll free the skb the straight away as if it were an error. This patch fixes that so that the skb is freed when the async operation completes. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <...
```diff diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c index c1ba63efd7cb..81ad8eb2b283 100644 --- a/net/xfrm/xfrm_output.c +++ b/net/xfrm/xfrm_output.c @@ -78,6 +78,8 @@ static int xfrm_output_one(struct sk_buff *skb, int err) spin_unlock_bh(&x->lock); err = x->type->output(x, skb); + if (err ==...
d9727bb2d516bc16bafee4216eec91cd2be5f30a
Analyze and fix the following issue in the Linux kernel code: [XFRM] Documentaion: Fix error example at XFRMOUTSTATEMODEERROR.
Problem Details: Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/Documentation/networking/xfrm_proc.txt b/Documentation/networking/xfrm_proc.txt index ec9045b5c34a..53c1a58b02f1 100644 --- a/Documentation/networking/xfrm_proc.txt +++ b/Documentation/networking/xfrm_proc.txt @@ -60,7 +60,6 @@ XfrmOutStateProtoError: Transformation protocol specific error XfrmO...
b15c4bcd15741b31019379298edfca28dc78029d
Analyze and fix the following issue in the Linux kernel code: [XFRM]: Fix outbound statistics.
Problem Details: Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c index d73003cb2c0e..c1ba63efd7cb 100644 --- a/net/xfrm/xfrm_output.c +++ b/net/xfrm/xfrm_output.c @@ -43,17 +43,23 @@ static int xfrm_output_one(struct sk_buff *skb, int err) do { err = xfrm_state_check_space(x, skb); - if (err) + if (err) { ...
e1af9f270b69a3ad1dcbabb404dd1f40a96f43f5
Analyze and fix the following issue in the Linux kernel code: [XFRM]: Drop packets when replay counter would overflow
Problem Details: According to RFC4303, section 3.3.3 we need to drop outgoing packets which cause the replay counter to overflow: 3.3.3. Sequence Number Generation The sender's counter is initialized to 0 when an SA is established. The sender increments the sequence number (or ESN) counter for this SA an...
```diff diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c index 09514449fe8a..d73003cb2c0e 100644 --- a/net/xfrm/xfrm_output.c +++ b/net/xfrm/xfrm_output.c @@ -57,8 +57,11 @@ static int xfrm_output_one(struct sk_buff *skb, int err) if (x->type->flags & XFRM_TYPE_REPLAY_PROT) { XFRM_SKB_CB(skb)->seq ...
afeb14b49098ba7a51c96e083a4105a0301f94c4
Analyze and fix the following issue in the Linux kernel code: [XFRM]: RFC4303 compliant auditing
Problem Details: This patch adds a number of new IPsec audit events to meet the auditing requirements of RFC4303. This includes audit hooks for the following events: * Could not find a valid SA [sections 2.1, 3.4.2] . xfrm_audit_state_notfound() . xfrm_audit_state_notfound_simple() * Sequence number overflow...
```diff diff --git a/include/net/xfrm.h b/include/net/xfrm.h index f333c95c4189..5d5580ac0101 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -565,26 +565,33 @@ struct xfrm_audit }; #ifdef CONFIG_AUDITSYSCALL -static inline struct audit_buffer *xfrm_audit_start(u32 auid, u32 secid) +static inline struct...
176e4f84423af3105894a7d71b23c1a16678a6be
Analyze and fix the following issue in the Linux kernel code: mac80211: move tx crypto decision
Problem Details: This patch moves the decision making about whether a frame is encrypted with a certain algorithm up into the TX handlers rather than having it in the crypto algorithm implementation. This fixes a problem with the radiotap injection code where injecting a non-data packet and requesting encryption could...
```diff diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index f7aff2e97eea..8302c70da9a4 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -438,11 +438,7 @@ static ieee80211_txrx_result ieee80211_tx_h_select_key(struct ieee80211_txrx_data *tx) { struct ieee80211_key *key; - const struct ieee80211_hdr *hd...
a1464ab61e66c96f9cffea335755de850fe8bdbd
Analyze and fix the following issue in the Linux kernel code: doc: fix typo in feature-removal-schedule
Problem Details: Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index a6cf8f6fc586..2c3ae6c02a47 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt @@ -307,7 +307,7 @@ Who: John W. Linville <linville@tuxdriver.com> ---...
68277accb3a5f004344f4346498640601b8b7016
Analyze and fix the following issue in the Linux kernel code: [XFRM]: Assorted IPsec fixups
Problem Details: This patch fixes a number of small but potentially troublesome things in the XFRM/IPsec code: * Use the 'audit_enabled' variable already in include/linux/audit.h Removed the need for extern declarations local to each XFRM audit fuction * Convert 'sid' to 'secid' everywhere we can The 'sid' na...
```diff diff --git a/include/net/xfrm.h b/include/net/xfrm.h index a79702bcdcd0..f333c95c4189 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -565,7 +565,7 @@ struct xfrm_audit }; #ifdef CONFIG_AUDITSYSCALL -static inline struct audit_buffer *xfrm_audit_start(u32 auid, u32 sid) +static inline struct aud...
9473e1f631de339c50bde1e3bd09e1045fe90fd5
Analyze and fix the following issue in the Linux kernel code: [XFRM] MIPv6: Fix to input RO state correctly.
Problem Details: Disable spin_lock during xfrm_type.input() function. Follow design as IPsec inbound does. Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/ipv6/xfrm6_input.c b/net/ipv6/xfrm6_input.c index 74f3aacebb5e..f835ab458f5b 100644 --- a/net/ipv6/xfrm6_input.c +++ b/net/ipv6/xfrm6_input.c @@ -63,10 +63,26 @@ int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr, struct xfrm_state *x = NULL; int wildcard = 0; xfrm_address_t ...
a1b051405bc16222d92c73b0c26d65b333a154ee
Analyze and fix the following issue in the Linux kernel code: [XFRM] IPv6: Fix dst/routing check at transformation.
Problem Details: IPv6 specific thing is wrongly removed from transformation at net-2.6.25. This patch recovers it with current design. o Update "path" of xfrm_dst since IPv6 transformation should care about routing changes. It is required by MIPv6 and off-link destined IPsec. o Rename nfheader_len which is for non...
```diff diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 14830edc2ac0..d8d85b13364d 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h @@ -101,7 +101,7 @@ struct rt6_info atomic_t rt6i_ref; /* more non-fragment space at head required */ - unsigned short nfheader_len; + unsigned sho...
bd515c3e48ececd774eb3128e81b669dbbd32637
Analyze and fix the following issue in the Linux kernel code: [TCP]: Fix TSO deferring
Problem Details: I'd say that most of what tcp_tso_should_defer had in between there was dead code because of this. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 9a985b55e7d8..7c50271ddc30 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -1230,7 +1230,8 @@ static int tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb) goto send_now; /* Defer for less than two clock ticks. */ ...
ef167e27039eeaea6d3cdd5c547b082e89840bdd
Analyze and fix the following issue in the Linux kernel code: [TG3]: Fix supporting flowctrl code
Problem Details: This patch does three things. It modifies tg3_setup_flow_control() to use the administrator requested flow control settings if autonegotiation is turned off. It slightly modifies the tg3_setup_fiber_mii_phy() function to account for this new use case. And finally, it does the same for tg3_setup_coppe...
```diff diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index cdade05bdd07..b2f505d6ea94 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c @@ -1694,7 +1694,8 @@ static void tg3_setup_flow_control(struct tg3 *tp, u32 local_adv, u32 remote_adv u32 old_rx_mode = tp->rx_mode; u32 old_tx_mode = tp->tx_mode; - ...
195ad6a3ac8b5c4eef4916efcb673e96e6f09d89
Analyze and fix the following issue in the Linux kernel code: [IPSEC]: Rename tunnel-mode functions to avoid collisions with tunnels
Problem Details: It appears that I've managed to create two different functions both called xfrm6_tunnel_output. This is because we have the plain tunnel encapsulation named xfrmX_tunnel as well as the tunnel-mode encapsulation which lives in the files xfrmX_mode_tunnel.c. This patch renames functions from the latter...
```diff diff --git a/net/ipv4/xfrm4_mode_tunnel.c b/net/ipv4/xfrm4_mode_tunnel.c index aa335dba8ffa..8dee617ee900 100644 --- a/net/ipv4/xfrm4_mode_tunnel.c +++ b/net/ipv4/xfrm4_mode_tunnel.c @@ -26,7 +26,7 @@ static inline void ipip_ecn_decapsulate(struct sk_buff *skb) * * The top IP header will be constructed per ...
1abbe498e4b5e4f2000dfc30a0fa25be9553530e
Analyze and fix the following issue in the Linux kernel code: mac80211: clean up rate selection
Problem Details: Move some code out of rc80211_simple since it's probably needed for all rate selection algorithms, and fix iwlwifi accordingly. While at it, clean up the rate_control_get_rate() interface. Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it> Signed-off-by: John W. Linville <linville@tuxdriver.com>...
```diff diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c index c48b1b537d2b..ea7f459e961b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c @@ -562,22 +562,6 @@ static void rs_tx_status(void *priv_rate, return; ...
98f0b0a3a412eade153c7cf00c6b863600980d89
Analyze and fix the following issue in the Linux kernel code: mac80211: pass in PS_POLL frames
Problem Details: This patch fixes should_drop_frame function to pass in ps poll control frames required for power save functioanlity. Interface types that do not have interest for PS POLL frames now drop it in handler. Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com> Acked-by: Johannes Berg <johannes@sipsoluti...
```diff diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 9cd59ecbcd67..e65da5780cd3 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -61,8 +61,10 @@ static inline int should_drop_frame(struct ieee80211_rx_status *status, return 1; if (unlikely(skb->len < 16 + present_fcs_len + radiotap_len)) re...
d647b36a69bf0a630ebf981bde3c0651e2779e5e
Analyze and fix the following issue in the Linux kernel code: [SNMP]: Fix SNMP counters with PREEMPT
Problem Details: The SNMP macros use raw_smp_processor_id() in process context which is illegal because the process may be preempted and then migrated to another CPU. This patch makes it use get_cpu/put_cpu to disable preemption. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <...
```diff diff --git a/include/net/snmp.h b/include/net/snmp.h index 9c5793db637f..fbb66663a42c 100644 --- a/include/net/snmp.h +++ b/include/net/snmp.h @@ -23,6 +23,7 @@ #include <linux/cache.h> #include <linux/snmp.h> +#include <linux/smp.h> /* * Mibs are stored in array of unsigned long. @@ -135,14 +136,26 @@...
910ef70aa301eb018255683499b8e51426c213a0
Analyze and fix the following issue in the Linux kernel code: [IPSEC]: Do xfrm_state_check_space before encapsulation
Problem Details: While merging the IPsec output path I moved the encapsulation output operation to the top of the loop so that it sits outside of the locked section. Unfortunately in doing so it now sits in front of the space check as well which could be a fatal error. This patch rearranges the calls so that the spac...
```diff diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c index 3c277a4d0e78..26fa0cb78c94 100644 --- a/net/xfrm/xfrm_output.c +++ b/net/xfrm/xfrm_output.c @@ -33,16 +33,6 @@ static int xfrm_state_check_space(struct xfrm_state *x, struct sk_buff *skb) return 0; } -static int xfrm_state_check(struct xfrm...
c0506365a928adfd5608ed6873a705ae18e2daaf
Analyze and fix the following issue in the Linux kernel code: [NETFILTER]: nfnetlink_log: fix checks in nfulnl_recv_config
Problem Details: Similar to the nfnetlink_queue fixes: The peer_pid must be checked in all cases when a logging instance exists, additionally we must check whether an instance exists before attempting to configure it to avoid NULL ptr dereferences. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David...
```diff diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c index 02e63577e156..3dcc6f51a52e 100644 --- a/net/netfilter/nfnetlink_log.c +++ b/net/netfilter/nfnetlink_log.c @@ -753,9 +753,15 @@ nfulnl_recv_config(struct sock *ctnl, struct sk_buff *skb, UDEBUG("entering for msg %u\n", NFNL_MSG_TY...
d978e5daec544ec72b28bf72a30dc9ac3da23a35
Analyze and fix the following issue in the Linux kernel code: [NETFILTER]: ctnetlink: fix expectation timeout dumping
Problem Details: When the timer is late its timeout might be before the current time, in which case a very large value is dumped. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index dcd0c9a4bb75..75012585efe0 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c @@ -1356,7 +1356,10 @@ ctnetlink_exp_dump_expect(struct sk_buff *skb, const struct nf_connt...
b5dd674b2a1de5925955a088b0a10f81484e975a
Analyze and fix the following issue in the Linux kernel code: [NETFILTER]: ip6_tables: fix stack leagage
Problem Details: Fix leakage of local variable on stack. This already got fixed in ip_tables silently by the compat patches. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index 40893fc05926..fc4c62fddfe7 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c @@ -1154,7 +1154,7 @@ static int get_info(void __user *user, int *len, int compat) sizeof(info.underflow));...
c9d8fe13175140c79982f9d29c6921328f9afad6
Analyze and fix the following issue in the Linux kernel code: [NETFILTER]: {ip,ip6}_tables: fix format strings
Problem Details: Use %zu for sizeof() and remove casts. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c index 231f5d290755..98c65ac47d4c 100644 --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c @@ -1091,8 +1091,8 @@ static int get_info(void __user *user, int *len, int compat) int ret; if (*len != sizeof(stru...
73cd598df46a73d6f02063f2520df115a9b88aa5
Analyze and fix the following issue in the Linux kernel code: [NETFILTER]: ip_tables: fix compat types
Problem Details: Use compat types and compat iterators when dealing with compat entries for clarity. This doesn't actually make a difference for ip_tables, but is needed for ip6_tables and arp_tables. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h index 1e0cfca7f354..45fcad91e67b 100644 --- a/include/linux/netfilter_ipv4/ip_tables.h +++ b/include/linux/netfilter_ipv4/ip_tables.h @@ -236,11 +236,6 @@ ipt_get_target(struct ipt_entry *e) #define IPT_ENTRY_ITERA...
17159b0b494ad27f397f914d6eab1b91faf57630
Analyze and fix the following issue in the Linux kernel code: [PARISC]: Fix build after ipv4_is_*() changes.
Problem Details: Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/parisc/led.c b/drivers/parisc/led.c index a6d6b2488ffc..703b85edb004 100644 --- a/drivers/parisc/led.c +++ b/drivers/parisc/led.c @@ -364,7 +364,7 @@ static __inline__ int led_get_net_activity(void) struct in_device *in_dev = __in_dev_get_rcu(dev); if (!in_dev || !in_dev->ifa_li...
1bf40954cf232a043a49623cf251f787c1871e64
Analyze and fix the following issue in the Linux kernel code: [PACKET]: Fix /proc/net/packet crash due to bogus private pointer
Problem Details: The seq_open_net patch changed the meaning of seq->private. Unfortunately it missed two spots in AF_PACKET, which still used the old way of dereferencing seq->private, thus causing weird and wonderful crashes when reading /proc/net/packet. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed...
```diff diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 485af5691d64..43e49f46ad43 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -1878,7 +1878,7 @@ static void *packet_seq_start(struct seq_file *seq, loff_t *pos) static void *packet_seq_next(struct seq_file *seq, void *v, lof...
4bda4f250d21c3e4f2a2da5f4cef829a434a4046
Analyze and fix the following issue in the Linux kernel code: [XFRM]: Fix potential race vs xfrm_state(only)_find and xfrm_hash_resize.
Problem Details: The _find calls calculate the hash value using the xfrm_state_hmask, without the xfrm_state_lock. But the value of this mask can change in the _resize call under the state_lock, so we risk to fail in finding the desired entry in hash. I think, that the hash value is better to calculate under the state...
```diff diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index b2343d48fe96..f7c0951c9fd9 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -756,7 +756,7 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, struct xfrm_policy *pol, int *err, unsigned short family) { - unsign...
8a4a50f98bc13670bee94c40b94bc169e1263cd9
Analyze and fix the following issue in the Linux kernel code: [IPV6] sit: Rebinding of SIT tunnels to other interfaces
Problem Details: This is similar to the change already done for IPIP tunnels. Once created, a SIT tunnel can't be bound to another device. To reproduce: # create a tunnel: ip tunnel add tunneltest0 mode sit remote 10.0.0.1 dev eth0 # try to change the bounding device from eth0 to eth1: ip tunnel change tunneltest0 de...
```diff diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index b3b8513e9cb7..1c6fddb80b37 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c @@ -669,6 +669,42 @@ tx_error: return 0; } +static void ipip6_tunnel_bind_dev(struct net_device *dev) +{ + struct net_device *tdev = NULL; + struct ip_tunnel *tunnel; + struct iphd...
ee34c1eb35923cc98b1c47488a615bf51a2a2afb
Analyze and fix the following issue in the Linux kernel code: [IP_GRE]: Rebinding of GRE tunnels to other interfaces
Problem Details: This is similar to the change already done for IPIP tunnels. Once created, a GRE tunnel can't be bound to another device. To reproduce: # create a tunnel: ip tunnel add tunneltest0 mode gre remote 10.0.0.1 dev eth0 # try to change the bounding device from eth0 to eth1: ip tunnel change tunneltest0 de...
```diff diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 4b93f32de10d..0832f6e028b8 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -896,6 +896,59 @@ tx_error: return 0; } +static void ipgre_tunnel_bind_dev(struct net_device *dev) +{ + struct net_device *tdev = NULL; + struct ip_tunnel *tunnel; +...
aef21785995778f710a60b563e03bf53ba455a47
Analyze and fix the following issue in the Linux kernel code: [IPSEC]: Fix zero return value in xfrm_lookup on error
Problem Details: Further testing shows that my ICMP relookup patch can cause xfrm_lookup to return zero on error which isn't very nice since it leads to the caller dying on null pointer dereference. The bug is due to not setting err to ENOENT just before we leave xfrm_lookup in case of no policy. This patch moves the...
```diff diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index a83b5e1349ed..8023a3c0dad5 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -1469,8 +1469,6 @@ restart: goto dropdst; } - err = -ENOENT; - if (!policy) { /* To accelerate a bit... */ if ((dst_orig->flags & DST...
09f7709f4929666006931f1d4efc498a6d419bbc
Analyze and fix the following issue in the Linux kernel code: [IPV6]: fix section mismatch warnings
Problem Details: Removed useless and buggy __exit section in the different ipv6 subsystems. Otherwise they will be called inside an init section during rollbacking in case of an error in the protocol initialization. Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net...
```diff diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index ba6f7925c178..6a48bb88f46d 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -4223,7 +4223,7 @@ errout: return err; } -void __exit addrconf_cleanup(void) +void addrconf_cleanup(void) { struct net_device *dev; struct inet6_ifaddr ...
96eba69dbac767f4e287df39e6fa489d37f1aa7b
Analyze and fix the following issue in the Linux kernel code: [DECNET]: Fix inverted wait flag in xfrm_lookup call
Problem Details: My previous patch made the wait flag take the opposite value to what it should be. This patch fixes that. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c index 73a13075b7ee..b712d0b36526 100644 --- a/net/decnet/dn_route.c +++ b/net/decnet/dn_route.c @@ -1197,7 +1197,7 @@ int dn_route_output_sock(struct dst_entry **pprt, struct flowi *fl, struct sock err = __dn_route_output_key(pprt, fl, flags & MSG_TRY...
aebcf82c1fe9231be5cb4f9c1362d5db39e7d7b2
Analyze and fix the following issue in the Linux kernel code: [IPSEC]: Do not let packets pass when ICMP flag is off
Problem Details: This fixes a logical error in ICMP policy checks which lets packets through if the state ICMP flag is off. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index c41f3cc4fba8..ce5b4be559aa 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c @@ -977,10 +977,13 @@ int icmp_rcv(struct sk_buff *skb) struct icmphdr *icmph; struct rtable *rt = (struct rtable *)skb->dst; - if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, s...
7233b9f33e72ca477034ff5cf901c89efba3a5bc
Analyze and fix the following issue in the Linux kernel code: [IPSEC]: Fix reversed ICMP6 policy check
Problem Details: The policy check I added for ICMP on IPv6 is reversed. This patch fixes that. It also adds an skb->sp check so that unprotected packets that fail the policy check do not crash the machine. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index 3c41a6f7e6ec..c41f3cc4fba8 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c @@ -977,7 +977,7 @@ int icmp_rcv(struct sk_buff *skb) struct icmphdr *icmph; struct rtable *rt = (struct rtable *)skb->dst; - if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb...
2ba582b782071c038b312ea330d3090a39f3c66a
Analyze and fix the following issue in the Linux kernel code: [BNX2]: Fix compiler warning.
Problem Details: Change bnx2_init_napi() to void. Warning was noted by DaveM. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index aef2a9ac16a2..94d1857d2c5d 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c @@ -7313,7 +7313,7 @@ bnx2_bus_string(struct bnx2 *bp, char *str) return str; } -static int __devinit +static void __devinit bnx2_init_napi(struct bnx2 *bp) { i...
f5f97b57b5208a7ca270ac86887a2838ab7862f5
Analyze and fix the following issue in the Linux kernel code: [NET]: fix drivers/net/ns83820.c build
Problem Details: Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c index 972acc3d1276..3652c6c926a6 100644 --- a/drivers/net/ns83820.c +++ b/drivers/net/ns83820.c @@ -611,7 +611,7 @@ static inline int rx_refill(struct net_device *ndev, gfp_t gfp) return i ? 0 : -ENOMEM; } -static void rx_refill_atomic(struct net_d...
5533995b62d02dbbf930f2e59221c2d5ea05aab7
Analyze and fix the following issue in the Linux kernel code: [IPIP]: Allow rebinding the tunnel to another interface
Problem Details: Once created, an IP tunnel can't be bound to another device. (reported as https://bugzilla.redhat.com/show_bug.cgi?id=419671) To reproduce: # create a tunnel: ip tunnel add tunneltest0 mode ipip remote 10.0.0.1 dev eth0 # try to change the bounding device from eth0 to eth1: ip tunnel change tunneltes...
```diff diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index 8c2b2b0741da..160535b51705 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c @@ -651,6 +651,40 @@ tx_error: return 0; } +static void ipip_tunnel_bind_dev(struct net_device *dev) +{ + struct net_device *tdev = NULL; + struct ip_tunnel *tunnel; + struct i...
954c2db868ce896325dced91d5fba5e2226897a4
Analyze and fix the following issue in the Linux kernel code: [CCID3]: Interface CCID3 code with newer Loss Intervals Database
Problem Details: This hooks up the TFRC Loss Interval database with CCID 3 packet reception. In addition, it makes the CCID-specific computation of the first loss interval (which requires access to all the guts of CCID3) local to ccid3.c. The patch also fixes an omission in the DCCP code, that of a default / fallback ...
```diff diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c index 8266dfde89c1..8f112d18d450 100644 --- a/net/dccp/ccids/ccid3.c +++ b/net/dccp/ccids/ccid3.c @@ -1,6 +1,7 @@ /* * net/dccp/ccids/ccid3.c * + * Copyright (c) 2007 The University of Aberdeen, Scotland, UK * Copyright (c) 2005-7 The Univ...
c69bce20dda7f79160856a338298d65a284ba303
Analyze and fix the following issue in the Linux kernel code: [NET]: Remove unused "mibalign" argument for snmp_mib_init().
Problem Details: With fixes from Arnaldo Carvalho de Melo. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/include/net/ip.h b/include/net/ip.h index 17d1189723fc..571bcf2a1cff 100644 --- a/include/net/ip.h +++ b/include/net/ip.h @@ -171,7 +171,7 @@ DECLARE_SNMP_STAT(struct linux_mib, net_statistics); #define NET_ADD_STATS_USER(field, adnd) SNMP_ADD_STATS_USER(net_statistics, field, adnd) extern unsi...
433d49c3bb14b8a2351fe97df8359e4ad0de4c7c
Analyze and fix the following issue in the Linux kernel code: [IPV6]: Make ip6_route_init to return an error code.
Problem Details: The route initialization function does not return any value to notify if the initialization is successful or not. This patch checks all calls made for the initilization in order to return a value for the caller. Unfortunately, proc_net_fops_create will return a NULL pointer if CONFIG_PROC_FS is off, s...
```diff diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 5456fdd6d047..1a0698b1e86c 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h @@ -50,7 +50,7 @@ extern void ip6_route_input(struct sk_buff *skb); extern struct dst_entry * ip6_route_output(struct sock *sk, struct flo...
9eb87f3f7e0686a256c5bb4f886dede0171245f2
Analyze and fix the following issue in the Linux kernel code: [IPV6]: Make fib6_rules_init to return an error code.
Problem Details: When the fib_rules initialization finished, no return code is provided so there is no way to know, for the caller, if the initialization has been successful or has failed. This patch fix that. Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com> Acked-by: Benjamin Thery <benjamin.thery@bull.net> Signed...
```diff diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h index 41a301e38643..2364db1a47e6 100644 --- a/include/net/fib_rules.h +++ b/include/net/fib_rules.h @@ -103,6 +103,7 @@ static inline u32 frh_get_table(struct fib_rule_hdr *frh, struct nlattr **nla) extern int fib_rules_register(struct fib_rule...
b84a2189c4e1835c51fd6b974a0497be9bc4ba87
Analyze and fix the following issue in the Linux kernel code: [TFRC]: New rx history code
Problem Details: Credit here goes to Gerrit Renker, that provided the initial implementation for this new codebase. I modified it just to try to make it closer to the existing API, renaming some functions, add namespacing and fix one bug where the tfrc_rx_hist_alloc was not freeing the allocated ring entries on the er...
```diff diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c index f5cfc2e2d7b2..bf95c3292d5b 100644 --- a/net/dccp/ccids/ccid3.c +++ b/net/dccp/ccids/ccid3.c @@ -641,6 +641,15 @@ static int ccid3_hc_tx_getsockopt(struct sock *sk, const int optname, int len, /* * Receiver Half-Connection Routines */ + +/* ...
c40616c597bf02a2346cbf2f120283734b436245
Analyze and fix the following issue in the Linux kernel code: [TFRC]: Provide central source file and debug facility
Problem Details: This patch changes the tfrc_lib module in the following manner: (1) a dedicated tfrc source file to call the packet history & loss interval init/exit functions. (2) a dedicated tfrc_pr_debug macro with toggle switch `tfrc_debug'. Commiter note: renamed tfrc_module.c to tfrc.c, and made CONFIG_...
```diff diff --git a/net/dccp/ccids/Kconfig b/net/dccp/ccids/Kconfig index 3d7d867a7c4e..12275943eab8 100644 --- a/net/dccp/ccids/Kconfig +++ b/net/dccp/ccids/Kconfig @@ -38,6 +38,7 @@ config IP_DCCP_CCID2_DEBUG config IP_DCCP_CCID3 tristate "CCID3 (TCP-Friendly) (EXPERIMENTAL)" def_tristate IP_DCCP + select IP_DC...
a59322be07c964e916d15be3df473fb7ba20c41e
Analyze and fix the following issue in the Linux kernel code: [UDP]: Only increment counter on first peek/recv
Problem Details: The previous move of the the UDP inDatagrams counter caused each peek of the same packet to be counted separately. This may be undesirable. This patch fixes this by adding a bit to sk_buff to record whether this packet has already been seen through skb_recv_datagram. We then only increment the count...
```diff diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 17b3f70fbbc3..c618fbf7d173 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -288,6 +288,7 @@ struct sk_buff { __u8 pkt_type:3, fclone:2, ipvs_property:1, + peeked:1, nf_trace:1; __be16 protocol; @@ ...
27ab2568649d5ba6c5a20212079b7c4f6da4ca0d
Analyze and fix the following issue in the Linux kernel code: [UDP]: Avoid repeated counting of checksum errors due to peeking
Problem Details: Currently it is possible for two processes to peek on the same socket and end up incrementing the error counter twice for the same packet. This patch fixes it by making skb_kill_datagram return whether it succeeded in unlinking the packet and only incrementing the counter if it did. Signed-off-by: He...
```diff diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index d39f53ef66bb..17b3f70fbbc3 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -1549,7 +1549,7 @@ extern int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb, int hlen, struct iovec *iov); extern void ...
2bd0119729cb4eac88c6161b3e1a3c3ebbb4768e
Analyze and fix the following issue in the Linux kernel code: [NETFILTER]: nfnetlink_queue: remove useless debugging
Problem Details: Originally I wanted to just remove the QDEBUG macro and use pr_debug, but none of the messages seems worth keeping. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c index 37b7655df910..c3aba1e8c5c4 100644 --- a/net/netfilter/nfnetlink_queue.c +++ b/net/netfilter/nfnetlink_queue.c @@ -37,14 +37,6 @@ #define NFQNL_QMAX_DEFAULT 1024 -#if 0 -#define QDEBUG(x, args ...) printk(KERN_DEBUG "%s(%d)...
a3c8e7fd4b36bf6e12fef432cfa8a001dc0b7a26
Analyze and fix the following issue in the Linux kernel code: [NETFILTER]: nfnetlink_queue: fix checks in nfqnl_recv_config
Problem Details: The peer_pid must be checked in all cases when a queue exists, currently it is not checked if for NFQA_CFG_QUEUE_MAXLEN when a NFQA_CFG_CMD attribute exists in some cases. Same for the queue existance check, which can cause a NULL pointer dereference. Also consistently return -ENODEV for "queue not fo...
```diff diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c index bd18de72e3c5..4abf62a6c057 100644 --- a/net/netfilter/nfnetlink_queue.c +++ b/net/netfilter/nfnetlink_queue.c @@ -781,8 +781,14 @@ nfqnl_recv_config(struct sock *ctnl, struct sk_buff *skb, QDEBUG("entering for msg %u\n", NFNL...
f9c639905018967e57ea24b07e82de9bcd76339f
Analyze and fix the following issue in the Linux kernel code: [NETFILTER]: remove annoying debugging message
Problem Details: Don't log "nf_hook: Verdict = QUEUE." message with NETFILTER_DEBUG=y. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/netfilter/core.c b/net/netfilter/core.c index 6819a4113e1e..95e18635ce7a 100644 --- a/net/netfilter/core.c +++ b/net/netfilter/core.c @@ -178,8 +178,7 @@ next_hook: } else if (verdict == NF_DROP) { kfree_skb(skb); ret = -EPERM; - } else if ((verdict & NF_VERDICT_MASK) == NF_QUEUE) { - ...
1841a4c7ae106b7a3e2521db55f4d8bb8a0988d5
Analyze and fix the following issue in the Linux kernel code: [NETFILTER]: nf_ct_h323: remove ipv6 module dependency
Problem Details: nf_conntrack_h323 needs ip6_route_output for the call forwarding filter. Add a ->route function to nf_afinfo and use that to avoid pulling in the ipv6 module. Fix the #ifdef for the IPv6 code while I'm at it - the IPv6 support is only needed when IPv6 conntrack is enabled. Signed-off-by: Patrick McHa...
```diff diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index f42e4362d50d..9bfc7d4f5868 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h @@ -298,10 +298,12 @@ extern void nf_invalidate_cache(int pf); Returns true or false. */ extern int skb_make_writable(struct sk_buff *sk...
9e67d5a739327c44885adebb4f3a538050be73e4
Analyze and fix the following issue in the Linux kernel code: [NETFILTER]: x_tables: remove obsolete overflow check
Problem Details: We're not multiplying the size with the number of CPUs anymore, so the check is obsolete. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c index a21722d5c9fa..d5cae7e906cf 100644 --- a/net/ipv4/netfilter/arp_tables.c +++ b/net/ipv4/netfilter/arp_tables.c @@ -811,8 +811,6 @@ static int do_replace(void __user *user, unsigned int len) return -ENOPROTOOPT; /* overflo...
6ac552fdc6e96bf2f39c18d6e66b8c8080bbb06e
Analyze and fix the following issue in the Linux kernel code: [NETLINK]: af_netlink.c checkpatch cleanups
Problem Details: Fix large number of checkpatch errors. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 1518244ffad9..2e02b19e4552 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -156,7 +156,7 @@ static void netlink_sock_destruct(struct sock *sk) skb_queue_purge(&sk->sk_receive_queue); if (!sock_flag(sk, SOCK_DEAD...
2fcb45b6b87914f072314e5b5d9c196f45984683
Analyze and fix the following issue in the Linux kernel code: [IPSEC]: Use the correct family for input state lookup
Problem Details: When merging the input paths of IPsec I accidentally left a hard-coded AF_INET for the state lookup call. This broke IPv6 obviously. This patch fixes by getting the input callers to specify the family through skb->cb. Credit goes to Kazunori Miyazawa for diagnosing this and providing an initial patc...
```diff diff --git a/include/net/xfrm.h b/include/net/xfrm.h index ecc02e9bde32..182f10b29d88 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -534,6 +534,7 @@ struct xfrm_spi_skb_cb { } header; unsigned int daddroff; + unsigned int family; }; #define XFRM_SPI_SKB_CB(__skb) ((struct xfrm_spi_skb_cb...
f52295a9c55ccb4d9b3580ce889f958ac740a44b
Analyze and fix the following issue in the Linux kernel code: [IPV6]: Unify and cleanup calls to addrconf_sysctl_register
Problem Details: Currently this call is (ab)used similar to devinet one - it registers sysctls for devices and for the "default" confs, while the "all" sysctls are registered separately. But unlike its devinet brother, the passed inet6_device is needed. The fix is to make a __addrconf_sysctl_register(), which register...
```diff diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 2d2886a0b66d..ea1673d29078 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -101,7 +101,7 @@ #define TIME_DELTA(a,b) ((unsigned long)((long)(a) - (long)(b))) #ifdef CONFIG_SYSCTL -static void addrconf_sysctl_register(struct inet6_dev ...
66f27a52037c89183e83689b0531412577be0101
Analyze and fix the following issue in the Linux kernel code: [IPV4]: Unify and cleanup calls to devinet_sysctl_register
Problem Details: Currently this call is used to register sysctls for devices and for the "default" confs. The "all" sysctls are registered separately. Besides, the inet_device is passed to this function, but it is not needed there at all - just the device name and ifindex are required. Thanks to Herbert, who noticed,...
```diff diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 72dd0ecb1081..a3a7d301736e 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -98,8 +98,7 @@ static BLOCKING_NOTIFIER_HEAD(inetaddr_chain); static void inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap, int destroy); #ifdef ...
82b3cad942ebf1f64798e6ec3c46c277822e1fce
Analyze and fix the following issue in the Linux kernel code: mac80211: adding MAC80211_HT_DEBUG config variable
Problem Details: This patch adds MAC80211_HT_DEBUG config variable to separate HT debug features Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig index ce176e691afe..09711b062807 100644 --- a/net/mac80211/Kconfig +++ b/net/mac80211/Kconfig @@ -51,6 +51,16 @@ config MAC80211_DEBUG If you are not trying to debug or develop the ieee80211 subsystem, you most likely want to say N here. +config...
875179fa60ffe2eba1daaefb0af1be97ff5eda6a
Analyze and fix the following issue in the Linux kernel code: [IPSEC]: SPD auditing fix to include the netmask/prefix-length
Problem Details: Currently the netmask/prefix-length of an IPsec SPD entry is not included in any of the SPD related audit messages. This can cause a problem when the audit log is examined as the netmask/prefix-length is vital in determining what network traffic is affected by a particular SPD entry. This patch fixes...
```diff diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index b153f7482052..a76280a14e72 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -2266,29 +2266,37 @@ void __init xfrm_init(void) static inline void xfrm_audit_common_policyinfo(struct xfrm_policy *xp, struct audit_buffer *...
0c869620762fea4b3acf6502d9e80840b27ec642
Analyze and fix the following issue in the Linux kernel code: [DCCP]: Integrate state transitions for passive-close
Problem Details: This adds the necessary state transitions for the two forms of passive-close * PASSIVE_CLOSE - which is entered when a host receives a Close; * PASSIVE_CLOSEREQ - which is entered when a client receives a CloseReq. Here is a detailed account of what the patch does in each state. 1) Receiving ...
```diff diff --git a/include/linux/dccp.h b/include/linux/dccp.h index 8b3f9ad3cf04..312b989c7edb 100644 --- a/include/linux/dccp.h +++ b/include/linux/dccp.h @@ -260,7 +260,6 @@ enum dccp_state { }; #define DCCP_STATE_MASK 0x1f -#define DCCP_ACTION_FIN (1<<7) enum { DCCPF_OPEN = TCPF_ESTABLISHED, diff -...
f53dc67c5e7babafe239b93a11678b0e05bead51
Analyze and fix the following issue in the Linux kernel code: [DCCP]: Use AF-independent rebuild_header routine
Problem Details: This fixes a nasty bug: dccp_send_reset() is called by both DCCPv4 and DCCPv6, but uses inet_sk_rebuild_header() in each case. This leads to unpredictable and weird behaviour: under some conditions, DCCPv6 Resets were sent, in other not. The fix is to use the AF-independent rebuild_header routine. Si...
```diff diff --git a/net/dccp/output.c b/net/dccp/output.c index 33ce737ef3a8..7caa7f57bb7e 100644 --- a/net/dccp/output.c +++ b/net/dccp/output.c @@ -391,7 +391,7 @@ int dccp_send_reset(struct sock *sk, enum dccp_reset_codes code) * FIXME: what if rebuild_header fails? * Should we be doing a rebuild_header here?...
ea4f76ae13b4240dac304ed50636391d6b22e9c5
Analyze and fix the following issue in the Linux kernel code: [TCP]: Two fixes to new sacktag code
Problem Details: 1) Skip condition used to be wrong way around which made SACK processing very broken, missed many blocks because of that. 2) Use highest_sack advancement only if some skbs are already sacked because otherwise tcp_write_queue_next may move things too far (occurs mainly with GSO). The other similar adva...
```diff diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 97ea3eda206d..33d284e3f7f5 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -1384,7 +1384,7 @@ static struct sk_buff *tcp_sacktag_skip(struct sk_buff *skb, struct sock *sk, if (skb == tcp_send_head(sk)) break; - if (before(T...
3015a347dcd470fcc8becf1f84b0502391a3c0e0
Analyze and fix the following issue in the Linux kernel code: [IPV4] fib_hash: kmalloc + memset conversion to kzalloc
Problem Details: fib_hash: kmalloc + memset conversion to kzalloc fix to avoid memset entirely. Signed-off-by: Joonwoo Park <joonwpark81@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c index 0dfee27cfbcd..eb1aa8eead09 100644 --- a/net/ipv4/fib_hash.c +++ b/net/ipv4/fib_hash.c @@ -102,10 +102,10 @@ static struct hlist_head *fz_hash_alloc(int divisor) unsigned long size = divisor * sizeof(struct hlist_head); if (size <= PAGE_SIZE) { -...
88f8349164cf4035e63db9e6f484e0ce9cb17e47
Analyze and fix the following issue in the Linux kernel code: [IPV4] fib_semantics: kmalloc + memset conversion to kzalloc
Problem Details: fib_semantics: kmalloc + memset conversion to kzalloc fix to avoid memset entirely. Signed-off-by: Joonwoo Park <joonwpark81@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index 33ec96001d90..ec9b0dde9f9c 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c @@ -605,10 +605,10 @@ static inline unsigned int fib_laddr_hashfn(__be32 val) static struct hlist_head *fib_hash_alloc(int bytes) { if (bytes...
dcaee95a1b396f85cdc28099f39710be328d3a5e
Analyze and fix the following issue in the Linux kernel code: [IPSEC]: kmalloc + memset conversion to kzalloc
Problem Details: 2007/11/26, Patrick McHardy <kaber@trash.net>: > How about also switching vmalloc/get_free_pages to GFP_ZERO > and getting rid of the memset entirely while you're at it? > xfrm_hash: kmalloc + memset conversion to kzalloc fix to avoid memset entirely. Signed-off-by: Joonwoo Park <joonwpark81@gmail.co...
```diff diff --git a/net/xfrm/xfrm_hash.c b/net/xfrm/xfrm_hash.c index 55ab5792af56..a2023ec52329 100644 --- a/net/xfrm/xfrm_hash.c +++ b/net/xfrm/xfrm_hash.c @@ -17,17 +17,14 @@ struct hlist_head *xfrm_hash_alloc(unsigned int sz) struct hlist_head *n; if (sz <= PAGE_SIZE) - n = kmalloc(sz, GFP_KERNEL); + n = k...
dcfbc7e97a2e3a0d73a2e41e1bddb988dcca701e
Analyze and fix the following issue in the Linux kernel code: [CCID2]: Remove misleading comment
Problem Details: This removes a comment which identifies an `issue' with dccp_write_xmit() where there is none. The comment assumes it is possible that a packet is sent between the calls to ccid_hc_tx_send_packet(), dccp_transmit_skb(), ccid_hc_tx_packet_sent() (in the above order) in dccp_write_xmit(). I think t...
```diff diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c index 02d126d9a711..48eeb4494e8d 100644 --- a/net/dccp/ccids/ccid2.c +++ b/net/dccp/ccids/ccid2.c @@ -228,18 +228,10 @@ static void ccid2_hc_tx_packet_sent(struct sock *sk, int more, unsigned int len) struct dccp_sock *dp = dccp_sk(sk); struct cci...
95b21d7e9d099f1cffca08e40f292d6658a88b3c
Analyze and fix the following issue in the Linux kernel code: [CCID2]: Replace pipe assignment-function with assignment
Problem Details: The function ccid2_change_pipe only does an assignment. This patch simplifies the code by replacing the function with the assignment it performs. Furthermore, the type of pipe is promoted from `signed' to unsigned (increasing the range). As a result, a BUG_ON test for negative values now becomes obsol...
```diff diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c index 747fa1c4e42e..237007bb55a8 100644 --- a/net/dccp/ccids/ccid2.c +++ b/net/dccp/ccids/ccid2.c @@ -171,11 +171,6 @@ static void ccid2_change_srtt(struct ccid2_hc_tx_sock *hctx, long val) hctx->ccid2hctx_srtt = val; } -static void ccid2_change_...
d50ad163e6db2dcc365b8d02b30350220f86df04
Analyze and fix the following issue in the Linux kernel code: [CCID2]: Deadlock and spurious timeouts when Ack Ratio > cwnd
Problem Details: This patch removes a bug in the current code. I agree with Andrea's comment that there is a problem here but the way it is treated does not fix it. The problem is that whenever Ack Ratio > cwnd, starvation/deadlock occurs: * the receiver will not send an Ack until (Ack Ratio - cwnd) data packets h...
```diff diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c index f18235e8ce84..ef19fb834299 100644 --- a/net/dccp/ccids/ccid2.c +++ b/net/dccp/ccids/ccid2.c @@ -143,32 +143,30 @@ static int ccid2_hc_tx_send_packet(struct sock *sk, struct sk_buff *skb) static void ccid2_change_l_ack_ratio(struct sock *sk, u32...