aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-11-15 19:34:00 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-11-15 19:34:00 -0500
commitadea27f4ba29200c989194a3f6214b652d009e83 (patch)
treea4699ba7557e731570d724e09bf6e05d3e83570c /net
parent40787d0099676c9923e31fbdb90422d5c97cdcd5 (diff)
parent7799652557d966e49512479f4d3b9079bbc01fff (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: [NETFILTER]: Fix NULL pointer dereference in nf_nat_move_storage() [SUNHME]: VLAN support for sunhme [CHELSIO]: Fix skb->dev setting. [NETFILTER]: fix compat_nf_sockopt typo [INET]: Fix potential kfree on vmalloc-ed area of request_sock_queue [VIA_VELOCITY]: Don't oops on MTU change. iwl4965: fix not correctly dealing with hotunplug rt2x00: Fix chipset revision validation iwl3945: place CCK rates in front of OFDM for supported rates mac80211: Fix queuing of scan containing a SSID
Diffstat (limited to 'net')
-rw-r--r--net/core/request_sock.c35
-rw-r--r--net/mac80211/ieee80211_i.h2
-rw-r--r--net/mac80211/ieee80211_sta.c8
-rw-r--r--net/netfilter/nf_conntrack_extend.c2
-rw-r--r--net/netfilter/nf_sockopt.c6
5 files changed, 48 insertions, 5 deletions
diff --git a/net/core/request_sock.c b/net/core/request_sock.c
index 5f0818d815e6..45aed75cb571 100644
--- a/net/core/request_sock.c
+++ b/net/core/request_sock.c
@@ -71,6 +71,41 @@ int reqsk_queue_alloc(struct request_sock_queue *queue,
71 71
72EXPORT_SYMBOL(reqsk_queue_alloc); 72EXPORT_SYMBOL(reqsk_queue_alloc);
73 73
74void __reqsk_queue_destroy(struct request_sock_queue *queue)
75{
76 struct listen_sock *lopt;
77 size_t lopt_size;
78
79 /*
80 * this is an error recovery path only
81 * no locking needed and the lopt is not NULL
82 */
83
84 lopt = queue->listen_opt;
85 lopt_size = sizeof(struct listen_sock) +
86 lopt->nr_table_entries * sizeof(struct request_sock *);
87
88 if (lopt_size > PAGE_SIZE)
89 vfree(lopt);
90 else
91 kfree(lopt);
92}
93
94EXPORT_SYMBOL(__reqsk_queue_destroy);
95
96static inline struct listen_sock *reqsk_queue_yank_listen_sk(
97 struct request_sock_queue *queue)
98{
99 struct listen_sock *lopt;
100
101 write_lock_bh(&queue->syn_wait_lock);
102 lopt = queue->listen_opt;
103 queue->listen_opt = NULL;
104 write_unlock_bh(&queue->syn_wait_lock);
105
106 return lopt;
107}
108
74void reqsk_queue_destroy(struct request_sock_queue *queue) 109void reqsk_queue_destroy(struct request_sock_queue *queue)
75{ 110{
76 /* make all the listen_opt local to us */ 111 /* make all the listen_opt local to us */
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index b4e32ab3664d..72e1c93dd87e 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -242,6 +242,8 @@ struct ieee80211_if_sta {
242 u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN]; 242 u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN];
243 u8 ssid[IEEE80211_MAX_SSID_LEN]; 243 u8 ssid[IEEE80211_MAX_SSID_LEN];
244 size_t ssid_len; 244 size_t ssid_len;
245 u8 scan_ssid[IEEE80211_MAX_SSID_LEN];
246 size_t scan_ssid_len;
245 u16 aid; 247 u16 aid;
246 u16 ap_capab, capab; 248 u16 ap_capab, capab;
247 u8 *extra_ie; /* to be added to the end of AssocReq */ 249 u8 *extra_ie; /* to be added to the end of AssocReq */
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index 2079e988fc56..015b3f879aa9 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -2002,7 +2002,10 @@ void ieee80211_sta_work(struct work_struct *work)
2002 if (ifsta->state != IEEE80211_AUTHENTICATE && 2002 if (ifsta->state != IEEE80211_AUTHENTICATE &&
2003 ifsta->state != IEEE80211_ASSOCIATE && 2003 ifsta->state != IEEE80211_ASSOCIATE &&
2004 test_and_clear_bit(IEEE80211_STA_REQ_SCAN, &ifsta->request)) { 2004 test_and_clear_bit(IEEE80211_STA_REQ_SCAN, &ifsta->request)) {
2005 ieee80211_sta_start_scan(dev, NULL, 0); 2005 if (ifsta->scan_ssid_len)
2006 ieee80211_sta_start_scan(dev, ifsta->scan_ssid, ifsta->scan_ssid_len);
2007 else
2008 ieee80211_sta_start_scan(dev, NULL, 0);
2006 return; 2009 return;
2007 } 2010 }
2008 2011
@@ -2872,6 +2875,9 @@ int ieee80211_sta_req_scan(struct net_device *dev, u8 *ssid, size_t ssid_len)
2872 return -EBUSY; 2875 return -EBUSY;
2873 } 2876 }
2874 2877
2878 ifsta->scan_ssid_len = ssid_len;
2879 if (ssid_len)
2880 memcpy(ifsta->scan_ssid, ssid, ssid_len);
2875 set_bit(IEEE80211_STA_REQ_SCAN, &ifsta->request); 2881 set_bit(IEEE80211_STA_REQ_SCAN, &ifsta->request);
2876 queue_work(local->hw.workqueue, &ifsta->work); 2882 queue_work(local->hw.workqueue, &ifsta->work);
2877 return 0; 2883 return 0;
diff --git a/net/netfilter/nf_conntrack_extend.c b/net/netfilter/nf_conntrack_extend.c
index a1a65a1313b3..cf6ba6659a80 100644
--- a/net/netfilter/nf_conntrack_extend.c
+++ b/net/netfilter/nf_conntrack_extend.c
@@ -109,7 +109,7 @@ void *__nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp)
109 rcu_read_lock(); 109 rcu_read_lock();
110 t = rcu_dereference(nf_ct_ext_types[i]); 110 t = rcu_dereference(nf_ct_ext_types[i]);
111 if (t && t->move) 111 if (t && t->move)
112 t->move(ct, ct->ext + ct->ext->offset[id]); 112 t->move(ct, ct->ext + ct->ext->offset[i]);
113 rcu_read_unlock(); 113 rcu_read_unlock();
114 } 114 }
115 kfree(ct->ext); 115 kfree(ct->ext);
diff --git a/net/netfilter/nf_sockopt.c b/net/netfilter/nf_sockopt.c
index 87bc1443c520..3dd4b3c76d81 100644
--- a/net/netfilter/nf_sockopt.c
+++ b/net/netfilter/nf_sockopt.c
@@ -143,12 +143,12 @@ static int compat_nf_sockopt(struct sock *sk, int pf, int val,
143 if (ops->compat_get) 143 if (ops->compat_get)
144 ret = ops->compat_get(sk, val, opt, len); 144 ret = ops->compat_get(sk, val, opt, len);
145 else 145 else
146 ret = ops->get(sk, val, ops, len); 146 ret = ops->get(sk, val, opt, len);
147 } else { 147 } else {
148 if (ops->compat_set) 148 if (ops->compat_set)
149 ret = ops->compat_set(sk, val, ops, *len); 149 ret = ops->compat_set(sk, val, opt, *len);
150 else 150 else
151 ret = ops->set(sk, val, ops, *len); 151 ret = ops->set(sk, val, opt, *len);
152 } 152 }
153 153
154 module_put(ops->owner); 154 module_put(ops->owner);