diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/devinet.c | 15 | ||||
-rw-r--r-- | net/ipv4/route.c | 4 | ||||
-rw-r--r-- | net/ipv4/tcp_output.c | 6 | ||||
-rw-r--r-- | net/ipv6/raw.c | 6 | ||||
-rw-r--r-- | net/mac80211/debugfs_key.c | 6 | ||||
-rw-r--r-- | net/mac80211/debugfs_netdev.c | 24 | ||||
-rw-r--r-- | net/mac80211/ieee80211_i.h | 10 | ||||
-rw-r--r-- | net/mac80211/mesh.c | 2 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 52 | ||||
-rw-r--r-- | net/rfkill/rfkill.c | 2 | ||||
-rw-r--r-- | net/sched/cls_api.c | 2 | ||||
-rw-r--r-- | net/sched/cls_route.c | 2 | ||||
-rw-r--r-- | net/sched/sch_api.c | 26 | ||||
-rw-r--r-- | net/sched/sch_cbq.c | 6 | ||||
-rw-r--r-- | net/sched/sch_generic.c | 4 | ||||
-rw-r--r-- | net/sched/sch_hfsc.c | 4 | ||||
-rw-r--r-- | net/sched/sch_htb.c | 8 | ||||
-rw-r--r-- | net/sched/sch_netem.c | 2 | ||||
-rw-r--r-- | net/sched/sch_teql.c | 2 | ||||
-rw-r--r-- | net/sctp/auth.c | 3 | ||||
-rw-r--r-- | net/sctp/socket.c | 8 | ||||
-rw-r--r-- | net/sunrpc/sysctl.c | 18 | ||||
-rw-r--r-- | net/sunrpc/xprtrdma/svc_rdma_recvfrom.c | 8 | ||||
-rw-r--r-- | net/sunrpc/xprtrdma/svc_rdma_transport.c | 5 | ||||
-rw-r--r-- | net/wireless/Kconfig | 3 | ||||
-rw-r--r-- | net/xfrm/xfrm_policy.c | 6 | ||||
-rw-r--r-- | net/xfrm/xfrm_state.c | 32 |
27 files changed, 135 insertions, 131 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 91d3d96805d0..b12dae2b0b2d 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -1029,6 +1029,11 @@ skip: | |||
1029 | } | 1029 | } |
1030 | } | 1030 | } |
1031 | 1031 | ||
1032 | static inline bool inetdev_valid_mtu(unsigned mtu) | ||
1033 | { | ||
1034 | return mtu >= 68; | ||
1035 | } | ||
1036 | |||
1032 | /* Called only under RTNL semaphore */ | 1037 | /* Called only under RTNL semaphore */ |
1033 | 1038 | ||
1034 | static int inetdev_event(struct notifier_block *this, unsigned long event, | 1039 | static int inetdev_event(struct notifier_block *this, unsigned long event, |
@@ -1048,6 +1053,10 @@ static int inetdev_event(struct notifier_block *this, unsigned long event, | |||
1048 | IN_DEV_CONF_SET(in_dev, NOXFRM, 1); | 1053 | IN_DEV_CONF_SET(in_dev, NOXFRM, 1); |
1049 | IN_DEV_CONF_SET(in_dev, NOPOLICY, 1); | 1054 | IN_DEV_CONF_SET(in_dev, NOPOLICY, 1); |
1050 | } | 1055 | } |
1056 | } else if (event == NETDEV_CHANGEMTU) { | ||
1057 | /* Re-enabling IP */ | ||
1058 | if (inetdev_valid_mtu(dev->mtu)) | ||
1059 | in_dev = inetdev_init(dev); | ||
1051 | } | 1060 | } |
1052 | goto out; | 1061 | goto out; |
1053 | } | 1062 | } |
@@ -1058,7 +1067,7 @@ static int inetdev_event(struct notifier_block *this, unsigned long event, | |||
1058 | dev->ip_ptr = NULL; | 1067 | dev->ip_ptr = NULL; |
1059 | break; | 1068 | break; |
1060 | case NETDEV_UP: | 1069 | case NETDEV_UP: |
1061 | if (dev->mtu < 68) | 1070 | if (!inetdev_valid_mtu(dev->mtu)) |
1062 | break; | 1071 | break; |
1063 | if (dev->flags & IFF_LOOPBACK) { | 1072 | if (dev->flags & IFF_LOOPBACK) { |
1064 | struct in_ifaddr *ifa; | 1073 | struct in_ifaddr *ifa; |
@@ -1080,9 +1089,9 @@ static int inetdev_event(struct notifier_block *this, unsigned long event, | |||
1080 | ip_mc_down(in_dev); | 1089 | ip_mc_down(in_dev); |
1081 | break; | 1090 | break; |
1082 | case NETDEV_CHANGEMTU: | 1091 | case NETDEV_CHANGEMTU: |
1083 | if (dev->mtu >= 68) | 1092 | if (inetdev_valid_mtu(dev->mtu)) |
1084 | break; | 1093 | break; |
1085 | /* MTU falled under 68, disable IP */ | 1094 | /* disable IP when MTU is not enough */ |
1086 | case NETDEV_UNREGISTER: | 1095 | case NETDEV_UNREGISTER: |
1087 | inetdev_destroy(in_dev); | 1096 | inetdev_destroy(in_dev); |
1088 | break; | 1097 | break; |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index e91bafeb32f4..6ee5354c9aa1 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -3121,9 +3121,9 @@ static struct ctl_table empty[1]; | |||
3121 | static struct ctl_table ipv4_skeleton[] = | 3121 | static struct ctl_table ipv4_skeleton[] = |
3122 | { | 3122 | { |
3123 | { .procname = "route", .ctl_name = NET_IPV4_ROUTE, | 3123 | { .procname = "route", .ctl_name = NET_IPV4_ROUTE, |
3124 | .child = ipv4_route_table}, | 3124 | .mode = 0555, .child = ipv4_route_table}, |
3125 | { .procname = "neigh", .ctl_name = NET_IPV4_NEIGH, | 3125 | { .procname = "neigh", .ctl_name = NET_IPV4_NEIGH, |
3126 | .child = empty}, | 3126 | .mode = 0555, .child = empty}, |
3127 | { } | 3127 | { } |
3128 | }; | 3128 | }; |
3129 | 3129 | ||
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index a00532de2a8c..8165f5aa8c71 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -468,7 +468,8 @@ static unsigned tcp_syn_options(struct sock *sk, struct sk_buff *skb, | |||
468 | } | 468 | } |
469 | if (likely(sysctl_tcp_window_scaling)) { | 469 | if (likely(sysctl_tcp_window_scaling)) { |
470 | opts->ws = tp->rx_opt.rcv_wscale; | 470 | opts->ws = tp->rx_opt.rcv_wscale; |
471 | size += TCPOLEN_WSCALE_ALIGNED; | 471 | if(likely(opts->ws)) |
472 | size += TCPOLEN_WSCALE_ALIGNED; | ||
472 | } | 473 | } |
473 | if (likely(sysctl_tcp_sack)) { | 474 | if (likely(sysctl_tcp_sack)) { |
474 | opts->options |= OPTION_SACK_ADVERTISE; | 475 | opts->options |= OPTION_SACK_ADVERTISE; |
@@ -509,7 +510,8 @@ static unsigned tcp_synack_options(struct sock *sk, | |||
509 | 510 | ||
510 | if (likely(ireq->wscale_ok)) { | 511 | if (likely(ireq->wscale_ok)) { |
511 | opts->ws = ireq->rcv_wscale; | 512 | opts->ws = ireq->rcv_wscale; |
512 | size += TCPOLEN_WSCALE_ALIGNED; | 513 | if(likely(opts->ws)) |
514 | size += TCPOLEN_WSCALE_ALIGNED; | ||
513 | } | 515 | } |
514 | if (likely(doing_ts)) { | 516 | if (likely(doing_ts)) { |
515 | opts->options |= OPTION_TS; | 517 | opts->options |= OPTION_TS; |
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index 01d47674f7e5..e53e493606c5 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
@@ -377,14 +377,14 @@ static inline int rawv6_rcv_skb(struct sock * sk, struct sk_buff * skb) | |||
377 | skb_checksum_complete(skb)) { | 377 | skb_checksum_complete(skb)) { |
378 | atomic_inc(&sk->sk_drops); | 378 | atomic_inc(&sk->sk_drops); |
379 | kfree_skb(skb); | 379 | kfree_skb(skb); |
380 | return 0; | 380 | return NET_RX_DROP; |
381 | } | 381 | } |
382 | 382 | ||
383 | /* Charge it to the socket. */ | 383 | /* Charge it to the socket. */ |
384 | if (sock_queue_rcv_skb(sk,skb)<0) { | 384 | if (sock_queue_rcv_skb(sk,skb)<0) { |
385 | atomic_inc(&sk->sk_drops); | 385 | atomic_inc(&sk->sk_drops); |
386 | kfree_skb(skb); | 386 | kfree_skb(skb); |
387 | return 0; | 387 | return NET_RX_DROP; |
388 | } | 388 | } |
389 | 389 | ||
390 | return 0; | 390 | return 0; |
@@ -429,7 +429,7 @@ int rawv6_rcv(struct sock *sk, struct sk_buff *skb) | |||
429 | if (skb_checksum_complete(skb)) { | 429 | if (skb_checksum_complete(skb)) { |
430 | atomic_inc(&sk->sk_drops); | 430 | atomic_inc(&sk->sk_drops); |
431 | kfree_skb(skb); | 431 | kfree_skb(skb); |
432 | return 0; | 432 | return NET_RX_DROP; |
433 | } | 433 | } |
434 | } | 434 | } |
435 | 435 | ||
diff --git a/net/mac80211/debugfs_key.c b/net/mac80211/debugfs_key.c index 7439b63df5d0..cf82acec913a 100644 --- a/net/mac80211/debugfs_key.c +++ b/net/mac80211/debugfs_key.c | |||
@@ -265,7 +265,7 @@ void ieee80211_debugfs_key_add_default(struct ieee80211_sub_if_data *sdata) | |||
265 | key = sdata->default_key; | 265 | key = sdata->default_key; |
266 | if (key) { | 266 | if (key) { |
267 | sprintf(buf, "../keys/%d", key->debugfs.cnt); | 267 | sprintf(buf, "../keys/%d", key->debugfs.cnt); |
268 | sdata->debugfs.default_key = | 268 | sdata->common_debugfs.default_key = |
269 | debugfs_create_symlink("default_key", | 269 | debugfs_create_symlink("default_key", |
270 | sdata->debugfsdir, buf); | 270 | sdata->debugfsdir, buf); |
271 | } else | 271 | } else |
@@ -277,8 +277,8 @@ void ieee80211_debugfs_key_remove_default(struct ieee80211_sub_if_data *sdata) | |||
277 | if (!sdata) | 277 | if (!sdata) |
278 | return; | 278 | return; |
279 | 279 | ||
280 | debugfs_remove(sdata->debugfs.default_key); | 280 | debugfs_remove(sdata->common_debugfs.default_key); |
281 | sdata->debugfs.default_key = NULL; | 281 | sdata->common_debugfs.default_key = NULL; |
282 | } | 282 | } |
283 | 283 | ||
284 | void ieee80211_debugfs_key_sta_del(struct ieee80211_key *key, | 284 | void ieee80211_debugfs_key_sta_del(struct ieee80211_key *key, |
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c index 475f89a8aee1..8165df578c92 100644 --- a/net/mac80211/debugfs_netdev.c +++ b/net/mac80211/debugfs_netdev.c | |||
@@ -248,8 +248,8 @@ IEEE80211_IF_WFILE(min_discovery_timeout, | |||
248 | static void add_sta_files(struct ieee80211_sub_if_data *sdata) | 248 | static void add_sta_files(struct ieee80211_sub_if_data *sdata) |
249 | { | 249 | { |
250 | DEBUGFS_ADD(drop_unencrypted, sta); | 250 | DEBUGFS_ADD(drop_unencrypted, sta); |
251 | DEBUGFS_ADD(force_unicast_rateidx, ap); | 251 | DEBUGFS_ADD(force_unicast_rateidx, sta); |
252 | DEBUGFS_ADD(max_ratectrl_rateidx, ap); | 252 | DEBUGFS_ADD(max_ratectrl_rateidx, sta); |
253 | 253 | ||
254 | DEBUGFS_ADD(state, sta); | 254 | DEBUGFS_ADD(state, sta); |
255 | DEBUGFS_ADD(bssid, sta); | 255 | DEBUGFS_ADD(bssid, sta); |
@@ -283,8 +283,8 @@ static void add_ap_files(struct ieee80211_sub_if_data *sdata) | |||
283 | static void add_wds_files(struct ieee80211_sub_if_data *sdata) | 283 | static void add_wds_files(struct ieee80211_sub_if_data *sdata) |
284 | { | 284 | { |
285 | DEBUGFS_ADD(drop_unencrypted, wds); | 285 | DEBUGFS_ADD(drop_unencrypted, wds); |
286 | DEBUGFS_ADD(force_unicast_rateidx, ap); | 286 | DEBUGFS_ADD(force_unicast_rateidx, wds); |
287 | DEBUGFS_ADD(max_ratectrl_rateidx, ap); | 287 | DEBUGFS_ADD(max_ratectrl_rateidx, wds); |
288 | 288 | ||
289 | DEBUGFS_ADD(peer, wds); | 289 | DEBUGFS_ADD(peer, wds); |
290 | } | 290 | } |
@@ -292,8 +292,8 @@ static void add_wds_files(struct ieee80211_sub_if_data *sdata) | |||
292 | static void add_vlan_files(struct ieee80211_sub_if_data *sdata) | 292 | static void add_vlan_files(struct ieee80211_sub_if_data *sdata) |
293 | { | 293 | { |
294 | DEBUGFS_ADD(drop_unencrypted, vlan); | 294 | DEBUGFS_ADD(drop_unencrypted, vlan); |
295 | DEBUGFS_ADD(force_unicast_rateidx, ap); | 295 | DEBUGFS_ADD(force_unicast_rateidx, vlan); |
296 | DEBUGFS_ADD(max_ratectrl_rateidx, ap); | 296 | DEBUGFS_ADD(max_ratectrl_rateidx, vlan); |
297 | } | 297 | } |
298 | 298 | ||
299 | static void add_monitor_files(struct ieee80211_sub_if_data *sdata) | 299 | static void add_monitor_files(struct ieee80211_sub_if_data *sdata) |
@@ -381,8 +381,8 @@ static void add_files(struct ieee80211_sub_if_data *sdata) | |||
381 | static void del_sta_files(struct ieee80211_sub_if_data *sdata) | 381 | static void del_sta_files(struct ieee80211_sub_if_data *sdata) |
382 | { | 382 | { |
383 | DEBUGFS_DEL(drop_unencrypted, sta); | 383 | DEBUGFS_DEL(drop_unencrypted, sta); |
384 | DEBUGFS_DEL(force_unicast_rateidx, ap); | 384 | DEBUGFS_DEL(force_unicast_rateidx, sta); |
385 | DEBUGFS_DEL(max_ratectrl_rateidx, ap); | 385 | DEBUGFS_DEL(max_ratectrl_rateidx, sta); |
386 | 386 | ||
387 | DEBUGFS_DEL(state, sta); | 387 | DEBUGFS_DEL(state, sta); |
388 | DEBUGFS_DEL(bssid, sta); | 388 | DEBUGFS_DEL(bssid, sta); |
@@ -416,8 +416,8 @@ static void del_ap_files(struct ieee80211_sub_if_data *sdata) | |||
416 | static void del_wds_files(struct ieee80211_sub_if_data *sdata) | 416 | static void del_wds_files(struct ieee80211_sub_if_data *sdata) |
417 | { | 417 | { |
418 | DEBUGFS_DEL(drop_unencrypted, wds); | 418 | DEBUGFS_DEL(drop_unencrypted, wds); |
419 | DEBUGFS_DEL(force_unicast_rateidx, ap); | 419 | DEBUGFS_DEL(force_unicast_rateidx, wds); |
420 | DEBUGFS_DEL(max_ratectrl_rateidx, ap); | 420 | DEBUGFS_DEL(max_ratectrl_rateidx, wds); |
421 | 421 | ||
422 | DEBUGFS_DEL(peer, wds); | 422 | DEBUGFS_DEL(peer, wds); |
423 | } | 423 | } |
@@ -425,8 +425,8 @@ static void del_wds_files(struct ieee80211_sub_if_data *sdata) | |||
425 | static void del_vlan_files(struct ieee80211_sub_if_data *sdata) | 425 | static void del_vlan_files(struct ieee80211_sub_if_data *sdata) |
426 | { | 426 | { |
427 | DEBUGFS_DEL(drop_unencrypted, vlan); | 427 | DEBUGFS_DEL(drop_unencrypted, vlan); |
428 | DEBUGFS_DEL(force_unicast_rateidx, ap); | 428 | DEBUGFS_DEL(force_unicast_rateidx, vlan); |
429 | DEBUGFS_DEL(max_ratectrl_rateidx, ap); | 429 | DEBUGFS_DEL(max_ratectrl_rateidx, vlan); |
430 | } | 430 | } |
431 | 431 | ||
432 | static void del_monitor_files(struct ieee80211_sub_if_data *sdata) | 432 | static void del_monitor_files(struct ieee80211_sub_if_data *sdata) |
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index ec59345af65b..4498d8713652 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -470,6 +470,8 @@ struct ieee80211_sub_if_data { | |||
470 | struct dentry *auth_transaction; | 470 | struct dentry *auth_transaction; |
471 | struct dentry *flags; | 471 | struct dentry *flags; |
472 | struct dentry *num_beacons_sta; | 472 | struct dentry *num_beacons_sta; |
473 | struct dentry *force_unicast_rateidx; | ||
474 | struct dentry *max_ratectrl_rateidx; | ||
473 | } sta; | 475 | } sta; |
474 | struct { | 476 | struct { |
475 | struct dentry *drop_unencrypted; | 477 | struct dentry *drop_unencrypted; |
@@ -483,15 +485,21 @@ struct ieee80211_sub_if_data { | |||
483 | struct { | 485 | struct { |
484 | struct dentry *drop_unencrypted; | 486 | struct dentry *drop_unencrypted; |
485 | struct dentry *peer; | 487 | struct dentry *peer; |
488 | struct dentry *force_unicast_rateidx; | ||
489 | struct dentry *max_ratectrl_rateidx; | ||
486 | } wds; | 490 | } wds; |
487 | struct { | 491 | struct { |
488 | struct dentry *drop_unencrypted; | 492 | struct dentry *drop_unencrypted; |
493 | struct dentry *force_unicast_rateidx; | ||
494 | struct dentry *max_ratectrl_rateidx; | ||
489 | } vlan; | 495 | } vlan; |
490 | struct { | 496 | struct { |
491 | struct dentry *mode; | 497 | struct dentry *mode; |
492 | } monitor; | 498 | } monitor; |
493 | struct dentry *default_key; | ||
494 | } debugfs; | 499 | } debugfs; |
500 | struct { | ||
501 | struct dentry *default_key; | ||
502 | } common_debugfs; | ||
495 | 503 | ||
496 | #ifdef CONFIG_MAC80211_MESH | 504 | #ifdef CONFIG_MAC80211_MESH |
497 | struct dentry *mesh_stats_dir; | 505 | struct dentry *mesh_stats_dir; |
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index b5933b271491..35f2f95f2fa7 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c | |||
@@ -383,7 +383,7 @@ errcopy: | |||
383 | hlist_for_each_safe(p, q, &newtbl->hash_buckets[i]) | 383 | hlist_for_each_safe(p, q, &newtbl->hash_buckets[i]) |
384 | tbl->free_node(p, 0); | 384 | tbl->free_node(p, 0); |
385 | } | 385 | } |
386 | __mesh_table_free(tbl); | 386 | __mesh_table_free(newtbl); |
387 | endgrow: | 387 | endgrow: |
388 | return NULL; | 388 | return NULL; |
389 | } | 389 | } |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 1e97fb9fb34b..9bb68c6a8f44 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -478,51 +478,21 @@ int ieee80211_ht_addt_info_ie_to_ht_bss_info( | |||
478 | static void ieee80211_sta_send_associnfo(struct net_device *dev, | 478 | static void ieee80211_sta_send_associnfo(struct net_device *dev, |
479 | struct ieee80211_if_sta *ifsta) | 479 | struct ieee80211_if_sta *ifsta) |
480 | { | 480 | { |
481 | char *buf; | ||
482 | size_t len; | ||
483 | int i; | ||
484 | union iwreq_data wrqu; | 481 | union iwreq_data wrqu; |
485 | 482 | ||
486 | if (!ifsta->assocreq_ies && !ifsta->assocresp_ies) | ||
487 | return; | ||
488 | |||
489 | buf = kmalloc(50 + 2 * (ifsta->assocreq_ies_len + | ||
490 | ifsta->assocresp_ies_len), GFP_KERNEL); | ||
491 | if (!buf) | ||
492 | return; | ||
493 | |||
494 | len = sprintf(buf, "ASSOCINFO("); | ||
495 | if (ifsta->assocreq_ies) { | 483 | if (ifsta->assocreq_ies) { |
496 | len += sprintf(buf + len, "ReqIEs="); | 484 | memset(&wrqu, 0, sizeof(wrqu)); |
497 | for (i = 0; i < ifsta->assocreq_ies_len; i++) { | 485 | wrqu.data.length = ifsta->assocreq_ies_len; |
498 | len += sprintf(buf + len, "%02x", | 486 | wireless_send_event(dev, IWEVASSOCREQIE, &wrqu, |
499 | ifsta->assocreq_ies[i]); | 487 | ifsta->assocreq_ies); |
500 | } | ||
501 | } | 488 | } |
502 | if (ifsta->assocresp_ies) { | ||
503 | if (ifsta->assocreq_ies) | ||
504 | len += sprintf(buf + len, " "); | ||
505 | len += sprintf(buf + len, "RespIEs="); | ||
506 | for (i = 0; i < ifsta->assocresp_ies_len; i++) { | ||
507 | len += sprintf(buf + len, "%02x", | ||
508 | ifsta->assocresp_ies[i]); | ||
509 | } | ||
510 | } | ||
511 | len += sprintf(buf + len, ")"); | ||
512 | 489 | ||
513 | if (len > IW_CUSTOM_MAX) { | 490 | if (ifsta->assocresp_ies) { |
514 | len = sprintf(buf, "ASSOCRESPIE="); | 491 | memset(&wrqu, 0, sizeof(wrqu)); |
515 | for (i = 0; i < ifsta->assocresp_ies_len; i++) { | 492 | wrqu.data.length = ifsta->assocresp_ies_len; |
516 | len += sprintf(buf + len, "%02x", | 493 | wireless_send_event(dev, IWEVASSOCRESPIE, &wrqu, |
517 | ifsta->assocresp_ies[i]); | 494 | ifsta->assocresp_ies); |
518 | } | ||
519 | } | 495 | } |
520 | |||
521 | memset(&wrqu, 0, sizeof(wrqu)); | ||
522 | wrqu.data.length = len; | ||
523 | wireless_send_event(dev, IWEVCUSTOM, &wrqu, buf); | ||
524 | |||
525 | kfree(buf); | ||
526 | } | 496 | } |
527 | 497 | ||
528 | 498 | ||
@@ -813,7 +783,7 @@ static void ieee80211_send_assoc(struct net_device *dev, | |||
813 | } | 783 | } |
814 | } | 784 | } |
815 | 785 | ||
816 | if (count == 8) { | 786 | if (rates_len > count) { |
817 | pos = skb_put(skb, rates_len - count + 2); | 787 | pos = skb_put(skb, rates_len - count + 2); |
818 | *pos++ = WLAN_EID_EXT_SUPP_RATES; | 788 | *pos++ = WLAN_EID_EXT_SUPP_RATES; |
819 | *pos++ = rates_len - count; | 789 | *pos++ = rates_len - count; |
@@ -2868,7 +2838,7 @@ static void ieee80211_rx_bss_info(struct net_device *dev, | |||
2868 | jiffies); | 2838 | jiffies); |
2869 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ | 2839 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ |
2870 | if (beacon_timestamp > rx_timestamp) { | 2840 | if (beacon_timestamp > rx_timestamp) { |
2871 | #ifndef CONFIG_MAC80211_IBSS_DEBUG | 2841 | #ifdef CONFIG_MAC80211_IBSS_DEBUG |
2872 | printk(KERN_DEBUG "%s: beacon TSF higher than " | 2842 | printk(KERN_DEBUG "%s: beacon TSF higher than " |
2873 | "local TSF - IBSS merge with BSSID %s\n", | 2843 | "local TSF - IBSS merge with BSSID %s\n", |
2874 | dev->name, print_mac(mac, mgmt->bssid)); | 2844 | dev->name, print_mac(mac, mgmt->bssid)); |
diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c index 35a9994e2339..74aecc098bad 100644 --- a/net/rfkill/rfkill.c +++ b/net/rfkill/rfkill.c | |||
@@ -377,7 +377,7 @@ static ssize_t rfkill_claim_show(struct device *dev, | |||
377 | { | 377 | { |
378 | struct rfkill *rfkill = to_rfkill(dev); | 378 | struct rfkill *rfkill = to_rfkill(dev); |
379 | 379 | ||
380 | return sprintf(buf, "%d", rfkill->user_claim); | 380 | return sprintf(buf, "%d\n", rfkill->user_claim); |
381 | } | 381 | } |
382 | 382 | ||
383 | static ssize_t rfkill_claim_store(struct device *dev, | 383 | static ssize_t rfkill_claim_store(struct device *dev, |
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index 5cafdd4c8018..8eb79e92e94c 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c | |||
@@ -205,7 +205,7 @@ replay: | |||
205 | } | 205 | } |
206 | } | 206 | } |
207 | 207 | ||
208 | root_lock = qdisc_root_lock(q); | 208 | root_lock = qdisc_root_sleeping_lock(q); |
209 | 209 | ||
210 | if (tp == NULL) { | 210 | if (tp == NULL) { |
211 | /* Proto-tcf does not exist, create new one */ | 211 | /* Proto-tcf does not exist, create new one */ |
diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c index 481260a4f10f..e3d8455eebc2 100644 --- a/net/sched/cls_route.c +++ b/net/sched/cls_route.c | |||
@@ -75,7 +75,7 @@ static __inline__ int route4_fastmap_hash(u32 id, int iif) | |||
75 | static inline | 75 | static inline |
76 | void route4_reset_fastmap(struct Qdisc *q, struct route4_head *head, u32 id) | 76 | void route4_reset_fastmap(struct Qdisc *q, struct route4_head *head, u32 id) |
77 | { | 77 | { |
78 | spinlock_t *root_lock = qdisc_root_lock(q); | 78 | spinlock_t *root_lock = qdisc_root_sleeping_lock(q); |
79 | 79 | ||
80 | spin_lock_bh(root_lock); | 80 | spin_lock_bh(root_lock); |
81 | memset(head->fastmap, 0, sizeof(head->fastmap)); | 81 | memset(head->fastmap, 0, sizeof(head->fastmap)); |
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index e7fb9e0d21b4..1122c952aa99 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c | |||
@@ -624,7 +624,7 @@ static struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue, | |||
624 | struct Qdisc *oqdisc = dev_queue->qdisc_sleeping; | 624 | struct Qdisc *oqdisc = dev_queue->qdisc_sleeping; |
625 | spinlock_t *root_lock; | 625 | spinlock_t *root_lock; |
626 | 626 | ||
627 | root_lock = qdisc_root_lock(oqdisc); | 627 | root_lock = qdisc_lock(oqdisc); |
628 | spin_lock_bh(root_lock); | 628 | spin_lock_bh(root_lock); |
629 | 629 | ||
630 | /* Prune old scheduler */ | 630 | /* Prune old scheduler */ |
@@ -635,7 +635,7 @@ static struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue, | |||
635 | if (qdisc == NULL) | 635 | if (qdisc == NULL) |
636 | qdisc = &noop_qdisc; | 636 | qdisc = &noop_qdisc; |
637 | dev_queue->qdisc_sleeping = qdisc; | 637 | dev_queue->qdisc_sleeping = qdisc; |
638 | dev_queue->qdisc = &noop_qdisc; | 638 | rcu_assign_pointer(dev_queue->qdisc, &noop_qdisc); |
639 | 639 | ||
640 | spin_unlock_bh(root_lock); | 640 | spin_unlock_bh(root_lock); |
641 | 641 | ||
@@ -830,9 +830,16 @@ qdisc_create(struct net_device *dev, struct netdev_queue *dev_queue, | |||
830 | sch->stab = stab; | 830 | sch->stab = stab; |
831 | } | 831 | } |
832 | if (tca[TCA_RATE]) { | 832 | if (tca[TCA_RATE]) { |
833 | spinlock_t *root_lock; | ||
834 | |||
835 | if ((sch->parent != TC_H_ROOT) && | ||
836 | !(sch->flags & TCQ_F_INGRESS)) | ||
837 | root_lock = qdisc_root_sleeping_lock(sch); | ||
838 | else | ||
839 | root_lock = qdisc_lock(sch); | ||
840 | |||
833 | err = gen_new_estimator(&sch->bstats, &sch->rate_est, | 841 | err = gen_new_estimator(&sch->bstats, &sch->rate_est, |
834 | qdisc_root_lock(sch), | 842 | root_lock, tca[TCA_RATE]); |
835 | tca[TCA_RATE]); | ||
836 | if (err) { | 843 | if (err) { |
837 | /* | 844 | /* |
838 | * Any broken qdiscs that would require | 845 | * Any broken qdiscs that would require |
@@ -884,7 +891,8 @@ static int qdisc_change(struct Qdisc *sch, struct nlattr **tca) | |||
884 | 891 | ||
885 | if (tca[TCA_RATE]) | 892 | if (tca[TCA_RATE]) |
886 | gen_replace_estimator(&sch->bstats, &sch->rate_est, | 893 | gen_replace_estimator(&sch->bstats, &sch->rate_est, |
887 | qdisc_root_lock(sch), tca[TCA_RATE]); | 894 | qdisc_root_sleeping_lock(sch), |
895 | tca[TCA_RATE]); | ||
888 | return 0; | 896 | return 0; |
889 | } | 897 | } |
890 | 898 | ||
@@ -1161,8 +1169,8 @@ static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid, | |||
1161 | if (q->stab && qdisc_dump_stab(skb, q->stab) < 0) | 1169 | if (q->stab && qdisc_dump_stab(skb, q->stab) < 0) |
1162 | goto nla_put_failure; | 1170 | goto nla_put_failure; |
1163 | 1171 | ||
1164 | if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS, | 1172 | if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS, TCA_XSTATS, |
1165 | TCA_XSTATS, qdisc_root_lock(q), &d) < 0) | 1173 | qdisc_root_sleeping_lock(q), &d) < 0) |
1166 | goto nla_put_failure; | 1174 | goto nla_put_failure; |
1167 | 1175 | ||
1168 | if (q->ops->dump_stats && q->ops->dump_stats(q, &d) < 0) | 1176 | if (q->ops->dump_stats && q->ops->dump_stats(q, &d) < 0) |
@@ -1453,8 +1461,8 @@ static int tc_fill_tclass(struct sk_buff *skb, struct Qdisc *q, | |||
1453 | if (cl_ops->dump && cl_ops->dump(q, cl, skb, tcm) < 0) | 1461 | if (cl_ops->dump && cl_ops->dump(q, cl, skb, tcm) < 0) |
1454 | goto nla_put_failure; | 1462 | goto nla_put_failure; |
1455 | 1463 | ||
1456 | if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS, | 1464 | if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS, TCA_XSTATS, |
1457 | TCA_XSTATS, qdisc_root_lock(q), &d) < 0) | 1465 | qdisc_root_sleeping_lock(q), &d) < 0) |
1458 | goto nla_put_failure; | 1466 | goto nla_put_failure; |
1459 | 1467 | ||
1460 | if (cl_ops->dump_stats && cl_ops->dump_stats(q, cl, &d) < 0) | 1468 | if (cl_ops->dump_stats && cl_ops->dump_stats(q, cl, &d) < 0) |
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c index 8fa90d68ec6d..8b06fa900482 100644 --- a/net/sched/sch_cbq.c +++ b/net/sched/sch_cbq.c | |||
@@ -1754,7 +1754,7 @@ static void cbq_put(struct Qdisc *sch, unsigned long arg) | |||
1754 | 1754 | ||
1755 | if (--cl->refcnt == 0) { | 1755 | if (--cl->refcnt == 0) { |
1756 | #ifdef CONFIG_NET_CLS_ACT | 1756 | #ifdef CONFIG_NET_CLS_ACT |
1757 | spinlock_t *root_lock = qdisc_root_lock(sch); | 1757 | spinlock_t *root_lock = qdisc_root_sleeping_lock(sch); |
1758 | struct cbq_sched_data *q = qdisc_priv(sch); | 1758 | struct cbq_sched_data *q = qdisc_priv(sch); |
1759 | 1759 | ||
1760 | spin_lock_bh(root_lock); | 1760 | spin_lock_bh(root_lock); |
@@ -1839,7 +1839,7 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct nlattr **t | |||
1839 | 1839 | ||
1840 | if (tca[TCA_RATE]) | 1840 | if (tca[TCA_RATE]) |
1841 | gen_replace_estimator(&cl->bstats, &cl->rate_est, | 1841 | gen_replace_estimator(&cl->bstats, &cl->rate_est, |
1842 | qdisc_root_lock(sch), | 1842 | qdisc_root_sleeping_lock(sch), |
1843 | tca[TCA_RATE]); | 1843 | tca[TCA_RATE]); |
1844 | return 0; | 1844 | return 0; |
1845 | } | 1845 | } |
@@ -1930,7 +1930,7 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct nlattr **t | |||
1930 | 1930 | ||
1931 | if (tca[TCA_RATE]) | 1931 | if (tca[TCA_RATE]) |
1932 | gen_new_estimator(&cl->bstats, &cl->rate_est, | 1932 | gen_new_estimator(&cl->bstats, &cl->rate_est, |
1933 | qdisc_root_lock(sch), tca[TCA_RATE]); | 1933 | qdisc_root_sleeping_lock(sch), tca[TCA_RATE]); |
1934 | 1934 | ||
1935 | *arg = (unsigned long)cl; | 1935 | *arg = (unsigned long)cl; |
1936 | return 0; | 1936 | return 0; |
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 5f0ade7806a7..9634091ee2f0 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c | |||
@@ -634,7 +634,7 @@ static void dev_deactivate_queue(struct net_device *dev, | |||
634 | if (!(qdisc->flags & TCQ_F_BUILTIN)) | 634 | if (!(qdisc->flags & TCQ_F_BUILTIN)) |
635 | set_bit(__QDISC_STATE_DEACTIVATED, &qdisc->state); | 635 | set_bit(__QDISC_STATE_DEACTIVATED, &qdisc->state); |
636 | 636 | ||
637 | dev_queue->qdisc = qdisc_default; | 637 | rcu_assign_pointer(dev_queue->qdisc, qdisc_default); |
638 | qdisc_reset(qdisc); | 638 | qdisc_reset(qdisc); |
639 | 639 | ||
640 | spin_unlock_bh(qdisc_lock(qdisc)); | 640 | spin_unlock_bh(qdisc_lock(qdisc)); |
@@ -709,7 +709,7 @@ static void shutdown_scheduler_queue(struct net_device *dev, | |||
709 | struct Qdisc *qdisc_default = _qdisc_default; | 709 | struct Qdisc *qdisc_default = _qdisc_default; |
710 | 710 | ||
711 | if (qdisc) { | 711 | if (qdisc) { |
712 | dev_queue->qdisc = qdisc_default; | 712 | rcu_assign_pointer(dev_queue->qdisc, qdisc_default); |
713 | dev_queue->qdisc_sleeping = qdisc_default; | 713 | dev_queue->qdisc_sleeping = qdisc_default; |
714 | 714 | ||
715 | qdisc_destroy(qdisc); | 715 | qdisc_destroy(qdisc); |
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c index c2b8d9cce3d2..c1e77da8cd09 100644 --- a/net/sched/sch_hfsc.c +++ b/net/sched/sch_hfsc.c | |||
@@ -1045,7 +1045,7 @@ hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid, | |||
1045 | 1045 | ||
1046 | if (tca[TCA_RATE]) | 1046 | if (tca[TCA_RATE]) |
1047 | gen_replace_estimator(&cl->bstats, &cl->rate_est, | 1047 | gen_replace_estimator(&cl->bstats, &cl->rate_est, |
1048 | qdisc_root_lock(sch), | 1048 | qdisc_root_sleeping_lock(sch), |
1049 | tca[TCA_RATE]); | 1049 | tca[TCA_RATE]); |
1050 | return 0; | 1050 | return 0; |
1051 | } | 1051 | } |
@@ -1104,7 +1104,7 @@ hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid, | |||
1104 | 1104 | ||
1105 | if (tca[TCA_RATE]) | 1105 | if (tca[TCA_RATE]) |
1106 | gen_new_estimator(&cl->bstats, &cl->rate_est, | 1106 | gen_new_estimator(&cl->bstats, &cl->rate_est, |
1107 | qdisc_root_lock(sch), tca[TCA_RATE]); | 1107 | qdisc_root_sleeping_lock(sch), tca[TCA_RATE]); |
1108 | *arg = (unsigned long)cl; | 1108 | *arg = (unsigned long)cl; |
1109 | return 0; | 1109 | return 0; |
1110 | } | 1110 | } |
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 0df0df202ed0..d14f02056ae6 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c | |||
@@ -1043,7 +1043,7 @@ static int htb_init(struct Qdisc *sch, struct nlattr *opt) | |||
1043 | 1043 | ||
1044 | static int htb_dump(struct Qdisc *sch, struct sk_buff *skb) | 1044 | static int htb_dump(struct Qdisc *sch, struct sk_buff *skb) |
1045 | { | 1045 | { |
1046 | spinlock_t *root_lock = qdisc_root_lock(sch); | 1046 | spinlock_t *root_lock = qdisc_root_sleeping_lock(sch); |
1047 | struct htb_sched *q = qdisc_priv(sch); | 1047 | struct htb_sched *q = qdisc_priv(sch); |
1048 | struct nlattr *nest; | 1048 | struct nlattr *nest; |
1049 | struct tc_htb_glob gopt; | 1049 | struct tc_htb_glob gopt; |
@@ -1075,7 +1075,7 @@ static int htb_dump_class(struct Qdisc *sch, unsigned long arg, | |||
1075 | struct sk_buff *skb, struct tcmsg *tcm) | 1075 | struct sk_buff *skb, struct tcmsg *tcm) |
1076 | { | 1076 | { |
1077 | struct htb_class *cl = (struct htb_class *)arg; | 1077 | struct htb_class *cl = (struct htb_class *)arg; |
1078 | spinlock_t *root_lock = qdisc_root_lock(sch); | 1078 | spinlock_t *root_lock = qdisc_root_sleeping_lock(sch); |
1079 | struct nlattr *nest; | 1079 | struct nlattr *nest; |
1080 | struct tc_htb_opt opt; | 1080 | struct tc_htb_opt opt; |
1081 | 1081 | ||
@@ -1372,7 +1372,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid, | |||
1372 | goto failure; | 1372 | goto failure; |
1373 | 1373 | ||
1374 | gen_new_estimator(&cl->bstats, &cl->rate_est, | 1374 | gen_new_estimator(&cl->bstats, &cl->rate_est, |
1375 | qdisc_root_lock(sch), | 1375 | qdisc_root_sleeping_lock(sch), |
1376 | tca[TCA_RATE] ? : &est.nla); | 1376 | tca[TCA_RATE] ? : &est.nla); |
1377 | cl->refcnt = 1; | 1377 | cl->refcnt = 1; |
1378 | cl->children = 0; | 1378 | cl->children = 0; |
@@ -1427,7 +1427,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid, | |||
1427 | } else { | 1427 | } else { |
1428 | if (tca[TCA_RATE]) | 1428 | if (tca[TCA_RATE]) |
1429 | gen_replace_estimator(&cl->bstats, &cl->rate_est, | 1429 | gen_replace_estimator(&cl->bstats, &cl->rate_est, |
1430 | qdisc_root_lock(sch), | 1430 | qdisc_root_sleeping_lock(sch), |
1431 | tca[TCA_RATE]); | 1431 | tca[TCA_RATE]); |
1432 | sch_tree_lock(sch); | 1432 | sch_tree_lock(sch); |
1433 | } | 1433 | } |
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index fb0294d0b55e..3781e55046d0 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c | |||
@@ -341,7 +341,7 @@ static int get_dist_table(struct Qdisc *sch, const struct nlattr *attr) | |||
341 | for (i = 0; i < n; i++) | 341 | for (i = 0; i < n; i++) |
342 | d->table[i] = data[i]; | 342 | d->table[i] = data[i]; |
343 | 343 | ||
344 | root_lock = qdisc_root_lock(sch); | 344 | root_lock = qdisc_root_sleeping_lock(sch); |
345 | 345 | ||
346 | spin_lock_bh(root_lock); | 346 | spin_lock_bh(root_lock); |
347 | d = xchg(&q->delay_dist, d); | 347 | d = xchg(&q->delay_dist, d); |
diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c index 2c35c678563b..d35ef059abb1 100644 --- a/net/sched/sch_teql.c +++ b/net/sched/sch_teql.c | |||
@@ -161,7 +161,7 @@ teql_destroy(struct Qdisc* sch) | |||
161 | txq = netdev_get_tx_queue(master->dev, 0); | 161 | txq = netdev_get_tx_queue(master->dev, 0); |
162 | master->slaves = NULL; | 162 | master->slaves = NULL; |
163 | 163 | ||
164 | root_lock = qdisc_root_lock(txq->qdisc); | 164 | root_lock = qdisc_root_sleeping_lock(txq->qdisc); |
165 | spin_lock_bh(root_lock); | 165 | spin_lock_bh(root_lock); |
166 | qdisc_reset(txq->qdisc); | 166 | qdisc_reset(txq->qdisc); |
167 | spin_unlock_bh(root_lock); | 167 | spin_unlock_bh(root_lock); |
diff --git a/net/sctp/auth.c b/net/sctp/auth.c index 1fcb4cf2f4c9..52db5f60daa0 100644 --- a/net/sctp/auth.c +++ b/net/sctp/auth.c | |||
@@ -786,6 +786,9 @@ int sctp_auth_ep_set_hmacs(struct sctp_endpoint *ep, | |||
786 | for (i = 0; i < hmacs->shmac_num_idents; i++) { | 786 | for (i = 0; i < hmacs->shmac_num_idents; i++) { |
787 | id = hmacs->shmac_idents[i]; | 787 | id = hmacs->shmac_idents[i]; |
788 | 788 | ||
789 | if (id > SCTP_AUTH_HMAC_ID_MAX) | ||
790 | return -EOPNOTSUPP; | ||
791 | |||
789 | if (SCTP_AUTH_HMAC_ID_SHA1 == id) | 792 | if (SCTP_AUTH_HMAC_ID_SHA1 == id) |
790 | has_sha1 = 1; | 793 | has_sha1 = 1; |
791 | 794 | ||
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index afa952e726d7..5ffb9dec1c3f 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -3086,6 +3086,7 @@ static int sctp_setsockopt_hmac_ident(struct sock *sk, | |||
3086 | int optlen) | 3086 | int optlen) |
3087 | { | 3087 | { |
3088 | struct sctp_hmacalgo *hmacs; | 3088 | struct sctp_hmacalgo *hmacs; |
3089 | u32 idents; | ||
3089 | int err; | 3090 | int err; |
3090 | 3091 | ||
3091 | if (!sctp_auth_enable) | 3092 | if (!sctp_auth_enable) |
@@ -3103,8 +3104,9 @@ static int sctp_setsockopt_hmac_ident(struct sock *sk, | |||
3103 | goto out; | 3104 | goto out; |
3104 | } | 3105 | } |
3105 | 3106 | ||
3106 | if (hmacs->shmac_num_idents == 0 || | 3107 | idents = hmacs->shmac_num_idents; |
3107 | hmacs->shmac_num_idents > SCTP_AUTH_NUM_HMACS) { | 3108 | if (idents == 0 || idents > SCTP_AUTH_NUM_HMACS || |
3109 | (idents * sizeof(u16)) > (optlen - sizeof(struct sctp_hmacalgo))) { | ||
3108 | err = -EINVAL; | 3110 | err = -EINVAL; |
3109 | goto out; | 3111 | goto out; |
3110 | } | 3112 | } |
@@ -3144,7 +3146,7 @@ static int sctp_setsockopt_auth_key(struct sock *sk, | |||
3144 | goto out; | 3146 | goto out; |
3145 | } | 3147 | } |
3146 | 3148 | ||
3147 | if (authkey->sca_keylength > optlen) { | 3149 | if (authkey->sca_keylength > optlen - sizeof(struct sctp_authkey)) { |
3148 | ret = -EINVAL; | 3150 | ret = -EINVAL; |
3149 | goto out; | 3151 | goto out; |
3150 | } | 3152 | } |
diff --git a/net/sunrpc/sysctl.c b/net/sunrpc/sysctl.c index 0f8c439b848a..5231f7aaac0e 100644 --- a/net/sunrpc/sysctl.c +++ b/net/sunrpc/sysctl.c | |||
@@ -60,24 +60,14 @@ static int proc_do_xprt(ctl_table *table, int write, struct file *file, | |||
60 | void __user *buffer, size_t *lenp, loff_t *ppos) | 60 | void __user *buffer, size_t *lenp, loff_t *ppos) |
61 | { | 61 | { |
62 | char tmpbuf[256]; | 62 | char tmpbuf[256]; |
63 | int len; | 63 | size_t len; |
64 | |||
64 | if ((*ppos && !write) || !*lenp) { | 65 | if ((*ppos && !write) || !*lenp) { |
65 | *lenp = 0; | 66 | *lenp = 0; |
66 | return 0; | 67 | return 0; |
67 | } | 68 | } |
68 | if (write) | 69 | len = svc_print_xprts(tmpbuf, sizeof(tmpbuf)); |
69 | return -EINVAL; | 70 | return simple_read_from_buffer(buffer, *lenp, ppos, tmpbuf, len); |
70 | else { | ||
71 | len = svc_print_xprts(tmpbuf, sizeof(tmpbuf)); | ||
72 | if (!access_ok(VERIFY_WRITE, buffer, len)) | ||
73 | return -EFAULT; | ||
74 | |||
75 | if (__copy_to_user(buffer, tmpbuf, len)) | ||
76 | return -EFAULT; | ||
77 | } | ||
78 | *lenp -= len; | ||
79 | *ppos += len; | ||
80 | return 0; | ||
81 | } | 71 | } |
82 | 72 | ||
83 | static int | 73 | static int |
diff --git a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c index b4b17f44cb29..74de31a06616 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +++ b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c | |||
@@ -443,18 +443,18 @@ int svc_rdma_recvfrom(struct svc_rqst *rqstp) | |||
443 | 443 | ||
444 | dprintk("svcrdma: rqstp=%p\n", rqstp); | 444 | dprintk("svcrdma: rqstp=%p\n", rqstp); |
445 | 445 | ||
446 | spin_lock_bh(&rdma_xprt->sc_read_complete_lock); | 446 | spin_lock_bh(&rdma_xprt->sc_rq_dto_lock); |
447 | if (!list_empty(&rdma_xprt->sc_read_complete_q)) { | 447 | if (!list_empty(&rdma_xprt->sc_read_complete_q)) { |
448 | ctxt = list_entry(rdma_xprt->sc_read_complete_q.next, | 448 | ctxt = list_entry(rdma_xprt->sc_read_complete_q.next, |
449 | struct svc_rdma_op_ctxt, | 449 | struct svc_rdma_op_ctxt, |
450 | dto_q); | 450 | dto_q); |
451 | list_del_init(&ctxt->dto_q); | 451 | list_del_init(&ctxt->dto_q); |
452 | } | 452 | } |
453 | spin_unlock_bh(&rdma_xprt->sc_read_complete_lock); | 453 | if (ctxt) { |
454 | if (ctxt) | 454 | spin_unlock_bh(&rdma_xprt->sc_rq_dto_lock); |
455 | return rdma_read_complete(rqstp, ctxt); | 455 | return rdma_read_complete(rqstp, ctxt); |
456 | } | ||
456 | 457 | ||
457 | spin_lock_bh(&rdma_xprt->sc_rq_dto_lock); | ||
458 | if (!list_empty(&rdma_xprt->sc_rq_dto_q)) { | 458 | if (!list_empty(&rdma_xprt->sc_rq_dto_q)) { |
459 | ctxt = list_entry(rdma_xprt->sc_rq_dto_q.next, | 459 | ctxt = list_entry(rdma_xprt->sc_rq_dto_q.next, |
460 | struct svc_rdma_op_ctxt, | 460 | struct svc_rdma_op_ctxt, |
diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c index 19ddc382b777..900cb69728c6 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c | |||
@@ -359,11 +359,11 @@ static void sq_cq_reap(struct svcxprt_rdma *xprt) | |||
359 | if (test_bit(RDMACTXT_F_LAST_CTXT, &ctxt->flags)) { | 359 | if (test_bit(RDMACTXT_F_LAST_CTXT, &ctxt->flags)) { |
360 | struct svc_rdma_op_ctxt *read_hdr = ctxt->read_hdr; | 360 | struct svc_rdma_op_ctxt *read_hdr = ctxt->read_hdr; |
361 | BUG_ON(!read_hdr); | 361 | BUG_ON(!read_hdr); |
362 | spin_lock_bh(&xprt->sc_rq_dto_lock); | ||
362 | set_bit(XPT_DATA, &xprt->sc_xprt.xpt_flags); | 363 | set_bit(XPT_DATA, &xprt->sc_xprt.xpt_flags); |
363 | spin_lock_bh(&xprt->sc_read_complete_lock); | ||
364 | list_add_tail(&read_hdr->dto_q, | 364 | list_add_tail(&read_hdr->dto_q, |
365 | &xprt->sc_read_complete_q); | 365 | &xprt->sc_read_complete_q); |
366 | spin_unlock_bh(&xprt->sc_read_complete_lock); | 366 | spin_unlock_bh(&xprt->sc_rq_dto_lock); |
367 | svc_xprt_enqueue(&xprt->sc_xprt); | 367 | svc_xprt_enqueue(&xprt->sc_xprt); |
368 | } | 368 | } |
369 | svc_rdma_put_context(ctxt, 0); | 369 | svc_rdma_put_context(ctxt, 0); |
@@ -428,7 +428,6 @@ static struct svcxprt_rdma *rdma_create_xprt(struct svc_serv *serv, | |||
428 | init_waitqueue_head(&cma_xprt->sc_send_wait); | 428 | init_waitqueue_head(&cma_xprt->sc_send_wait); |
429 | 429 | ||
430 | spin_lock_init(&cma_xprt->sc_lock); | 430 | spin_lock_init(&cma_xprt->sc_lock); |
431 | spin_lock_init(&cma_xprt->sc_read_complete_lock); | ||
432 | spin_lock_init(&cma_xprt->sc_rq_dto_lock); | 431 | spin_lock_init(&cma_xprt->sc_rq_dto_lock); |
433 | 432 | ||
434 | cma_xprt->sc_ord = svcrdma_ord; | 433 | cma_xprt->sc_ord = svcrdma_ord; |
diff --git a/net/wireless/Kconfig b/net/wireless/Kconfig index ab015c62d561..833b024f8f66 100644 --- a/net/wireless/Kconfig +++ b/net/wireless/Kconfig | |||
@@ -39,4 +39,5 @@ config WIRELESS_EXT_SYSFS | |||
39 | files in /sys/class/net/*/wireless/. The same information | 39 | files in /sys/class/net/*/wireless/. The same information |
40 | is available via the ioctls as well. | 40 | is available via the ioctls as well. |
41 | 41 | ||
42 | Say Y if you have programs using it (we don't know of any). | 42 | Say Y if you have programs using it, like old versions of |
43 | hal. | ||
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 841b32a2e680..46914b79d850 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -1731,8 +1731,7 @@ restart: | |||
1731 | * We can't enlist stable bundles either. | 1731 | * We can't enlist stable bundles either. |
1732 | */ | 1732 | */ |
1733 | write_unlock_bh(&policy->lock); | 1733 | write_unlock_bh(&policy->lock); |
1734 | if (dst) | 1734 | dst_free(dst); |
1735 | dst_free(dst); | ||
1736 | 1735 | ||
1737 | if (pol_dead) | 1736 | if (pol_dead) |
1738 | XFRM_INC_STATS(LINUX_MIB_XFRMOUTPOLDEAD); | 1737 | XFRM_INC_STATS(LINUX_MIB_XFRMOUTPOLDEAD); |
@@ -1748,8 +1747,7 @@ restart: | |||
1748 | err = xfrm_dst_update_origin(dst, fl); | 1747 | err = xfrm_dst_update_origin(dst, fl); |
1749 | if (unlikely(err)) { | 1748 | if (unlikely(err)) { |
1750 | write_unlock_bh(&policy->lock); | 1749 | write_unlock_bh(&policy->lock); |
1751 | if (dst) | 1750 | dst_free(dst); |
1752 | dst_free(dst); | ||
1753 | XFRM_INC_STATS(LINUX_MIB_XFRMOUTBUNDLECHECKERROR); | 1751 | XFRM_INC_STATS(LINUX_MIB_XFRMOUTBUNDLECHECKERROR); |
1754 | goto error; | 1752 | goto error; |
1755 | } | 1753 | } |
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 4c6914ef7d92..7bd62f61593f 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
@@ -780,11 +780,13 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, | |||
780 | { | 780 | { |
781 | unsigned int h; | 781 | unsigned int h; |
782 | struct hlist_node *entry; | 782 | struct hlist_node *entry; |
783 | struct xfrm_state *x, *x0; | 783 | struct xfrm_state *x, *x0, *to_put; |
784 | int acquire_in_progress = 0; | 784 | int acquire_in_progress = 0; |
785 | int error = 0; | 785 | int error = 0; |
786 | struct xfrm_state *best = NULL; | 786 | struct xfrm_state *best = NULL; |
787 | 787 | ||
788 | to_put = NULL; | ||
789 | |||
788 | spin_lock_bh(&xfrm_state_lock); | 790 | spin_lock_bh(&xfrm_state_lock); |
789 | h = xfrm_dst_hash(daddr, saddr, tmpl->reqid, family); | 791 | h = xfrm_dst_hash(daddr, saddr, tmpl->reqid, family); |
790 | hlist_for_each_entry(x, entry, xfrm_state_bydst+h, bydst) { | 792 | hlist_for_each_entry(x, entry, xfrm_state_bydst+h, bydst) { |
@@ -833,7 +835,7 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, | |||
833 | if (tmpl->id.spi && | 835 | if (tmpl->id.spi && |
834 | (x0 = __xfrm_state_lookup(daddr, tmpl->id.spi, | 836 | (x0 = __xfrm_state_lookup(daddr, tmpl->id.spi, |
835 | tmpl->id.proto, family)) != NULL) { | 837 | tmpl->id.proto, family)) != NULL) { |
836 | xfrm_state_put(x0); | 838 | to_put = x0; |
837 | error = -EEXIST; | 839 | error = -EEXIST; |
838 | goto out; | 840 | goto out; |
839 | } | 841 | } |
@@ -849,7 +851,7 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, | |||
849 | error = security_xfrm_state_alloc_acquire(x, pol->security, fl->secid); | 851 | error = security_xfrm_state_alloc_acquire(x, pol->security, fl->secid); |
850 | if (error) { | 852 | if (error) { |
851 | x->km.state = XFRM_STATE_DEAD; | 853 | x->km.state = XFRM_STATE_DEAD; |
852 | xfrm_state_put(x); | 854 | to_put = x; |
853 | x = NULL; | 855 | x = NULL; |
854 | goto out; | 856 | goto out; |
855 | } | 857 | } |
@@ -870,7 +872,7 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, | |||
870 | xfrm_hash_grow_check(x->bydst.next != NULL); | 872 | xfrm_hash_grow_check(x->bydst.next != NULL); |
871 | } else { | 873 | } else { |
872 | x->km.state = XFRM_STATE_DEAD; | 874 | x->km.state = XFRM_STATE_DEAD; |
873 | xfrm_state_put(x); | 875 | to_put = x; |
874 | x = NULL; | 876 | x = NULL; |
875 | error = -ESRCH; | 877 | error = -ESRCH; |
876 | } | 878 | } |
@@ -881,6 +883,8 @@ out: | |||
881 | else | 883 | else |
882 | *err = acquire_in_progress ? -EAGAIN : error; | 884 | *err = acquire_in_progress ? -EAGAIN : error; |
883 | spin_unlock_bh(&xfrm_state_lock); | 885 | spin_unlock_bh(&xfrm_state_lock); |
886 | if (to_put) | ||
887 | xfrm_state_put(to_put); | ||
884 | return x; | 888 | return x; |
885 | } | 889 | } |
886 | 890 | ||
@@ -1067,18 +1071,20 @@ static struct xfrm_state *__xfrm_find_acq_byseq(u32 seq); | |||
1067 | 1071 | ||
1068 | int xfrm_state_add(struct xfrm_state *x) | 1072 | int xfrm_state_add(struct xfrm_state *x) |
1069 | { | 1073 | { |
1070 | struct xfrm_state *x1; | 1074 | struct xfrm_state *x1, *to_put; |
1071 | int family; | 1075 | int family; |
1072 | int err; | 1076 | int err; |
1073 | int use_spi = xfrm_id_proto_match(x->id.proto, IPSEC_PROTO_ANY); | 1077 | int use_spi = xfrm_id_proto_match(x->id.proto, IPSEC_PROTO_ANY); |
1074 | 1078 | ||
1075 | family = x->props.family; | 1079 | family = x->props.family; |
1076 | 1080 | ||
1081 | to_put = NULL; | ||
1082 | |||
1077 | spin_lock_bh(&xfrm_state_lock); | 1083 | spin_lock_bh(&xfrm_state_lock); |
1078 | 1084 | ||
1079 | x1 = __xfrm_state_locate(x, use_spi, family); | 1085 | x1 = __xfrm_state_locate(x, use_spi, family); |
1080 | if (x1) { | 1086 | if (x1) { |
1081 | xfrm_state_put(x1); | 1087 | to_put = x1; |
1082 | x1 = NULL; | 1088 | x1 = NULL; |
1083 | err = -EEXIST; | 1089 | err = -EEXIST; |
1084 | goto out; | 1090 | goto out; |
@@ -1088,7 +1094,7 @@ int xfrm_state_add(struct xfrm_state *x) | |||
1088 | x1 = __xfrm_find_acq_byseq(x->km.seq); | 1094 | x1 = __xfrm_find_acq_byseq(x->km.seq); |
1089 | if (x1 && ((x1->id.proto != x->id.proto) || | 1095 | if (x1 && ((x1->id.proto != x->id.proto) || |
1090 | xfrm_addr_cmp(&x1->id.daddr, &x->id.daddr, family))) { | 1096 | xfrm_addr_cmp(&x1->id.daddr, &x->id.daddr, family))) { |
1091 | xfrm_state_put(x1); | 1097 | to_put = x1; |
1092 | x1 = NULL; | 1098 | x1 = NULL; |
1093 | } | 1099 | } |
1094 | } | 1100 | } |
@@ -1110,6 +1116,9 @@ out: | |||
1110 | xfrm_state_put(x1); | 1116 | xfrm_state_put(x1); |
1111 | } | 1117 | } |
1112 | 1118 | ||
1119 | if (to_put) | ||
1120 | xfrm_state_put(to_put); | ||
1121 | |||
1113 | return err; | 1122 | return err; |
1114 | } | 1123 | } |
1115 | EXPORT_SYMBOL(xfrm_state_add); | 1124 | EXPORT_SYMBOL(xfrm_state_add); |
@@ -1269,10 +1278,12 @@ EXPORT_SYMBOL(xfrm_state_migrate); | |||
1269 | 1278 | ||
1270 | int xfrm_state_update(struct xfrm_state *x) | 1279 | int xfrm_state_update(struct xfrm_state *x) |
1271 | { | 1280 | { |
1272 | struct xfrm_state *x1; | 1281 | struct xfrm_state *x1, *to_put; |
1273 | int err; | 1282 | int err; |
1274 | int use_spi = xfrm_id_proto_match(x->id.proto, IPSEC_PROTO_ANY); | 1283 | int use_spi = xfrm_id_proto_match(x->id.proto, IPSEC_PROTO_ANY); |
1275 | 1284 | ||
1285 | to_put = NULL; | ||
1286 | |||
1276 | spin_lock_bh(&xfrm_state_lock); | 1287 | spin_lock_bh(&xfrm_state_lock); |
1277 | x1 = __xfrm_state_locate(x, use_spi, x->props.family); | 1288 | x1 = __xfrm_state_locate(x, use_spi, x->props.family); |
1278 | 1289 | ||
@@ -1281,7 +1292,7 @@ int xfrm_state_update(struct xfrm_state *x) | |||
1281 | goto out; | 1292 | goto out; |
1282 | 1293 | ||
1283 | if (xfrm_state_kern(x1)) { | 1294 | if (xfrm_state_kern(x1)) { |
1284 | xfrm_state_put(x1); | 1295 | to_put = x1; |
1285 | err = -EEXIST; | 1296 | err = -EEXIST; |
1286 | goto out; | 1297 | goto out; |
1287 | } | 1298 | } |
@@ -1295,6 +1306,9 @@ int xfrm_state_update(struct xfrm_state *x) | |||
1295 | out: | 1306 | out: |
1296 | spin_unlock_bh(&xfrm_state_lock); | 1307 | spin_unlock_bh(&xfrm_state_lock); |
1297 | 1308 | ||
1309 | if (to_put) | ||
1310 | xfrm_state_put(to_put); | ||
1311 | |||
1298 | if (err) | 1312 | if (err) |
1299 | return err; | 1313 | return err; |
1300 | 1314 | ||