diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-17 21:34:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-17 21:34:37 -0400 |
commit | e14f64c2079240082f3c5bf98d9ecf3dc6780338 (patch) | |
tree | 9f0c0e3d76478d28312fb4a2def479179a5548c6 | |
parent | 602586a83b719df0fbd94196a1359ed35aeb2df3 (diff) | |
parent | e5093aec2e6b60c3df2420057ffab9ed4a6d2792 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
net: Fix a memmove bug in dev_gro_receive()
net sched: fix some kernel memory leaks
netfilter: {ip,ip6,arp}_tables: avoid lockdep false positive
Revert "netlink: netlink_recvmsg() fix"
ipv6: remove sysctl jiffies conversion on gc_elasticity and min_adv_mss
xfrm: Use GFP_ATOMIC in xfrm_compile_policy
ath5k: disable ASPM L0s for all cards
ath9k_htc: load proper firmware for device ID 7015
wl1251: fix trigger scan timeout usage
ath9k_htc: Fix disconnect issue in HT40 mode.
ath9k_htc: fix panic on packet injection using airbase-ng tool.
ipw2100: register pm_qos request before registering pci driver
-rw-r--r-- | drivers/net/wireless/ath/ath5k/base.c | 21 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/eeprom.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/eeprom_9287.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hif_usb.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_init.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_main.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/reg.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2x00/ipw2100.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1251_cmd.c | 2 | ||||
-rw-r--r-- | net/core/dev.c | 2 | ||||
-rw-r--r-- | net/ipv4/netfilter/arp_tables.c | 2 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_tables.c | 2 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6_tables.c | 2 | ||||
-rw-r--r-- | net/ipv6/route.c | 4 | ||||
-rw-r--r-- | net/netlink/af_netlink.c | 22 | ||||
-rw-r--r-- | net/sched/act_gact.c | 21 | ||||
-rw-r--r-- | net/sched/act_mirred.c | 15 | ||||
-rw-r--r-- | net/sched/act_nat.c | 22 | ||||
-rw-r--r-- | net/sched/act_simple.c | 11 | ||||
-rw-r--r-- | net/sched/act_skbedit.c | 11 | ||||
-rw-r--r-- | net/xfrm/xfrm_user.c | 2 |
22 files changed, 107 insertions, 73 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index 0d5de2574dd1..373dcfec689c 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c | |||
@@ -48,6 +48,7 @@ | |||
48 | #include <linux/netdevice.h> | 48 | #include <linux/netdevice.h> |
49 | #include <linux/cache.h> | 49 | #include <linux/cache.h> |
50 | #include <linux/pci.h> | 50 | #include <linux/pci.h> |
51 | #include <linux/pci-aspm.h> | ||
51 | #include <linux/ethtool.h> | 52 | #include <linux/ethtool.h> |
52 | #include <linux/uaccess.h> | 53 | #include <linux/uaccess.h> |
53 | #include <linux/slab.h> | 54 | #include <linux/slab.h> |
@@ -476,6 +477,26 @@ ath5k_pci_probe(struct pci_dev *pdev, | |||
476 | int ret; | 477 | int ret; |
477 | u8 csz; | 478 | u8 csz; |
478 | 479 | ||
480 | /* | ||
481 | * L0s needs to be disabled on all ath5k cards. | ||
482 | * | ||
483 | * For distributions shipping with CONFIG_PCIEASPM (this will be enabled | ||
484 | * by default in the future in 2.6.36) this will also mean both L1 and | ||
485 | * L0s will be disabled when a pre 1.1 PCIe device is detected. We do | ||
486 | * know L1 works correctly even for all ath5k pre 1.1 PCIe devices | ||
487 | * though but cannot currently undue the effect of a blacklist, for | ||
488 | * details you can read pcie_aspm_sanity_check() and see how it adjusts | ||
489 | * the device link capability. | ||
490 | * | ||
491 | * It may be possible in the future to implement some PCI API to allow | ||
492 | * drivers to override blacklists for pre 1.1 PCIe but for now it is | ||
493 | * best to accept that both L0s and L1 will be disabled completely for | ||
494 | * distributions shipping with CONFIG_PCIEASPM rather than having this | ||
495 | * issue present. Motivation for adding this new API will be to help | ||
496 | * with power consumption for some of these devices. | ||
497 | */ | ||
498 | pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S); | ||
499 | |||
479 | ret = pci_enable_device(pdev); | 500 | ret = pci_enable_device(pdev); |
480 | if (ret) { | 501 | if (ret) { |
481 | dev_err(&pdev->dev, "can't enable device\n"); | 502 | dev_err(&pdev->dev, "can't enable device\n"); |
diff --git a/drivers/net/wireless/ath/ath9k/eeprom.h b/drivers/net/wireless/ath/ath9k/eeprom.h index 8750c558c221..7f48df1e2903 100644 --- a/drivers/net/wireless/ath/ath9k/eeprom.h +++ b/drivers/net/wireless/ath/ath9k/eeprom.h | |||
@@ -191,6 +191,7 @@ | |||
191 | #define AR9287_EEP_NO_BACK_VER AR9287_EEP_MINOR_VER_1 | 191 | #define AR9287_EEP_NO_BACK_VER AR9287_EEP_MINOR_VER_1 |
192 | 192 | ||
193 | #define AR9287_EEP_START_LOC 128 | 193 | #define AR9287_EEP_START_LOC 128 |
194 | #define AR9287_HTC_EEP_START_LOC 256 | ||
194 | #define AR9287_NUM_2G_CAL_PIERS 3 | 195 | #define AR9287_NUM_2G_CAL_PIERS 3 |
195 | #define AR9287_NUM_2G_CCK_TARGET_POWERS 3 | 196 | #define AR9287_NUM_2G_CCK_TARGET_POWERS 3 |
196 | #define AR9287_NUM_2G_20_TARGET_POWERS 3 | 197 | #define AR9287_NUM_2G_20_TARGET_POWERS 3 |
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_9287.c b/drivers/net/wireless/ath/ath9k/eeprom_9287.c index 4a52cf03808b..dff2da777312 100644 --- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c +++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c | |||
@@ -34,9 +34,14 @@ static bool ath9k_hw_ar9287_fill_eeprom(struct ath_hw *ah) | |||
34 | struct ar9287_eeprom *eep = &ah->eeprom.map9287; | 34 | struct ar9287_eeprom *eep = &ah->eeprom.map9287; |
35 | struct ath_common *common = ath9k_hw_common(ah); | 35 | struct ath_common *common = ath9k_hw_common(ah); |
36 | u16 *eep_data; | 36 | u16 *eep_data; |
37 | int addr, eep_start_loc = AR9287_EEP_START_LOC; | 37 | int addr, eep_start_loc; |
38 | eep_data = (u16 *)eep; | 38 | eep_data = (u16 *)eep; |
39 | 39 | ||
40 | if (ah->hw_version.devid == 0x7015) | ||
41 | eep_start_loc = AR9287_HTC_EEP_START_LOC; | ||
42 | else | ||
43 | eep_start_loc = AR9287_EEP_START_LOC; | ||
44 | |||
40 | if (!ath9k_hw_use_flash(ah)) { | 45 | if (!ath9k_hw_use_flash(ah)) { |
41 | ath_print(common, ATH_DBG_EEPROM, | 46 | ath_print(common, ATH_DBG_EEPROM, |
42 | "Reading from EEPROM, not flash\n"); | 47 | "Reading from EEPROM, not flash\n"); |
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c index 61c1bee3f26a..17e7a9a367e7 100644 --- a/drivers/net/wireless/ath/ath9k/hif_usb.c +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c | |||
@@ -799,7 +799,7 @@ static int ath9k_hif_usb_download_fw(struct hif_device_usb *hif_dev) | |||
799 | } | 799 | } |
800 | kfree(buf); | 800 | kfree(buf); |
801 | 801 | ||
802 | if (hif_dev->device_id == 0x7010) | 802 | if ((hif_dev->device_id == 0x7010) || (hif_dev->device_id == 0x7015)) |
803 | firm_offset = AR7010_FIRMWARE_TEXT; | 803 | firm_offset = AR7010_FIRMWARE_TEXT; |
804 | else | 804 | else |
805 | firm_offset = AR9271_FIRMWARE_TEXT; | 805 | firm_offset = AR9271_FIRMWARE_TEXT; |
@@ -901,6 +901,7 @@ static int ath9k_hif_usb_probe(struct usb_interface *interface, | |||
901 | 901 | ||
902 | switch(hif_dev->device_id) { | 902 | switch(hif_dev->device_id) { |
903 | case 0x7010: | 903 | case 0x7010: |
904 | case 0x7015: | ||
904 | case 0x9018: | 905 | case 0x9018: |
905 | if (le16_to_cpu(udev->descriptor.bcdDevice) == 0x0202) | 906 | if (le16_to_cpu(udev->descriptor.bcdDevice) == 0x0202) |
906 | hif_dev->fw_name = FIRMWARE_AR7010_1_1; | 907 | hif_dev->fw_name = FIRMWARE_AR7010_1_1; |
@@ -912,11 +913,6 @@ static int ath9k_hif_usb_probe(struct usb_interface *interface, | |||
912 | break; | 913 | break; |
913 | } | 914 | } |
914 | 915 | ||
915 | if (!hif_dev->fw_name) { | ||
916 | dev_err(&udev->dev, "Can't determine firmware !\n"); | ||
917 | goto err_htc_hw_alloc; | ||
918 | } | ||
919 | |||
920 | ret = ath9k_hif_usb_dev_init(hif_dev); | 916 | ret = ath9k_hif_usb_dev_init(hif_dev); |
921 | if (ret) { | 917 | if (ret) { |
922 | ret = -EINVAL; | 918 | ret = -EINVAL; |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c index 148b43317fdb..2d4279191d7a 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c | |||
@@ -245,6 +245,7 @@ static int ath9k_init_htc_services(struct ath9k_htc_priv *priv, u16 devid) | |||
245 | 245 | ||
246 | switch(devid) { | 246 | switch(devid) { |
247 | case 0x7010: | 247 | case 0x7010: |
248 | case 0x7015: | ||
248 | case 0x9018: | 249 | case 0x9018: |
249 | priv->htc->credits = 45; | 250 | priv->htc->credits = 45; |
250 | break; | 251 | break; |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index ebed9d1691a5..7d09b4b17bbd 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c | |||
@@ -366,7 +366,8 @@ static void ath9k_htc_setup_rate(struct ath9k_htc_priv *priv, | |||
366 | caps = WLAN_RC_HT_FLAG; | 366 | caps = WLAN_RC_HT_FLAG; |
367 | if (sta->ht_cap.mcs.rx_mask[1]) | 367 | if (sta->ht_cap.mcs.rx_mask[1]) |
368 | caps |= WLAN_RC_DS_FLAG; | 368 | caps |= WLAN_RC_DS_FLAG; |
369 | if (sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) | 369 | if ((sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) && |
370 | (conf_is_ht40(&priv->hw->conf))) | ||
370 | caps |= WLAN_RC_40_FLAG; | 371 | caps |= WLAN_RC_40_FLAG; |
371 | if (conf_is_ht40(&priv->hw->conf) && | 372 | if (conf_is_ht40(&priv->hw->conf) && |
372 | (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40)) | 373 | (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40)) |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c index bd0b4acc3ece..2a6e45a293a9 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | |||
@@ -78,18 +78,23 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, struct sk_buff *skb) | |||
78 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); | 78 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); |
79 | struct ieee80211_sta *sta = tx_info->control.sta; | 79 | struct ieee80211_sta *sta = tx_info->control.sta; |
80 | struct ath9k_htc_sta *ista; | 80 | struct ath9k_htc_sta *ista; |
81 | struct ath9k_htc_vif *avp; | ||
82 | struct ath9k_htc_tx_ctl tx_ctl; | 81 | struct ath9k_htc_tx_ctl tx_ctl; |
83 | enum htc_endpoint_id epid; | 82 | enum htc_endpoint_id epid; |
84 | u16 qnum; | 83 | u16 qnum; |
85 | __le16 fc; | 84 | __le16 fc; |
86 | u8 *tx_fhdr; | 85 | u8 *tx_fhdr; |
87 | u8 sta_idx; | 86 | u8 sta_idx, vif_idx; |
88 | 87 | ||
89 | hdr = (struct ieee80211_hdr *) skb->data; | 88 | hdr = (struct ieee80211_hdr *) skb->data; |
90 | fc = hdr->frame_control; | 89 | fc = hdr->frame_control; |
91 | 90 | ||
92 | avp = (struct ath9k_htc_vif *) tx_info->control.vif->drv_priv; | 91 | if (tx_info->control.vif && |
92 | (struct ath9k_htc_vif *) tx_info->control.vif->drv_priv) | ||
93 | vif_idx = ((struct ath9k_htc_vif *) | ||
94 | tx_info->control.vif->drv_priv)->index; | ||
95 | else | ||
96 | vif_idx = priv->nvifs; | ||
97 | |||
93 | if (sta) { | 98 | if (sta) { |
94 | ista = (struct ath9k_htc_sta *) sta->drv_priv; | 99 | ista = (struct ath9k_htc_sta *) sta->drv_priv; |
95 | sta_idx = ista->index; | 100 | sta_idx = ista->index; |
@@ -106,7 +111,7 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, struct sk_buff *skb) | |||
106 | memset(&tx_hdr, 0, sizeof(struct tx_frame_hdr)); | 111 | memset(&tx_hdr, 0, sizeof(struct tx_frame_hdr)); |
107 | 112 | ||
108 | tx_hdr.node_idx = sta_idx; | 113 | tx_hdr.node_idx = sta_idx; |
109 | tx_hdr.vif_idx = avp->index; | 114 | tx_hdr.vif_idx = vif_idx; |
110 | 115 | ||
111 | if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) { | 116 | if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) { |
112 | tx_ctl.type = ATH9K_HTC_AMPDU; | 117 | tx_ctl.type = ATH9K_HTC_AMPDU; |
@@ -169,7 +174,7 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, struct sk_buff *skb) | |||
169 | tx_ctl.type = ATH9K_HTC_NORMAL; | 174 | tx_ctl.type = ATH9K_HTC_NORMAL; |
170 | 175 | ||
171 | mgmt_hdr.node_idx = sta_idx; | 176 | mgmt_hdr.node_idx = sta_idx; |
172 | mgmt_hdr.vif_idx = avp->index; | 177 | mgmt_hdr.vif_idx = vif_idx; |
173 | mgmt_hdr.tidno = 0; | 178 | mgmt_hdr.tidno = 0; |
174 | mgmt_hdr.flags = 0; | 179 | mgmt_hdr.flags = 0; |
175 | 180 | ||
diff --git a/drivers/net/wireless/ath/ath9k/reg.h b/drivers/net/wireless/ath/ath9k/reg.h index 633e3d949ec0..d01c4adab8d6 100644 --- a/drivers/net/wireless/ath/ath9k/reg.h +++ b/drivers/net/wireless/ath/ath9k/reg.h | |||
@@ -899,6 +899,7 @@ | |||
899 | 899 | ||
900 | #define AR_DEVID_7010(_ah) \ | 900 | #define AR_DEVID_7010(_ah) \ |
901 | (((_ah)->hw_version.devid == 0x7010) || \ | 901 | (((_ah)->hw_version.devid == 0x7010) || \ |
902 | ((_ah)->hw_version.devid == 0x7015) || \ | ||
902 | ((_ah)->hw_version.devid == 0x9018)) | 903 | ((_ah)->hw_version.devid == 0x9018)) |
903 | 904 | ||
904 | #define AR_RADIO_SREV_MAJOR 0xf0 | 905 | #define AR_RADIO_SREV_MAJOR 0xf0 |
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c index 16bbfa3189a5..1189dbb6e2a6 100644 --- a/drivers/net/wireless/ipw2x00/ipw2100.c +++ b/drivers/net/wireless/ipw2x00/ipw2100.c | |||
@@ -6665,12 +6665,13 @@ static int __init ipw2100_init(void) | |||
6665 | printk(KERN_INFO DRV_NAME ": %s, %s\n", DRV_DESCRIPTION, DRV_VERSION); | 6665 | printk(KERN_INFO DRV_NAME ": %s, %s\n", DRV_DESCRIPTION, DRV_VERSION); |
6666 | printk(KERN_INFO DRV_NAME ": %s\n", DRV_COPYRIGHT); | 6666 | printk(KERN_INFO DRV_NAME ": %s\n", DRV_COPYRIGHT); |
6667 | 6667 | ||
6668 | pm_qos_add_request(&ipw2100_pm_qos_req, PM_QOS_CPU_DMA_LATENCY, | ||
6669 | PM_QOS_DEFAULT_VALUE); | ||
6670 | |||
6668 | ret = pci_register_driver(&ipw2100_pci_driver); | 6671 | ret = pci_register_driver(&ipw2100_pci_driver); |
6669 | if (ret) | 6672 | if (ret) |
6670 | goto out; | 6673 | goto out; |
6671 | 6674 | ||
6672 | pm_qos_add_request(&ipw2100_pm_qos_req, PM_QOS_CPU_DMA_LATENCY, | ||
6673 | PM_QOS_DEFAULT_VALUE); | ||
6674 | #ifdef CONFIG_IPW2100_DEBUG | 6675 | #ifdef CONFIG_IPW2100_DEBUG |
6675 | ipw2100_debug_level = debug; | 6676 | ipw2100_debug_level = debug; |
6676 | ret = driver_create_file(&ipw2100_pci_driver.driver, | 6677 | ret = driver_create_file(&ipw2100_pci_driver.driver, |
diff --git a/drivers/net/wireless/wl12xx/wl1251_cmd.c b/drivers/net/wireless/wl12xx/wl1251_cmd.c index a37b30cef489..ce3722f4c3e3 100644 --- a/drivers/net/wireless/wl12xx/wl1251_cmd.c +++ b/drivers/net/wireless/wl12xx/wl1251_cmd.c | |||
@@ -484,7 +484,7 @@ int wl1251_cmd_trigger_scan_to(struct wl1251 *wl, u32 timeout) | |||
484 | 484 | ||
485 | cmd->timeout = timeout; | 485 | cmd->timeout = timeout; |
486 | 486 | ||
487 | ret = wl1251_cmd_send(wl, CMD_SCAN, cmd, sizeof(*cmd)); | 487 | ret = wl1251_cmd_send(wl, CMD_TRIGGER_SCAN_TO, cmd, sizeof(*cmd)); |
488 | if (ret < 0) { | 488 | if (ret < 0) { |
489 | wl1251_error("cmd trigger scan to failed: %d", ret); | 489 | wl1251_error("cmd trigger scan to failed: %d", ret); |
490 | goto out; | 490 | goto out; |
diff --git a/net/core/dev.c b/net/core/dev.c index 1ae654391442..3721fbb9a83c 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -3143,7 +3143,7 @@ pull: | |||
3143 | put_page(skb_shinfo(skb)->frags[0].page); | 3143 | put_page(skb_shinfo(skb)->frags[0].page); |
3144 | memmove(skb_shinfo(skb)->frags, | 3144 | memmove(skb_shinfo(skb)->frags, |
3145 | skb_shinfo(skb)->frags + 1, | 3145 | skb_shinfo(skb)->frags + 1, |
3146 | --skb_shinfo(skb)->nr_frags); | 3146 | --skb_shinfo(skb)->nr_frags * sizeof(skb_frag_t)); |
3147 | } | 3147 | } |
3148 | } | 3148 | } |
3149 | 3149 | ||
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c index 6bccba31d132..51d6c3167975 100644 --- a/net/ipv4/netfilter/arp_tables.c +++ b/net/ipv4/netfilter/arp_tables.c | |||
@@ -735,6 +735,7 @@ static void get_counters(const struct xt_table_info *t, | |||
735 | if (cpu == curcpu) | 735 | if (cpu == curcpu) |
736 | continue; | 736 | continue; |
737 | i = 0; | 737 | i = 0; |
738 | local_bh_disable(); | ||
738 | xt_info_wrlock(cpu); | 739 | xt_info_wrlock(cpu); |
739 | xt_entry_foreach(iter, t->entries[cpu], t->size) { | 740 | xt_entry_foreach(iter, t->entries[cpu], t->size) { |
740 | ADD_COUNTER(counters[i], iter->counters.bcnt, | 741 | ADD_COUNTER(counters[i], iter->counters.bcnt, |
@@ -742,6 +743,7 @@ static void get_counters(const struct xt_table_info *t, | |||
742 | ++i; | 743 | ++i; |
743 | } | 744 | } |
744 | xt_info_wrunlock(cpu); | 745 | xt_info_wrunlock(cpu); |
746 | local_bh_enable(); | ||
745 | } | 747 | } |
746 | put_cpu(); | 748 | put_cpu(); |
747 | } | 749 | } |
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c index c439721b165a..97b64b22c412 100644 --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c | |||
@@ -909,6 +909,7 @@ get_counters(const struct xt_table_info *t, | |||
909 | if (cpu == curcpu) | 909 | if (cpu == curcpu) |
910 | continue; | 910 | continue; |
911 | i = 0; | 911 | i = 0; |
912 | local_bh_disable(); | ||
912 | xt_info_wrlock(cpu); | 913 | xt_info_wrlock(cpu); |
913 | xt_entry_foreach(iter, t->entries[cpu], t->size) { | 914 | xt_entry_foreach(iter, t->entries[cpu], t->size) { |
914 | ADD_COUNTER(counters[i], iter->counters.bcnt, | 915 | ADD_COUNTER(counters[i], iter->counters.bcnt, |
@@ -916,6 +917,7 @@ get_counters(const struct xt_table_info *t, | |||
916 | ++i; /* macro does multi eval of i */ | 917 | ++i; /* macro does multi eval of i */ |
917 | } | 918 | } |
918 | xt_info_wrunlock(cpu); | 919 | xt_info_wrunlock(cpu); |
920 | local_bh_enable(); | ||
919 | } | 921 | } |
920 | put_cpu(); | 922 | put_cpu(); |
921 | } | 923 | } |
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index 5359ef4daac5..29a7bca29e3f 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c | |||
@@ -922,6 +922,7 @@ get_counters(const struct xt_table_info *t, | |||
922 | if (cpu == curcpu) | 922 | if (cpu == curcpu) |
923 | continue; | 923 | continue; |
924 | i = 0; | 924 | i = 0; |
925 | local_bh_disable(); | ||
925 | xt_info_wrlock(cpu); | 926 | xt_info_wrlock(cpu); |
926 | xt_entry_foreach(iter, t->entries[cpu], t->size) { | 927 | xt_entry_foreach(iter, t->entries[cpu], t->size) { |
927 | ADD_COUNTER(counters[i], iter->counters.bcnt, | 928 | ADD_COUNTER(counters[i], iter->counters.bcnt, |
@@ -929,6 +930,7 @@ get_counters(const struct xt_table_info *t, | |||
929 | ++i; | 930 | ++i; |
930 | } | 931 | } |
931 | xt_info_wrunlock(cpu); | 932 | xt_info_wrunlock(cpu); |
933 | local_bh_enable(); | ||
932 | } | 934 | } |
933 | put_cpu(); | 935 | put_cpu(); |
934 | } | 936 | } |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 8f2d0400cf8a..d126365ac046 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -2580,7 +2580,7 @@ ctl_table ipv6_route_table_template[] = { | |||
2580 | .data = &init_net.ipv6.sysctl.ip6_rt_gc_elasticity, | 2580 | .data = &init_net.ipv6.sysctl.ip6_rt_gc_elasticity, |
2581 | .maxlen = sizeof(int), | 2581 | .maxlen = sizeof(int), |
2582 | .mode = 0644, | 2582 | .mode = 0644, |
2583 | .proc_handler = proc_dointvec_jiffies, | 2583 | .proc_handler = proc_dointvec, |
2584 | }, | 2584 | }, |
2585 | { | 2585 | { |
2586 | .procname = "mtu_expires", | 2586 | .procname = "mtu_expires", |
@@ -2594,7 +2594,7 @@ ctl_table ipv6_route_table_template[] = { | |||
2594 | .data = &init_net.ipv6.sysctl.ip6_rt_min_advmss, | 2594 | .data = &init_net.ipv6.sysctl.ip6_rt_min_advmss, |
2595 | .maxlen = sizeof(int), | 2595 | .maxlen = sizeof(int), |
2596 | .mode = 0644, | 2596 | .mode = 0644, |
2597 | .proc_handler = proc_dointvec_jiffies, | 2597 | .proc_handler = proc_dointvec, |
2598 | }, | 2598 | }, |
2599 | { | 2599 | { |
2600 | .procname = "gc_min_interval_ms", | 2600 | .procname = "gc_min_interval_ms", |
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 2cbf380377d5..8648a9922aab 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
@@ -1406,7 +1406,7 @@ static int netlink_recvmsg(struct kiocb *kiocb, struct socket *sock, | |||
1406 | struct netlink_sock *nlk = nlk_sk(sk); | 1406 | struct netlink_sock *nlk = nlk_sk(sk); |
1407 | int noblock = flags&MSG_DONTWAIT; | 1407 | int noblock = flags&MSG_DONTWAIT; |
1408 | size_t copied; | 1408 | size_t copied; |
1409 | struct sk_buff *skb; | 1409 | struct sk_buff *skb, *frag __maybe_unused = NULL; |
1410 | int err; | 1410 | int err; |
1411 | 1411 | ||
1412 | if (flags&MSG_OOB) | 1412 | if (flags&MSG_OOB) |
@@ -1441,21 +1441,7 @@ static int netlink_recvmsg(struct kiocb *kiocb, struct socket *sock, | |||
1441 | kfree_skb(skb); | 1441 | kfree_skb(skb); |
1442 | skb = compskb; | 1442 | skb = compskb; |
1443 | } else { | 1443 | } else { |
1444 | /* | 1444 | frag = skb_shinfo(skb)->frag_list; |
1445 | * Before setting frag_list to NULL, we must get a | ||
1446 | * private copy of skb if shared (because of MSG_PEEK) | ||
1447 | */ | ||
1448 | if (skb_shared(skb)) { | ||
1449 | struct sk_buff *nskb; | ||
1450 | |||
1451 | nskb = pskb_copy(skb, GFP_KERNEL); | ||
1452 | kfree_skb(skb); | ||
1453 | skb = nskb; | ||
1454 | err = -ENOMEM; | ||
1455 | if (!skb) | ||
1456 | goto out; | ||
1457 | } | ||
1458 | kfree_skb(skb_shinfo(skb)->frag_list); | ||
1459 | skb_shinfo(skb)->frag_list = NULL; | 1445 | skb_shinfo(skb)->frag_list = NULL; |
1460 | } | 1446 | } |
1461 | } | 1447 | } |
@@ -1492,6 +1478,10 @@ static int netlink_recvmsg(struct kiocb *kiocb, struct socket *sock, | |||
1492 | if (flags & MSG_TRUNC) | 1478 | if (flags & MSG_TRUNC) |
1493 | copied = skb->len; | 1479 | copied = skb->len; |
1494 | 1480 | ||
1481 | #ifdef CONFIG_COMPAT_NETLINK_MESSAGES | ||
1482 | skb_shinfo(skb)->frag_list = frag; | ||
1483 | #endif | ||
1484 | |||
1495 | skb_free_datagram(sk, skb); | 1485 | skb_free_datagram(sk, skb); |
1496 | 1486 | ||
1497 | if (nlk->cb && atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf / 2) | 1487 | if (nlk->cb && atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf / 2) |
diff --git a/net/sched/act_gact.c b/net/sched/act_gact.c index 8406c6654990..c2ed90a4c0b4 100644 --- a/net/sched/act_gact.c +++ b/net/sched/act_gact.c | |||
@@ -152,21 +152,24 @@ static int tcf_gact(struct sk_buff *skb, struct tc_action *a, struct tcf_result | |||
152 | static int tcf_gact_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) | 152 | static int tcf_gact_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) |
153 | { | 153 | { |
154 | unsigned char *b = skb_tail_pointer(skb); | 154 | unsigned char *b = skb_tail_pointer(skb); |
155 | struct tc_gact opt; | ||
156 | struct tcf_gact *gact = a->priv; | 155 | struct tcf_gact *gact = a->priv; |
156 | struct tc_gact opt = { | ||
157 | .index = gact->tcf_index, | ||
158 | .refcnt = gact->tcf_refcnt - ref, | ||
159 | .bindcnt = gact->tcf_bindcnt - bind, | ||
160 | .action = gact->tcf_action, | ||
161 | }; | ||
157 | struct tcf_t t; | 162 | struct tcf_t t; |
158 | 163 | ||
159 | opt.index = gact->tcf_index; | ||
160 | opt.refcnt = gact->tcf_refcnt - ref; | ||
161 | opt.bindcnt = gact->tcf_bindcnt - bind; | ||
162 | opt.action = gact->tcf_action; | ||
163 | NLA_PUT(skb, TCA_GACT_PARMS, sizeof(opt), &opt); | 164 | NLA_PUT(skb, TCA_GACT_PARMS, sizeof(opt), &opt); |
164 | #ifdef CONFIG_GACT_PROB | 165 | #ifdef CONFIG_GACT_PROB |
165 | if (gact->tcfg_ptype) { | 166 | if (gact->tcfg_ptype) { |
166 | struct tc_gact_p p_opt; | 167 | struct tc_gact_p p_opt = { |
167 | p_opt.paction = gact->tcfg_paction; | 168 | .paction = gact->tcfg_paction, |
168 | p_opt.pval = gact->tcfg_pval; | 169 | .pval = gact->tcfg_pval, |
169 | p_opt.ptype = gact->tcfg_ptype; | 170 | .ptype = gact->tcfg_ptype, |
171 | }; | ||
172 | |||
170 | NLA_PUT(skb, TCA_GACT_PROB, sizeof(p_opt), &p_opt); | 173 | NLA_PUT(skb, TCA_GACT_PROB, sizeof(p_opt), &p_opt); |
171 | } | 174 | } |
172 | #endif | 175 | #endif |
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c index 11f195af2da0..0c311be92827 100644 --- a/net/sched/act_mirred.c +++ b/net/sched/act_mirred.c | |||
@@ -219,15 +219,16 @@ static int tcf_mirred_dump(struct sk_buff *skb, struct tc_action *a, int bind, i | |||
219 | { | 219 | { |
220 | unsigned char *b = skb_tail_pointer(skb); | 220 | unsigned char *b = skb_tail_pointer(skb); |
221 | struct tcf_mirred *m = a->priv; | 221 | struct tcf_mirred *m = a->priv; |
222 | struct tc_mirred opt; | 222 | struct tc_mirred opt = { |
223 | .index = m->tcf_index, | ||
224 | .action = m->tcf_action, | ||
225 | .refcnt = m->tcf_refcnt - ref, | ||
226 | .bindcnt = m->tcf_bindcnt - bind, | ||
227 | .eaction = m->tcfm_eaction, | ||
228 | .ifindex = m->tcfm_ifindex, | ||
229 | }; | ||
223 | struct tcf_t t; | 230 | struct tcf_t t; |
224 | 231 | ||
225 | opt.index = m->tcf_index; | ||
226 | opt.action = m->tcf_action; | ||
227 | opt.refcnt = m->tcf_refcnt - ref; | ||
228 | opt.bindcnt = m->tcf_bindcnt - bind; | ||
229 | opt.eaction = m->tcfm_eaction; | ||
230 | opt.ifindex = m->tcfm_ifindex; | ||
231 | NLA_PUT(skb, TCA_MIRRED_PARMS, sizeof(opt), &opt); | 232 | NLA_PUT(skb, TCA_MIRRED_PARMS, sizeof(opt), &opt); |
232 | t.install = jiffies_to_clock_t(jiffies - m->tcf_tm.install); | 233 | t.install = jiffies_to_clock_t(jiffies - m->tcf_tm.install); |
233 | t.lastuse = jiffies_to_clock_t(jiffies - m->tcf_tm.lastuse); | 234 | t.lastuse = jiffies_to_clock_t(jiffies - m->tcf_tm.lastuse); |
diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c index 509a2d53a99d..186eb837e600 100644 --- a/net/sched/act_nat.c +++ b/net/sched/act_nat.c | |||
@@ -272,19 +272,19 @@ static int tcf_nat_dump(struct sk_buff *skb, struct tc_action *a, | |||
272 | { | 272 | { |
273 | unsigned char *b = skb_tail_pointer(skb); | 273 | unsigned char *b = skb_tail_pointer(skb); |
274 | struct tcf_nat *p = a->priv; | 274 | struct tcf_nat *p = a->priv; |
275 | struct tc_nat opt; | 275 | struct tc_nat opt = { |
276 | .old_addr = p->old_addr, | ||
277 | .new_addr = p->new_addr, | ||
278 | .mask = p->mask, | ||
279 | .flags = p->flags, | ||
280 | |||
281 | .index = p->tcf_index, | ||
282 | .action = p->tcf_action, | ||
283 | .refcnt = p->tcf_refcnt - ref, | ||
284 | .bindcnt = p->tcf_bindcnt - bind, | ||
285 | }; | ||
276 | struct tcf_t t; | 286 | struct tcf_t t; |
277 | 287 | ||
278 | opt.old_addr = p->old_addr; | ||
279 | opt.new_addr = p->new_addr; | ||
280 | opt.mask = p->mask; | ||
281 | opt.flags = p->flags; | ||
282 | |||
283 | opt.index = p->tcf_index; | ||
284 | opt.action = p->tcf_action; | ||
285 | opt.refcnt = p->tcf_refcnt - ref; | ||
286 | opt.bindcnt = p->tcf_bindcnt - bind; | ||
287 | |||
288 | NLA_PUT(skb, TCA_NAT_PARMS, sizeof(opt), &opt); | 288 | NLA_PUT(skb, TCA_NAT_PARMS, sizeof(opt), &opt); |
289 | t.install = jiffies_to_clock_t(jiffies - p->tcf_tm.install); | 289 | t.install = jiffies_to_clock_t(jiffies - p->tcf_tm.install); |
290 | t.lastuse = jiffies_to_clock_t(jiffies - p->tcf_tm.lastuse); | 290 | t.lastuse = jiffies_to_clock_t(jiffies - p->tcf_tm.lastuse); |
diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c index 4a1d640b0cf1..97e84f3ee775 100644 --- a/net/sched/act_simple.c +++ b/net/sched/act_simple.c | |||
@@ -164,13 +164,14 @@ static inline int tcf_simp_dump(struct sk_buff *skb, struct tc_action *a, | |||
164 | { | 164 | { |
165 | unsigned char *b = skb_tail_pointer(skb); | 165 | unsigned char *b = skb_tail_pointer(skb); |
166 | struct tcf_defact *d = a->priv; | 166 | struct tcf_defact *d = a->priv; |
167 | struct tc_defact opt; | 167 | struct tc_defact opt = { |
168 | .index = d->tcf_index, | ||
169 | .refcnt = d->tcf_refcnt - ref, | ||
170 | .bindcnt = d->tcf_bindcnt - bind, | ||
171 | .action = d->tcf_action, | ||
172 | }; | ||
168 | struct tcf_t t; | 173 | struct tcf_t t; |
169 | 174 | ||
170 | opt.index = d->tcf_index; | ||
171 | opt.refcnt = d->tcf_refcnt - ref; | ||
172 | opt.bindcnt = d->tcf_bindcnt - bind; | ||
173 | opt.action = d->tcf_action; | ||
174 | NLA_PUT(skb, TCA_DEF_PARMS, sizeof(opt), &opt); | 175 | NLA_PUT(skb, TCA_DEF_PARMS, sizeof(opt), &opt); |
175 | NLA_PUT_STRING(skb, TCA_DEF_DATA, d->tcfd_defdata); | 176 | NLA_PUT_STRING(skb, TCA_DEF_DATA, d->tcfd_defdata); |
176 | t.install = jiffies_to_clock_t(jiffies - d->tcf_tm.install); | 177 | t.install = jiffies_to_clock_t(jiffies - d->tcf_tm.install); |
diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c index e9607fe55b58..66cbf4eb8855 100644 --- a/net/sched/act_skbedit.c +++ b/net/sched/act_skbedit.c | |||
@@ -159,13 +159,14 @@ static inline int tcf_skbedit_dump(struct sk_buff *skb, struct tc_action *a, | |||
159 | { | 159 | { |
160 | unsigned char *b = skb_tail_pointer(skb); | 160 | unsigned char *b = skb_tail_pointer(skb); |
161 | struct tcf_skbedit *d = a->priv; | 161 | struct tcf_skbedit *d = a->priv; |
162 | struct tc_skbedit opt; | 162 | struct tc_skbedit opt = { |
163 | .index = d->tcf_index, | ||
164 | .refcnt = d->tcf_refcnt - ref, | ||
165 | .bindcnt = d->tcf_bindcnt - bind, | ||
166 | .action = d->tcf_action, | ||
167 | }; | ||
163 | struct tcf_t t; | 168 | struct tcf_t t; |
164 | 169 | ||
165 | opt.index = d->tcf_index; | ||
166 | opt.refcnt = d->tcf_refcnt - ref; | ||
167 | opt.bindcnt = d->tcf_bindcnt - bind; | ||
168 | opt.action = d->tcf_action; | ||
169 | NLA_PUT(skb, TCA_SKBEDIT_PARMS, sizeof(opt), &opt); | 170 | NLA_PUT(skb, TCA_SKBEDIT_PARMS, sizeof(opt), &opt); |
170 | if (d->flags & SKBEDIT_F_PRIORITY) | 171 | if (d->flags & SKBEDIT_F_PRIORITY) |
171 | NLA_PUT(skb, TCA_SKBEDIT_PRIORITY, sizeof(d->priority), | 172 | NLA_PUT(skb, TCA_SKBEDIT_PRIORITY, sizeof(d->priority), |
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index ba59983aaffe..b14ed4b1f27c 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -2504,7 +2504,7 @@ static struct xfrm_policy *xfrm_compile_policy(struct sock *sk, int opt, | |||
2504 | if (p->dir > XFRM_POLICY_OUT) | 2504 | if (p->dir > XFRM_POLICY_OUT) |
2505 | return NULL; | 2505 | return NULL; |
2506 | 2506 | ||
2507 | xp = xfrm_policy_alloc(net, GFP_KERNEL); | 2507 | xp = xfrm_policy_alloc(net, GFP_ATOMIC); |
2508 | if (xp == NULL) { | 2508 | if (xp == NULL) { |
2509 | *dir = -ENOBUFS; | 2509 | *dir = -ENOBUFS; |
2510 | return NULL; | 2510 | return NULL; |