aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-04-05 17:04:10 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-05 17:04:10 -0400
commit53f63189b1110559dce8c1ee29e8abc3e31f7630 (patch)
tree5f9850243be2ab26d4ad3ad6829eaa93d90f188f
parent6cfa92382e5f11be0bdb5ced62ed249004708f6c (diff)
parent124dff01afbdbff251f0385beca84ba1b9adda68 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Fix erroneous sock_orphan() leading to crashes and double kfree_skb() in NFC protocol. From Thierry Escande and Samuel Ortiz. 2) Fix use after free in remain-on-channel mac80211 code, from Johannes Berg. 3) nf_reset() needs to reset the NF tracing cookie, otherwise we can leak it from one namespace into another. Fix from Gao Feng and Patrick McHardy. 4) Fix overflow in channel scanning array of mwifiex driver, from Stone Piao. 5) Fix loss of link after suspend/shutdown in r8169, from Hayes Wang. 6) Synchronization of unicast address lists to the undelying device doesn't work because whether to sync is maintained as a boolean rather than a true count. Fix from Vlad Yasevich. 7) Fix corruption of TSO packets in atl1e by limiting the segmented packet length. From Hannes Frederic Sowa. 8) Revert bogus AF_UNIX credential passing change and fix the coalescing issue properly, from Eric W Biederman. 9) Changes of ipv4 address lifetime settings needs to generate a notification, from Jiri Pirko. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (22 commits) netfilter: don't reset nf_trace in nf_reset() net: ipv4: notify when address lifetime changes ixgbe: fix registration order of driver and DCA nofitication af_unix: If we don't care about credentials coallesce all messages Revert "af_unix: dont send SCM_CREDENTIAL when dest socket is NULL" bonding: remove sysfs before removing devices atl1e: limit gso segment size to prevent generation of wrong ip length fields net: count hw_addr syncs so that unsync works properly. r8169: fix auto speed down issue netfilter: ip6t_NPT: Fix translation for non-multiple of 32 prefix lengths mwifiex: limit channel number not to overflow memory NFC: microread: Fix build failure due to a new MEI bus API iwlwifi: dvm: fix the passive-no-RX workaround netfilter: nf_conntrack: fix error return code NFC: llcp: Keep the connected socket parent pointer alive mac80211: fix idle handling sequence netfilter: nfnetlink_acct: return -EINVAL if object name is empty netfilter: nfnetlink_queue: fix error return code in nfnetlink_queue_init() netfilter: reset nf_trace in nf_reset mac80211: fix remain-on-channel cancel crash ...
-rw-r--r--drivers/net/bonding/bond_main.c2
-rw-r--r--drivers/net/ethernet/atheros/atl1e/atl1e.h2
-rw-r--r--drivers/net/ethernet/atheros/atl1e/atl1e_main.c1
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c11
-rw-r--r--drivers/net/ethernet/realtek/r8169.c28
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/rxon.c18
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/tx.c2
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c3
-rw-r--r--drivers/nfc/microread/mei.c38
-rw-r--r--include/linux/netdevice.h2
-rw-r--r--include/linux/skbuff.h7
-rw-r--r--net/core/dev.c1
-rw-r--r--net/core/dev_addr_lists.c6
-rw-r--r--net/ipv4/devinet.c6
-rw-r--r--net/ipv6/netfilter/ip6t_NPT.c2
-rw-r--r--net/mac80211/cfg.c6
-rw-r--r--net/mac80211/chan.c17
-rw-r--r--net/mac80211/ieee80211_i.h4
-rw-r--r--net/mac80211/iface.c2
-rw-r--r--net/mac80211/offchannel.c23
-rw-r--r--net/netfilter/nf_conntrack_standalone.c1
-rw-r--r--net/netfilter/nfnetlink_acct.c2
-rw-r--r--net/netfilter/nfnetlink_queue_core.c4
-rw-r--r--net/nfc/llcp/llcp.c8
-rw-r--r--net/nfc/llcp/sock.c6
-rw-r--r--net/unix/af_unix.c6
26 files changed, 133 insertions, 75 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index a51241b2e621..171b10f167a5 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4902,8 +4902,8 @@ static void __exit bonding_exit(void)
4902 4902
4903 bond_destroy_debugfs(); 4903 bond_destroy_debugfs();
4904 4904
4905 rtnl_link_unregister(&bond_link_ops);
4906 unregister_pernet_subsys(&bond_net_ops); 4905 unregister_pernet_subsys(&bond_net_ops);
4906 rtnl_link_unregister(&bond_link_ops);
4907 4907
4908#ifdef CONFIG_NET_POLL_CONTROLLER 4908#ifdef CONFIG_NET_POLL_CONTROLLER
4909 /* 4909 /*
diff --git a/drivers/net/ethernet/atheros/atl1e/atl1e.h b/drivers/net/ethernet/atheros/atl1e/atl1e.h
index edfdf6b950e7..b5fd934585e9 100644
--- a/drivers/net/ethernet/atheros/atl1e/atl1e.h
+++ b/drivers/net/ethernet/atheros/atl1e/atl1e.h
@@ -186,7 +186,7 @@ struct atl1e_tpd_desc {
186/* how about 0x2000 */ 186/* how about 0x2000 */
187#define MAX_TX_BUF_LEN 0x2000 187#define MAX_TX_BUF_LEN 0x2000
188#define MAX_TX_BUF_SHIFT 13 188#define MAX_TX_BUF_SHIFT 13
189/*#define MAX_TX_BUF_LEN 0x3000 */ 189#define MAX_TSO_SEG_SIZE 0x3c00
190 190
191/* rrs word 1 bit 0:31 */ 191/* rrs word 1 bit 0:31 */
192#define RRS_RX_CSUM_MASK 0xFFFF 192#define RRS_RX_CSUM_MASK 0xFFFF
diff --git a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
index f73d5609439a..ac25f05ff68f 100644
--- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
+++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
@@ -2329,6 +2329,7 @@ static int atl1e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2329 2329
2330 INIT_WORK(&adapter->reset_task, atl1e_reset_task); 2330 INIT_WORK(&adapter->reset_task, atl1e_reset_task);
2331 INIT_WORK(&adapter->link_chg_task, atl1e_link_chg_task); 2331 INIT_WORK(&adapter->link_chg_task, atl1e_link_chg_task);
2332 netif_set_gso_max_size(netdev, MAX_TSO_SEG_SIZE);
2332 err = register_netdev(netdev); 2333 err = register_netdev(netdev);
2333 if (err) { 2334 if (err) {
2334 netdev_err(netdev, "register netdevice failed\n"); 2335 netdev_err(netdev, "register netdevice failed\n");
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index db5611ae407e..79f4a26ea6cc 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -7922,12 +7922,19 @@ static int __init ixgbe_init_module(void)
7922 ixgbe_dbg_init(); 7922 ixgbe_dbg_init();
7923#endif /* CONFIG_DEBUG_FS */ 7923#endif /* CONFIG_DEBUG_FS */
7924 7924
7925 ret = pci_register_driver(&ixgbe_driver);
7926 if (ret) {
7927#ifdef CONFIG_DEBUG_FS
7928 ixgbe_dbg_exit();
7929#endif /* CONFIG_DEBUG_FS */
7930 return ret;
7931 }
7932
7925#ifdef CONFIG_IXGBE_DCA 7933#ifdef CONFIG_IXGBE_DCA
7926 dca_register_notify(&dca_notifier); 7934 dca_register_notify(&dca_notifier);
7927#endif 7935#endif
7928 7936
7929 ret = pci_register_driver(&ixgbe_driver); 7937 return 0;
7930 return ret;
7931} 7938}
7932 7939
7933module_init(ixgbe_init_module); 7940module_init(ixgbe_init_module);
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 28fb50a1e9c3..4ecbe64a758d 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -3818,6 +3818,30 @@ static void rtl_init_mdio_ops(struct rtl8169_private *tp)
3818 } 3818 }
3819} 3819}
3820 3820
3821static void rtl_speed_down(struct rtl8169_private *tp)
3822{
3823 u32 adv;
3824 int lpa;
3825
3826 rtl_writephy(tp, 0x1f, 0x0000);
3827 lpa = rtl_readphy(tp, MII_LPA);
3828
3829 if (lpa & (LPA_10HALF | LPA_10FULL))
3830 adv = ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full;
3831 else if (lpa & (LPA_100HALF | LPA_100FULL))
3832 adv = ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full |
3833 ADVERTISED_100baseT_Half | ADVERTISED_100baseT_Full;
3834 else
3835 adv = ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full |
3836 ADVERTISED_100baseT_Half | ADVERTISED_100baseT_Full |
3837 (tp->mii.supports_gmii ?
3838 ADVERTISED_1000baseT_Half |
3839 ADVERTISED_1000baseT_Full : 0);
3840
3841 rtl8169_set_speed(tp->dev, AUTONEG_ENABLE, SPEED_1000, DUPLEX_FULL,
3842 adv);
3843}
3844
3821static void rtl_wol_suspend_quirk(struct rtl8169_private *tp) 3845static void rtl_wol_suspend_quirk(struct rtl8169_private *tp)
3822{ 3846{
3823 void __iomem *ioaddr = tp->mmio_addr; 3847 void __iomem *ioaddr = tp->mmio_addr;
@@ -3848,9 +3872,7 @@ static bool rtl_wol_pll_power_down(struct rtl8169_private *tp)
3848 if (!(__rtl8169_get_wol(tp) & WAKE_ANY)) 3872 if (!(__rtl8169_get_wol(tp) & WAKE_ANY))
3849 return false; 3873 return false;
3850 3874
3851 rtl_writephy(tp, 0x1f, 0x0000); 3875 rtl_speed_down(tp);
3852 rtl_writephy(tp, MII_BMCR, 0x0000);
3853
3854 rtl_wol_suspend_quirk(tp); 3876 rtl_wol_suspend_quirk(tp);
3855 3877
3856 return true; 3878 return true;
diff --git a/drivers/net/wireless/iwlwifi/dvm/rxon.c b/drivers/net/wireless/iwlwifi/dvm/rxon.c
index 23be948cf162..a82b6b39d4ff 100644
--- a/drivers/net/wireless/iwlwifi/dvm/rxon.c
+++ b/drivers/net/wireless/iwlwifi/dvm/rxon.c
@@ -1419,6 +1419,14 @@ void iwlagn_bss_info_changed(struct ieee80211_hw *hw,
1419 1419
1420 mutex_lock(&priv->mutex); 1420 mutex_lock(&priv->mutex);
1421 1421
1422 if (changes & BSS_CHANGED_IDLE && bss_conf->idle) {
1423 /*
1424 * If we go idle, then clearly no "passive-no-rx"
1425 * workaround is needed any more, this is a reset.
1426 */
1427 iwlagn_lift_passive_no_rx(priv);
1428 }
1429
1422 if (unlikely(!iwl_is_ready(priv))) { 1430 if (unlikely(!iwl_is_ready(priv))) {
1423 IWL_DEBUG_MAC80211(priv, "leave - not ready\n"); 1431 IWL_DEBUG_MAC80211(priv, "leave - not ready\n");
1424 mutex_unlock(&priv->mutex); 1432 mutex_unlock(&priv->mutex);
@@ -1450,16 +1458,6 @@ void iwlagn_bss_info_changed(struct ieee80211_hw *hw,
1450 priv->timestamp = bss_conf->sync_tsf; 1458 priv->timestamp = bss_conf->sync_tsf;
1451 ctx->staging.filter_flags |= RXON_FILTER_ASSOC_MSK; 1459 ctx->staging.filter_flags |= RXON_FILTER_ASSOC_MSK;
1452 } else { 1460 } else {
1453 /*
1454 * If we disassociate while there are pending
1455 * frames, just wake up the queues and let the
1456 * frames "escape" ... This shouldn't really
1457 * be happening to start with, but we should
1458 * not get stuck in this case either since it
1459 * can happen if userspace gets confused.
1460 */
1461 iwlagn_lift_passive_no_rx(priv);
1462
1463 ctx->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK; 1461 ctx->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
1464 1462
1465 if (ctx->ctxid == IWL_RXON_CTX_BSS) 1463 if (ctx->ctxid == IWL_RXON_CTX_BSS)
diff --git a/drivers/net/wireless/iwlwifi/dvm/tx.c b/drivers/net/wireless/iwlwifi/dvm/tx.c
index 6aec2df3bb27..d1a670d7b10c 100644
--- a/drivers/net/wireless/iwlwifi/dvm/tx.c
+++ b/drivers/net/wireless/iwlwifi/dvm/tx.c
@@ -1192,7 +1192,7 @@ int iwlagn_rx_reply_tx(struct iwl_priv *priv, struct iwl_rx_cmd_buffer *rxb,
1192 memset(&info->status, 0, sizeof(info->status)); 1192 memset(&info->status, 0, sizeof(info->status));
1193 1193
1194 if (status == TX_STATUS_FAIL_PASSIVE_NO_RX && 1194 if (status == TX_STATUS_FAIL_PASSIVE_NO_RX &&
1195 iwl_is_associated_ctx(ctx) && ctx->vif && 1195 ctx->vif &&
1196 ctx->vif->type == NL80211_IFTYPE_STATION) { 1196 ctx->vif->type == NL80211_IFTYPE_STATION) {
1197 /* block and stop all queues */ 1197 /* block and stop all queues */
1198 priv->passive_no_rx = true; 1198 priv->passive_no_rx = true;
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index a44023a7bd57..8aaf56ade4d9 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -1892,7 +1892,8 @@ mwifiex_cfg80211_scan(struct wiphy *wiphy,
1892 } 1892 }
1893 } 1893 }
1894 1894
1895 for (i = 0; i < request->n_channels; i++) { 1895 for (i = 0; i < min_t(u32, request->n_channels,
1896 MWIFIEX_USER_SCAN_CHAN_MAX); i++) {
1896 chan = request->channels[i]; 1897 chan = request->channels[i];
1897 priv->user_scan_cfg->chan_list[i].chan_number = chan->hw_value; 1898 priv->user_scan_cfg->chan_list[i].chan_number = chan->hw_value;
1898 priv->user_scan_cfg->chan_list[i].radio_type = chan->band; 1899 priv->user_scan_cfg->chan_list[i].radio_type = chan->band;
diff --git a/drivers/nfc/microread/mei.c b/drivers/nfc/microread/mei.c
index eef38cfd812e..ca33ae193935 100644
--- a/drivers/nfc/microread/mei.c
+++ b/drivers/nfc/microread/mei.c
@@ -22,7 +22,7 @@
22#include <linux/slab.h> 22#include <linux/slab.h>
23#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/mei_bus.h> 25#include <linux/mei_cl_bus.h>
26 26
27#include <linux/nfc.h> 27#include <linux/nfc.h>
28#include <net/nfc/hci.h> 28#include <net/nfc/hci.h>
@@ -32,9 +32,6 @@
32 32
33#define MICROREAD_DRIVER_NAME "microread" 33#define MICROREAD_DRIVER_NAME "microread"
34 34
35#define MICROREAD_UUID UUID_LE(0x0bb17a78, 0x2a8e, 0x4c50, 0x94, \
36 0xd4, 0x50, 0x26, 0x67, 0x23, 0x77, 0x5c)
37
38struct mei_nfc_hdr { 35struct mei_nfc_hdr {
39 u8 cmd; 36 u8 cmd;
40 u8 status; 37 u8 status;
@@ -48,7 +45,7 @@ struct mei_nfc_hdr {
48#define MEI_NFC_MAX_READ (MEI_NFC_HEADER_SIZE + MEI_NFC_MAX_HCI_PAYLOAD) 45#define MEI_NFC_MAX_READ (MEI_NFC_HEADER_SIZE + MEI_NFC_MAX_HCI_PAYLOAD)
49 46
50struct microread_mei_phy { 47struct microread_mei_phy {
51 struct mei_device *mei_device; 48 struct mei_cl_device *device;
52 struct nfc_hci_dev *hdev; 49 struct nfc_hci_dev *hdev;
53 50
54 int powered; 51 int powered;
@@ -105,14 +102,14 @@ static int microread_mei_write(void *phy_id, struct sk_buff *skb)
105 102
106 MEI_DUMP_SKB_OUT("mei frame sent", skb); 103 MEI_DUMP_SKB_OUT("mei frame sent", skb);
107 104
108 r = mei_send(phy->device, skb->data, skb->len); 105 r = mei_cl_send(phy->device, skb->data, skb->len);
109 if (r > 0) 106 if (r > 0)
110 r = 0; 107 r = 0;
111 108
112 return r; 109 return r;
113} 110}
114 111
115static void microread_event_cb(struct mei_device *device, u32 events, 112static void microread_event_cb(struct mei_cl_device *device, u32 events,
116 void *context) 113 void *context)
117{ 114{
118 struct microread_mei_phy *phy = context; 115 struct microread_mei_phy *phy = context;
@@ -120,7 +117,7 @@ static void microread_event_cb(struct mei_device *device, u32 events,
120 if (phy->hard_fault != 0) 117 if (phy->hard_fault != 0)
121 return; 118 return;
122 119
123 if (events & BIT(MEI_EVENT_RX)) { 120 if (events & BIT(MEI_CL_EVENT_RX)) {
124 struct sk_buff *skb; 121 struct sk_buff *skb;
125 int reply_size; 122 int reply_size;
126 123
@@ -128,7 +125,7 @@ static void microread_event_cb(struct mei_device *device, u32 events,
128 if (!skb) 125 if (!skb)
129 return; 126 return;
130 127
131 reply_size = mei_recv(device, skb->data, MEI_NFC_MAX_READ); 128 reply_size = mei_cl_recv(device, skb->data, MEI_NFC_MAX_READ);
132 if (reply_size < MEI_NFC_HEADER_SIZE) { 129 if (reply_size < MEI_NFC_HEADER_SIZE) {
133 kfree(skb); 130 kfree(skb);
134 return; 131 return;
@@ -149,8 +146,8 @@ static struct nfc_phy_ops mei_phy_ops = {
149 .disable = microread_mei_disable, 146 .disable = microread_mei_disable,
150}; 147};
151 148
152static int microread_mei_probe(struct mei_device *device, 149static int microread_mei_probe(struct mei_cl_device *device,
153 const struct mei_id *id) 150 const struct mei_cl_device_id *id)
154{ 151{
155 struct microread_mei_phy *phy; 152 struct microread_mei_phy *phy;
156 int r; 153 int r;
@@ -164,9 +161,9 @@ static int microread_mei_probe(struct mei_device *device,
164 } 161 }
165 162
166 phy->device = device; 163 phy->device = device;
167 mei_set_clientdata(device, phy); 164 mei_cl_set_drvdata(device, phy);
168 165
169 r = mei_register_event_cb(device, microread_event_cb, phy); 166 r = mei_cl_register_event_cb(device, microread_event_cb, phy);
170 if (r) { 167 if (r) {
171 pr_err(MICROREAD_DRIVER_NAME ": event cb registration failed\n"); 168 pr_err(MICROREAD_DRIVER_NAME ": event cb registration failed\n");
172 goto err_out; 169 goto err_out;
@@ -186,9 +183,9 @@ err_out:
186 return r; 183 return r;
187} 184}
188 185
189static int microread_mei_remove(struct mei_device *device) 186static int microread_mei_remove(struct mei_cl_device *device)
190{ 187{
191 struct microread_mei_phy *phy = mei_get_clientdata(device); 188 struct microread_mei_phy *phy = mei_cl_get_drvdata(device);
192 189
193 pr_info("Removing microread\n"); 190 pr_info("Removing microread\n");
194 191
@@ -202,16 +199,15 @@ static int microread_mei_remove(struct mei_device *device)
202 return 0; 199 return 0;
203} 200}
204 201
205static struct mei_id microread_mei_tbl[] = { 202static struct mei_cl_device_id microread_mei_tbl[] = {
206 { MICROREAD_DRIVER_NAME, MICROREAD_UUID }, 203 { MICROREAD_DRIVER_NAME },
207 204
208 /* required last entry */ 205 /* required last entry */
209 { } 206 { }
210}; 207};
211
212MODULE_DEVICE_TABLE(mei, microread_mei_tbl); 208MODULE_DEVICE_TABLE(mei, microread_mei_tbl);
213 209
214static struct mei_driver microread_driver = { 210static struct mei_cl_driver microread_driver = {
215 .id_table = microread_mei_tbl, 211 .id_table = microread_mei_tbl,
216 .name = MICROREAD_DRIVER_NAME, 212 .name = MICROREAD_DRIVER_NAME,
217 213
@@ -225,7 +221,7 @@ static int microread_mei_init(void)
225 221
226 pr_debug(DRIVER_DESC ": %s\n", __func__); 222 pr_debug(DRIVER_DESC ": %s\n", __func__);
227 223
228 r = mei_driver_register(&microread_driver); 224 r = mei_cl_driver_register(&microread_driver);
229 if (r) { 225 if (r) {
230 pr_err(MICROREAD_DRIVER_NAME ": driver registration failed\n"); 226 pr_err(MICROREAD_DRIVER_NAME ": driver registration failed\n");
231 return r; 227 return r;
@@ -236,7 +232,7 @@ static int microread_mei_init(void)
236 232
237static void microread_mei_exit(void) 233static void microread_mei_exit(void)
238{ 234{
239 mei_driver_unregister(&microread_driver); 235 mei_cl_driver_unregister(&microread_driver);
240} 236}
241 237
242module_init(microread_mei_init); 238module_init(microread_mei_init);
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 8bfa95600e48..6151e903eef0 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -210,9 +210,9 @@ struct netdev_hw_addr {
210#define NETDEV_HW_ADDR_T_SLAVE 3 210#define NETDEV_HW_ADDR_T_SLAVE 3
211#define NETDEV_HW_ADDR_T_UNICAST 4 211#define NETDEV_HW_ADDR_T_UNICAST 4
212#define NETDEV_HW_ADDR_T_MULTICAST 5 212#define NETDEV_HW_ADDR_T_MULTICAST 5
213 bool synced;
214 bool global_use; 213 bool global_use;
215 int refcount; 214 int refcount;
215 int synced;
216 struct rcu_head rcu_head; 216 struct rcu_head rcu_head;
217}; 217};
218 218
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 441f5bfdab8e..b8292d8cc9fa 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2643,6 +2643,13 @@ static inline void nf_reset(struct sk_buff *skb)
2643#endif 2643#endif
2644} 2644}
2645 2645
2646static inline void nf_reset_trace(struct sk_buff *skb)
2647{
2648#if IS_ENABLED(CONFIG_NETFILTER_XT_TARGET_TRACE)
2649 skb->nf_trace = 0;
2650#endif
2651}
2652
2646/* Note: This doesn't put any conntrack and bridge info in dst. */ 2653/* Note: This doesn't put any conntrack and bridge info in dst. */
2647static inline void __nf_copy(struct sk_buff *dst, const struct sk_buff *src) 2654static inline void __nf_copy(struct sk_buff *dst, const struct sk_buff *src)
2648{ 2655{
diff --git a/net/core/dev.c b/net/core/dev.c
index 13e6447f0398..e7d68ed8aafe 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1639,6 +1639,7 @@ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb)
1639 skb->mark = 0; 1639 skb->mark = 0;
1640 secpath_reset(skb); 1640 secpath_reset(skb);
1641 nf_reset(skb); 1641 nf_reset(skb);
1642 nf_reset_trace(skb);
1642 return netif_rx(skb); 1643 return netif_rx(skb);
1643} 1644}
1644EXPORT_SYMBOL_GPL(dev_forward_skb); 1645EXPORT_SYMBOL_GPL(dev_forward_skb);
diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c
index bd2eb9d3e369..abdc9e6ef33e 100644
--- a/net/core/dev_addr_lists.c
+++ b/net/core/dev_addr_lists.c
@@ -37,7 +37,7 @@ static int __hw_addr_create_ex(struct netdev_hw_addr_list *list,
37 ha->type = addr_type; 37 ha->type = addr_type;
38 ha->refcount = 1; 38 ha->refcount = 1;
39 ha->global_use = global; 39 ha->global_use = global;
40 ha->synced = false; 40 ha->synced = 0;
41 list_add_tail_rcu(&ha->list, &list->list); 41 list_add_tail_rcu(&ha->list, &list->list);
42 list->count++; 42 list->count++;
43 43
@@ -165,7 +165,7 @@ int __hw_addr_sync(struct netdev_hw_addr_list *to_list,
165 addr_len, ha->type); 165 addr_len, ha->type);
166 if (err) 166 if (err)
167 break; 167 break;
168 ha->synced = true; 168 ha->synced++;
169 ha->refcount++; 169 ha->refcount++;
170 } else if (ha->refcount == 1) { 170 } else if (ha->refcount == 1) {
171 __hw_addr_del(to_list, ha->addr, addr_len, ha->type); 171 __hw_addr_del(to_list, ha->addr, addr_len, ha->type);
@@ -186,7 +186,7 @@ void __hw_addr_unsync(struct netdev_hw_addr_list *to_list,
186 if (ha->synced) { 186 if (ha->synced) {
187 __hw_addr_del(to_list, ha->addr, 187 __hw_addr_del(to_list, ha->addr,
188 addr_len, ha->type); 188 addr_len, ha->type);
189 ha->synced = false; 189 ha->synced--;
190 __hw_addr_del(from_list, ha->addr, 190 __hw_addr_del(from_list, ha->addr,
191 addr_len, ha->type); 191 addr_len, ha->type);
192 } 192 }
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index f678507bc829..96083b7a436b 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -802,8 +802,10 @@ static int inet_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg
802 if (nlh->nlmsg_flags & NLM_F_EXCL || 802 if (nlh->nlmsg_flags & NLM_F_EXCL ||
803 !(nlh->nlmsg_flags & NLM_F_REPLACE)) 803 !(nlh->nlmsg_flags & NLM_F_REPLACE))
804 return -EEXIST; 804 return -EEXIST;
805 805 ifa = ifa_existing;
806 set_ifa_lifetime(ifa_existing, valid_lft, prefered_lft); 806 set_ifa_lifetime(ifa, valid_lft, prefered_lft);
807 rtmsg_ifa(RTM_NEWADDR, ifa, nlh, NETLINK_CB(skb).portid);
808 blocking_notifier_call_chain(&inetaddr_chain, NETDEV_UP, ifa);
807 } 809 }
808 return 0; 810 return 0;
809} 811}
diff --git a/net/ipv6/netfilter/ip6t_NPT.c b/net/ipv6/netfilter/ip6t_NPT.c
index 33608c610276..cb631143721c 100644
--- a/net/ipv6/netfilter/ip6t_NPT.c
+++ b/net/ipv6/netfilter/ip6t_NPT.c
@@ -57,7 +57,7 @@ static bool ip6t_npt_map_pfx(const struct ip6t_npt_tginfo *npt,
57 if (pfx_len - i >= 32) 57 if (pfx_len - i >= 32)
58 mask = 0; 58 mask = 0;
59 else 59 else
60 mask = htonl(~((1 << (pfx_len - i)) - 1)); 60 mask = htonl((1 << (i - pfx_len + 32)) - 1);
61 61
62 idx = i / 32; 62 idx = i / 32;
63 addr->s6_addr32[idx] &= mask; 63 addr->s6_addr32[idx] &= mask;
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index fb306814576a..a6893602f87a 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2582,7 +2582,7 @@ static int ieee80211_cancel_roc(struct ieee80211_local *local,
2582 list_del(&dep->list); 2582 list_del(&dep->list);
2583 mutex_unlock(&local->mtx); 2583 mutex_unlock(&local->mtx);
2584 2584
2585 ieee80211_roc_notify_destroy(dep); 2585 ieee80211_roc_notify_destroy(dep, true);
2586 return 0; 2586 return 0;
2587 } 2587 }
2588 2588
@@ -2622,7 +2622,7 @@ static int ieee80211_cancel_roc(struct ieee80211_local *local,
2622 ieee80211_start_next_roc(local); 2622 ieee80211_start_next_roc(local);
2623 mutex_unlock(&local->mtx); 2623 mutex_unlock(&local->mtx);
2624 2624
2625 ieee80211_roc_notify_destroy(found); 2625 ieee80211_roc_notify_destroy(found, true);
2626 } else { 2626 } else {
2627 /* work may be pending so use it all the time */ 2627 /* work may be pending so use it all the time */
2628 found->abort = true; 2628 found->abort = true;
@@ -2632,6 +2632,8 @@ static int ieee80211_cancel_roc(struct ieee80211_local *local,
2632 2632
2633 /* work will clean up etc */ 2633 /* work will clean up etc */
2634 flush_delayed_work(&found->work); 2634 flush_delayed_work(&found->work);
2635 WARN_ON(!found->to_be_freed);
2636 kfree(found);
2635 } 2637 }
2636 2638
2637 return 0; 2639 return 0;
diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
index 78c0d90dd641..931be419ab5a 100644
--- a/net/mac80211/chan.c
+++ b/net/mac80211/chan.c
@@ -63,6 +63,7 @@ ieee80211_new_chanctx(struct ieee80211_local *local,
63 enum ieee80211_chanctx_mode mode) 63 enum ieee80211_chanctx_mode mode)
64{ 64{
65 struct ieee80211_chanctx *ctx; 65 struct ieee80211_chanctx *ctx;
66 u32 changed;
66 int err; 67 int err;
67 68
68 lockdep_assert_held(&local->chanctx_mtx); 69 lockdep_assert_held(&local->chanctx_mtx);
@@ -76,6 +77,13 @@ ieee80211_new_chanctx(struct ieee80211_local *local,
76 ctx->conf.rx_chains_dynamic = 1; 77 ctx->conf.rx_chains_dynamic = 1;
77 ctx->mode = mode; 78 ctx->mode = mode;
78 79
80 /* acquire mutex to prevent idle from changing */
81 mutex_lock(&local->mtx);
82 /* turn idle off *before* setting channel -- some drivers need that */
83 changed = ieee80211_idle_off(local);
84 if (changed)
85 ieee80211_hw_config(local, changed);
86
79 if (!local->use_chanctx) { 87 if (!local->use_chanctx) {
80 local->_oper_channel_type = 88 local->_oper_channel_type =
81 cfg80211_get_chandef_type(chandef); 89 cfg80211_get_chandef_type(chandef);
@@ -85,14 +93,17 @@ ieee80211_new_chanctx(struct ieee80211_local *local,
85 err = drv_add_chanctx(local, ctx); 93 err = drv_add_chanctx(local, ctx);
86 if (err) { 94 if (err) {
87 kfree(ctx); 95 kfree(ctx);
88 return ERR_PTR(err); 96 ctx = ERR_PTR(err);
97
98 ieee80211_recalc_idle(local);
99 goto out;
89 } 100 }
90 } 101 }
91 102
103 /* and keep the mutex held until the new chanctx is on the list */
92 list_add_rcu(&ctx->list, &local->chanctx_list); 104 list_add_rcu(&ctx->list, &local->chanctx_list);
93 105
94 mutex_lock(&local->mtx); 106 out:
95 ieee80211_recalc_idle(local);
96 mutex_unlock(&local->mtx); 107 mutex_unlock(&local->mtx);
97 108
98 return ctx; 109 return ctx;
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 388580a1bada..5672533a0832 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -309,6 +309,7 @@ struct ieee80211_roc_work {
309 struct ieee80211_channel *chan; 309 struct ieee80211_channel *chan;
310 310
311 bool started, abort, hw_begun, notified; 311 bool started, abort, hw_begun, notified;
312 bool to_be_freed;
312 313
313 unsigned long hw_start_time; 314 unsigned long hw_start_time;
314 315
@@ -1347,7 +1348,7 @@ void ieee80211_offchannel_return(struct ieee80211_local *local);
1347void ieee80211_roc_setup(struct ieee80211_local *local); 1348void ieee80211_roc_setup(struct ieee80211_local *local);
1348void ieee80211_start_next_roc(struct ieee80211_local *local); 1349void ieee80211_start_next_roc(struct ieee80211_local *local);
1349void ieee80211_roc_purge(struct ieee80211_sub_if_data *sdata); 1350void ieee80211_roc_purge(struct ieee80211_sub_if_data *sdata);
1350void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc); 1351void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc, bool free);
1351void ieee80211_sw_roc_work(struct work_struct *work); 1352void ieee80211_sw_roc_work(struct work_struct *work);
1352void ieee80211_handle_roc_started(struct ieee80211_roc_work *roc); 1353void ieee80211_handle_roc_started(struct ieee80211_roc_work *roc);
1353 1354
@@ -1361,6 +1362,7 @@ int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata,
1361 enum nl80211_iftype type); 1362 enum nl80211_iftype type);
1362void ieee80211_if_remove(struct ieee80211_sub_if_data *sdata); 1363void ieee80211_if_remove(struct ieee80211_sub_if_data *sdata);
1363void ieee80211_remove_interfaces(struct ieee80211_local *local); 1364void ieee80211_remove_interfaces(struct ieee80211_local *local);
1365u32 ieee80211_idle_off(struct ieee80211_local *local);
1364void ieee80211_recalc_idle(struct ieee80211_local *local); 1366void ieee80211_recalc_idle(struct ieee80211_local *local);
1365void ieee80211_adjust_monitor_flags(struct ieee80211_sub_if_data *sdata, 1367void ieee80211_adjust_monitor_flags(struct ieee80211_sub_if_data *sdata,
1366 const int offset); 1368 const int offset);
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 3bfe2612c8c2..58150f877ec3 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -78,7 +78,7 @@ void ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata)
78 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_TXPOWER); 78 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_TXPOWER);
79} 79}
80 80
81static u32 ieee80211_idle_off(struct ieee80211_local *local) 81u32 ieee80211_idle_off(struct ieee80211_local *local)
82{ 82{
83 if (!(local->hw.conf.flags & IEEE80211_CONF_IDLE)) 83 if (!(local->hw.conf.flags & IEEE80211_CONF_IDLE))
84 return 0; 84 return 0;
diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c
index cc79b4a2e821..430bd254e496 100644
--- a/net/mac80211/offchannel.c
+++ b/net/mac80211/offchannel.c
@@ -297,10 +297,13 @@ void ieee80211_start_next_roc(struct ieee80211_local *local)
297 } 297 }
298} 298}
299 299
300void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc) 300void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc, bool free)
301{ 301{
302 struct ieee80211_roc_work *dep, *tmp; 302 struct ieee80211_roc_work *dep, *tmp;
303 303
304 if (WARN_ON(roc->to_be_freed))
305 return;
306
304 /* was never transmitted */ 307 /* was never transmitted */
305 if (roc->frame) { 308 if (roc->frame) {
306 cfg80211_mgmt_tx_status(&roc->sdata->wdev, 309 cfg80211_mgmt_tx_status(&roc->sdata->wdev,
@@ -316,9 +319,12 @@ void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc)
316 GFP_KERNEL); 319 GFP_KERNEL);
317 320
318 list_for_each_entry_safe(dep, tmp, &roc->dependents, list) 321 list_for_each_entry_safe(dep, tmp, &roc->dependents, list)
319 ieee80211_roc_notify_destroy(dep); 322 ieee80211_roc_notify_destroy(dep, true);
320 323
321 kfree(roc); 324 if (free)
325 kfree(roc);
326 else
327 roc->to_be_freed = true;
322} 328}
323 329
324void ieee80211_sw_roc_work(struct work_struct *work) 330void ieee80211_sw_roc_work(struct work_struct *work)
@@ -331,6 +337,9 @@ void ieee80211_sw_roc_work(struct work_struct *work)
331 337
332 mutex_lock(&local->mtx); 338 mutex_lock(&local->mtx);
333 339
340 if (roc->to_be_freed)
341 goto out_unlock;
342
334 if (roc->abort) 343 if (roc->abort)
335 goto finish; 344 goto finish;
336 345
@@ -370,7 +379,7 @@ void ieee80211_sw_roc_work(struct work_struct *work)
370 finish: 379 finish:
371 list_del(&roc->list); 380 list_del(&roc->list);
372 started = roc->started; 381 started = roc->started;
373 ieee80211_roc_notify_destroy(roc); 382 ieee80211_roc_notify_destroy(roc, !roc->abort);
374 383
375 if (started) { 384 if (started) {
376 drv_flush(local, false); 385 drv_flush(local, false);
@@ -410,7 +419,7 @@ static void ieee80211_hw_roc_done(struct work_struct *work)
410 419
411 list_del(&roc->list); 420 list_del(&roc->list);
412 421
413 ieee80211_roc_notify_destroy(roc); 422 ieee80211_roc_notify_destroy(roc, true);
414 423
415 /* if there's another roc, start it now */ 424 /* if there's another roc, start it now */
416 ieee80211_start_next_roc(local); 425 ieee80211_start_next_roc(local);
@@ -460,12 +469,14 @@ void ieee80211_roc_purge(struct ieee80211_sub_if_data *sdata)
460 list_for_each_entry_safe(roc, tmp, &tmp_list, list) { 469 list_for_each_entry_safe(roc, tmp, &tmp_list, list) {
461 if (local->ops->remain_on_channel) { 470 if (local->ops->remain_on_channel) {
462 list_del(&roc->list); 471 list_del(&roc->list);
463 ieee80211_roc_notify_destroy(roc); 472 ieee80211_roc_notify_destroy(roc, true);
464 } else { 473 } else {
465 ieee80211_queue_delayed_work(&local->hw, &roc->work, 0); 474 ieee80211_queue_delayed_work(&local->hw, &roc->work, 0);
466 475
467 /* work will clean up etc */ 476 /* work will clean up etc */
468 flush_delayed_work(&roc->work); 477 flush_delayed_work(&roc->work);
478 WARN_ON(!roc->to_be_freed);
479 kfree(roc);
469 } 480 }
470 } 481 }
471 482
diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c
index 6bcce401fd1c..fedee3943661 100644
--- a/net/netfilter/nf_conntrack_standalone.c
+++ b/net/netfilter/nf_conntrack_standalone.c
@@ -568,6 +568,7 @@ static int __init nf_conntrack_standalone_init(void)
568 register_net_sysctl(&init_net, "net", nf_ct_netfilter_table); 568 register_net_sysctl(&init_net, "net", nf_ct_netfilter_table);
569 if (!nf_ct_netfilter_header) { 569 if (!nf_ct_netfilter_header) {
570 pr_err("nf_conntrack: can't register to sysctl.\n"); 570 pr_err("nf_conntrack: can't register to sysctl.\n");
571 ret = -ENOMEM;
571 goto out_sysctl; 572 goto out_sysctl;
572 } 573 }
573#endif 574#endif
diff --git a/net/netfilter/nfnetlink_acct.c b/net/netfilter/nfnetlink_acct.c
index 589d686f0b4c..dc3fd5d44464 100644
--- a/net/netfilter/nfnetlink_acct.c
+++ b/net/netfilter/nfnetlink_acct.c
@@ -49,6 +49,8 @@ nfnl_acct_new(struct sock *nfnl, struct sk_buff *skb,
49 return -EINVAL; 49 return -EINVAL;
50 50
51 acct_name = nla_data(tb[NFACCT_NAME]); 51 acct_name = nla_data(tb[NFACCT_NAME]);
52 if (strlen(acct_name) == 0)
53 return -EINVAL;
52 54
53 list_for_each_entry(nfacct, &nfnl_acct_list, head) { 55 list_for_each_entry(nfacct, &nfnl_acct_list, head) {
54 if (strncmp(nfacct->name, acct_name, NFACCT_NAME_MAX) != 0) 56 if (strncmp(nfacct->name, acct_name, NFACCT_NAME_MAX) != 0)
diff --git a/net/netfilter/nfnetlink_queue_core.c b/net/netfilter/nfnetlink_queue_core.c
index 1cb48540f86a..42680b2baa11 100644
--- a/net/netfilter/nfnetlink_queue_core.c
+++ b/net/netfilter/nfnetlink_queue_core.c
@@ -1062,8 +1062,10 @@ static int __init nfnetlink_queue_init(void)
1062 1062
1063#ifdef CONFIG_PROC_FS 1063#ifdef CONFIG_PROC_FS
1064 if (!proc_create("nfnetlink_queue", 0440, 1064 if (!proc_create("nfnetlink_queue", 0440,
1065 proc_net_netfilter, &nfqnl_file_ops)) 1065 proc_net_netfilter, &nfqnl_file_ops)) {
1066 status = -ENOMEM;
1066 goto cleanup_subsys; 1067 goto cleanup_subsys;
1068 }
1067#endif 1069#endif
1068 1070
1069 register_netdevice_notifier(&nfqnl_dev_notifier); 1071 register_netdevice_notifier(&nfqnl_dev_notifier);
diff --git a/net/nfc/llcp/llcp.c b/net/nfc/llcp/llcp.c
index b530afadd76c..ee25f25f0cd6 100644
--- a/net/nfc/llcp/llcp.c
+++ b/net/nfc/llcp/llcp.c
@@ -107,8 +107,6 @@ static void nfc_llcp_socket_release(struct nfc_llcp_local *local, bool listen,
107 accept_sk->sk_state_change(sk); 107 accept_sk->sk_state_change(sk);
108 108
109 bh_unlock_sock(accept_sk); 109 bh_unlock_sock(accept_sk);
110
111 sock_orphan(accept_sk);
112 } 110 }
113 111
114 if (listen == true) { 112 if (listen == true) {
@@ -134,8 +132,6 @@ static void nfc_llcp_socket_release(struct nfc_llcp_local *local, bool listen,
134 132
135 bh_unlock_sock(sk); 133 bh_unlock_sock(sk);
136 134
137 sock_orphan(sk);
138
139 sk_del_node_init(sk); 135 sk_del_node_init(sk);
140 } 136 }
141 137
@@ -164,8 +160,6 @@ static void nfc_llcp_socket_release(struct nfc_llcp_local *local, bool listen,
164 160
165 bh_unlock_sock(sk); 161 bh_unlock_sock(sk);
166 162
167 sock_orphan(sk);
168
169 sk_del_node_init(sk); 163 sk_del_node_init(sk);
170 } 164 }
171 165
@@ -827,7 +821,6 @@ static void nfc_llcp_recv_ui(struct nfc_llcp_local *local,
827 skb_get(skb); 821 skb_get(skb);
828 } else { 822 } else {
829 pr_err("Receive queue is full\n"); 823 pr_err("Receive queue is full\n");
830 kfree_skb(skb);
831 } 824 }
832 825
833 nfc_llcp_sock_put(llcp_sock); 826 nfc_llcp_sock_put(llcp_sock);
@@ -1028,7 +1021,6 @@ static void nfc_llcp_recv_hdlc(struct nfc_llcp_local *local,
1028 skb_get(skb); 1021 skb_get(skb);
1029 } else { 1022 } else {
1030 pr_err("Receive queue is full\n"); 1023 pr_err("Receive queue is full\n");
1031 kfree_skb(skb);
1032 } 1024 }
1033 } 1025 }
1034 1026
diff --git a/net/nfc/llcp/sock.c b/net/nfc/llcp/sock.c
index 5c7cdf3f2a83..8f025746f337 100644
--- a/net/nfc/llcp/sock.c
+++ b/net/nfc/llcp/sock.c
@@ -270,7 +270,9 @@ struct sock *nfc_llcp_accept_dequeue(struct sock *parent,
270 } 270 }
271 271
272 if (sk->sk_state == LLCP_CONNECTED || !newsock) { 272 if (sk->sk_state == LLCP_CONNECTED || !newsock) {
273 nfc_llcp_accept_unlink(sk); 273 list_del_init(&lsk->accept_queue);
274 sock_put(sk);
275
274 if (newsock) 276 if (newsock)
275 sock_graft(sk, newsock); 277 sock_graft(sk, newsock);
276 278
@@ -464,8 +466,6 @@ static int llcp_sock_release(struct socket *sock)
464 nfc_llcp_accept_unlink(accept_sk); 466 nfc_llcp_accept_unlink(accept_sk);
465 467
466 release_sock(accept_sk); 468 release_sock(accept_sk);
467
468 sock_orphan(accept_sk);
469 } 469 }
470 } 470 }
471 471
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 971282b6f6a3..2db702d82e7d 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -1412,8 +1412,8 @@ static void maybe_add_creds(struct sk_buff *skb, const struct socket *sock,
1412 if (UNIXCB(skb).cred) 1412 if (UNIXCB(skb).cred)
1413 return; 1413 return;
1414 if (test_bit(SOCK_PASSCRED, &sock->flags) || 1414 if (test_bit(SOCK_PASSCRED, &sock->flags) ||
1415 (other->sk_socket && 1415 !other->sk_socket ||
1416 test_bit(SOCK_PASSCRED, &other->sk_socket->flags))) { 1416 test_bit(SOCK_PASSCRED, &other->sk_socket->flags)) {
1417 UNIXCB(skb).pid = get_pid(task_tgid(current)); 1417 UNIXCB(skb).pid = get_pid(task_tgid(current));
1418 UNIXCB(skb).cred = get_current_cred(); 1418 UNIXCB(skb).cred = get_current_cred();
1419 } 1419 }
@@ -1993,7 +1993,7 @@ again:
1993 if ((UNIXCB(skb).pid != siocb->scm->pid) || 1993 if ((UNIXCB(skb).pid != siocb->scm->pid) ||
1994 (UNIXCB(skb).cred != siocb->scm->cred)) 1994 (UNIXCB(skb).cred != siocb->scm->cred))
1995 break; 1995 break;
1996 } else { 1996 } else if (test_bit(SOCK_PASSCRED, &sock->flags)) {
1997 /* Copy credentials */ 1997 /* Copy credentials */
1998 scm_set_cred(siocb->scm, UNIXCB(skb).pid, UNIXCB(skb).cred); 1998 scm_set_cred(siocb->scm, UNIXCB(skb).pid, UNIXCB(skb).cred);
1999 check_creds = 1; 1999 check_creds = 1;