aboutsummaryrefslogtreecommitdiff
path: root/net
AgeCommit message (Collapse)AuthorFilesLines
2014-11-21Merge tag 'master-2014-11-20' of ↵David S. Miller1-9/+6
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless John W. Linville says: ==================== pull request: wireless 2014-11-20 Please full this little batch of fixes intended for the 3.18 stream! For the mac80211 patch, Johannes says: "Here's another last minute fix, for minstrel HT crashing depending on the value of some uninitialised stack." On top of that... Ben Greear fixes an ath9k regression in which a BSSID mask is miscalculated. Dmitry Torokhov corrects an error handling routing in brcmfmac which was checking an unsigned variable for a negative value. Johannes Berg avoids a build problem in brcmfmac for arches where linux/unaligned/access_ok.h and asm/unaligned.h conflict. Mathy Vanhoef addresses another brcmfmac issue so as to eliminate a use-after-free of the URB transfer buffer if a timeout occurs. Please let me know if there are problems! ==================== Signed-off-by: David S. Miller <[email protected]>
2014-11-20ipx: fix locking regression in ipx_sendmsg and ipx_recvmsgJiri Bohac1-1/+5
This fixes an old regression introduced by commit b0d0d915 (ipx: remove the BKL). When a recvmsg syscall blocks waiting for new data, no data can be sent on the same socket with sendmsg because ipx_recvmsg() sleeps with the socket locked. This breaks mars-nwe (NetWare emulator): - the ncpserv process reads the request using recvmsg - ncpserv forks and spawns nwconn - ncpserv calls a (blocking) recvmsg and waits for new requests - nwconn deadlocks in sendmsg on the same socket Commit b0d0d915 has simply replaced BKL locking with lock_sock/release_sock. Unlike now, BKL got unlocked while sleeping, so a blocking recvmsg did not block a concurrent sendmsg. Only keep the socket locked while actually working with the socket data and release it prior to calling skb_recv_datagram(). Signed-off-by: Jiri Bohac <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2014-11-20openvswitch: Don't validate IPv6 label masks.Joe Stringer1-1/+1
When userspace doesn't provide a mask, OVS datapath generates a fully unwildcarded mask for the flow by copying the flow and setting all bits in all fields. For IPv6 label, this creates a mask that matches on the upper 12 bits, causing the following error: openvswitch: netlink: Invalid IPv6 flow label value (value=ffffffff, max=fffff) This patch ignores the label validation check for masks, avoiding this error. Signed-off-by: Joe Stringer <[email protected]> Acked-by: Pravin B Shelar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2014-11-20Merge tag 'mac80211-next-for-john-2014-11-20' of ↵John W. Linville27-303/+2266
git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next Johannes Berg <[email protected]> says: "It has been a while since my last pull request, so we accumulated another relatively large set of changes: * TDLS off-channel support set from Arik/Liad, with some support patches I did * custom regulatory fixes from Arik * minstrel VHT fix (and a small optimisation) from Felix * add back radiotap vendor namespace support (myself) * random MAC address scanning for cfg80211/mac80211/hwsim (myself) * CSA improvements (Luca) * WoWLAN Net Detect (wake on network found) support (Luca) * and lots of other smaller changes from many people" Signed-off-by: John W. Linville <[email protected]>
2014-11-20netfilter: nfnetlink_log: Make use of pr_fmt where applicableMarcelo Leitner1-3/+6
Signed-off-by: Marcelo Ricardo Leitner <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
2014-11-20netfilter: Deletion of unnecessary checks before two function callsMarkus Elfring5-10/+5
The functions free_percpu() and module_put() test whether their argument is NULL and then return immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <[email protected]> Acked-by: Julian Anastasov <[email protected]> Acked-by: Simon Horman <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
2014-11-20vti6: Add a lookup method for tunnels with wildcard endpoints.Steffen Klassert1-0/+17
Currently we can't lookup tunnels with wildcard endpoints. This patch adds a method to lookup these tunnels in the receive path. Signed-off-by: Steffen Klassert <[email protected]>
2014-11-19ipv6: delete protocol and unregister rtnetlink when cleanupDuan Jiong1-0/+4
pim6_protocol was added when initiation, but it not deleted. Similarly, unregister RTNL_FAMILY_IP6MR rtnetlink. Signed-off-by: Duan Jiong <[email protected]> Reviewed-by: Cong Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2014-11-19fold verify_iovec() into copy_msghdr_from_user()Al Viro3-108/+75
... and do the same on the compat side of things. Signed-off-by: Al Viro <[email protected]>
2014-11-19{compat_,}verify_iovec(): switch to generic copying of iovecsAl Viro3-89/+37
use {compat_,}rw_copy_check_uvector(). As the result, we are guaranteed that all iovecs seen in ->msg_iov by ->sendmsg() and ->recvmsg() will pass access_ok(). Signed-off-by: Al Viro <[email protected]>
2014-11-19separate kernel- and userland-side msghdrAl Viro2-15/+18
Kernel-side struct msghdr is (currently) using the same layout as userland one, but it's not a one-to-one copy - even without considering 32bit compat issues, we have msg_iov, msg_name and msg_control copied to kernel[1]. It's fairly localized, so we get away with a few functions where that knowledge is needed (and we could shrink that set even more). Pretty much everything deals with the kernel-side variant and the few places that want userland one just use a bunch of force-casts to paper over the differences. The thing is, kernel-side definition of struct msghdr is *not* exposed in include/uapi - libc doesn't see it, etc. So we can add struct user_msghdr, with proper annotations and let the few places that ever deal with those beasts use it for userland pointers. Saner typechecking aside, that will allow to change the layout of kernel-side msghdr - e.g. replace msg_iov/msg_iovlen there with struct iov_iter, getting rid of the need to modify the iovec as we copy data to/from it, etc. We could introduce kernel_msghdr instead, but that would create much more noise - the absolute majority of the instances would need to have the type switched to kernel_msghdr and definition of struct msghdr in include/linux/socket.h is not going to be seen by userland anyway. This commit just introduces user_msghdr and switches the few places that are dealing with userland-side msghdr to it. [1] actually, it's even trickier than that - we copy msg_control for sendmsg, but keep the userland address on recvmsg. Signed-off-by: Al Viro <[email protected]>
2014-11-19Merge tag 'mac80211-for-john-2014-11-18' of ↵John W. Linville1-9/+6
git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211 Johannes Berg <[email protected]> says: "Here's another last minute fix, for minstrel HT crashing depending on the value of some uninitialised stack." Signed-off-by: John W. Linville <[email protected]>
2014-11-19Merge commit '4e6ce4dc7ce71d0886908d55129d5d6482a27ff9' of ↵John W. Linville8-31/+34
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
2014-11-19netlink: Deletion of an unnecessary check before the function call ↵Markus Elfring1-2/+1
"__module_get" The __module_get() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2014-11-19net: pktgen: Deletion of an unnecessary check before the function call ↵Markus Elfring1-2/+1
"proc_remove" The proc_remove() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2014-11-19tcp: make connect() mem charging friendlyEric Dumazet1-40/+28
While working on sk_forward_alloc problems reported by Denys Fedoryshchenko, we found that tcp connect() (and fastopen) do not call sk_wmem_schedule() for SYN packet (and/or SYN/DATA packet), so sk_forward_alloc is negative while connect is in progress. We can fix this by calling regular sk_stream_alloc_skb() both for the SYN packet (in tcp_connect()) and the syn_data packet in tcp_send_syn_data() Then, tcp_send_syn_data() can avoid copying syn_data as we simply can manipulate syn_data->cb[] to remove SYN flag (and increment seq) Instead of open coding memcpy_fromiovecend(), simply use this helper. This leaves in socket write queue clean fast clone skbs. This was tested against our fastopen packetdrill tests. Reported-by: Denys Fedoryshchenko <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Acked-by: Yuchung Cheng <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2014-11-19mac80211: minstrel_ht: add a small optimization to minstrel_aggr_checkFelix Fietkau1-3/+3
Check the queue mapping earlier, skb->queue_mapping is more likely than skb->data to still be in d-cache. Signed-off-by: Felix Fietkau <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2014-11-19mac80211: notify drivers on sta rate table changesJohannes Berg3-0/+25
This allows drivers with a firmware or chip-based rate lookup table to use the most recent default rate selection without having to get it from per-packet data or explicit ieee80211_get_tx_rate calls Signed-off-by: Felix Fietkau <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2014-11-19nl80211: Broadcast CMD_NEW_INTERFACE and CMD_DEL_INTERFACETomasz Bursztyka1-7/+41
Let the other listeners being notified when a new or del interface command has been issued, thus reducing later necessary request to be in sync with current context. Signed-off-by: Tomasz Bursztyka <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2014-11-19nl80211: Replace interface socket owner attribute with more generic oneJukka Rissanen1-2/+2
Replace NL80211_ATTR_IFACE_SOCKET_OWNER attribute with more generic NL80211_ATTR_SOCKET_OWNER that can be used with other commands that interface creation. Signed-off-by: Jukka Rissanen <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2014-11-19cfg80211: protect fools returning NULL in add_virtual_intfRafał Miłecki1-1/+4
Callback add_virtual_intf is supposed to return ERR_PTR and trying to return NULL results in some "Unable to handle kernel paging request", etc. As it may be complicated to debug & trace, let's catch it (WARN). Signed-off-by: Rafał Miłecki <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2014-11-19cfg80211: explicitly initialize some fields in custom reg pathArik Nemtsov1-0/+3
Explicitly initialize the DFS state and beacon found state when handling channels in the custom regulatory path. Signed-off-by: Arik Nemtsov <[email protected]> Acked-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2014-11-19cfg80211: update missing fields in custom regulatory pathArik Nemtsov1-0/+10
Some channels fields were not being updated in the custom regulatory path. Update them according to the code in handle_channel(). Signed-off-by: Jonathan Doron <[email protected]> Signed-off-by: Arik Nemtsov <[email protected]> Acked-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2014-11-19mac80211: skip legacy rate mask handling for VHT ratesFelix Fietkau1-1/+1
The rate mask code currently assumes that a rate is legacy if IEEE80211_TX_RC_MCS is not set. This might be the cause of bogus VHT rates being reported with minstrel_ht. Signed-off-by: Felix Fietkau <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2014-11-19mac80211: don't allow 40MHz tx rates in case of 20MHz chandefEliad Peller1-0/+2
When 20MHz chandef is used, 40MHz rates shouldn't be used (by the rate-control algorithm), even if the sta ht capabilities indicate support for it. Signed-off-by: Eliad Peller <[email protected]> Singed-off-by: Emmanuel Grumbach <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2014-11-19mac80211: allow drivers to support NL80211_SCAN_FLAG_RANDOM_ADDRJohannes Berg7-38/+92
Allow drivers to support NL80211_SCAN_FLAG_RANDOM_ADDR with software based scanning and generate a random MAC address for them for every scan request with the flag. Signed-off-by: Johannes Berg <[email protected]>
2014-11-19mac80211: rcu-ify scan and scheduled scan request pointersJohannes Berg3-34/+56
In order to use the scan and scheduled scan request pointers during RX to check for randomisation, make them accessible using RCU. Reviewed-by: Emmanuel Grumbach <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2014-11-19cfg80211: allow drivers to support random MAC addresses for scanJohannes Berg1-3/+83
Add the necessary feature flags and a scan flag to support using random MAC addresses for scan while unassociated. The configuration for this supports an arbitrary MAC address value and mask, so that any kind of configuration (e.g. fixed OUI or full 46-bit random) can be requested. Full 46-bit random is the default when no other configuration is passed. Also add a small helper function to use the addr/mask correctly. Signed-off-by: Johannes Berg <[email protected]>
2014-11-19mac80211: remove redundant checkEliad Peller1-1/+1
local->scan_req was tested in the previous line, so it can't be NULL. Signed-off-by: Eliad Peller <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2014-11-19cfg80211: add wowlan net-detect supportLuciano Coelho2-1/+111
Add a new WoWLAN API to enable net-detect as a wake up trigger. Net-detect allows the device to scan in the background while the host is asleep to wake up the host system when a matching network is found. Reuse the scheduled scan attributes to specify how the scan is performed while suspended and the matches that will trigger a wake event. Signed-off-by: Luciano Coelho <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2014-11-19cfg80211: refactor nl80211_start_sched_scan so it can be reusedLuciano Coelho1-58/+72
For net detect, we will need to reuse most of the scheduled scan parsing function, but not all, so split out the attributes parsing part out of the main start sched_scan function. Signed-off-by: Luciano Coelho <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2014-11-19mac80211: synchronously reserve TID per stationLiad Kaufman6-0/+147
In TDLS (e.g., TDLS off-channel) there is a requirement for some drivers to supply an unused TID between the AP and the device to the FW, to allow sending PTI requests and to allow the FW to aggregate on a specific TID for better throughput. To ensure that the allocated TID is indeed unused, this patch introduces an API for blocking the driver from TXing on that TID. Signed-off-by: Liad Kaufman <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2014-11-19mac80211: add specific-queue flushing supportLiad Kaufman2-5/+18
If the HW supports IEEE80211_HW_QUEUE_CONTROL, allow flushing only specific queues rather than all of them. Signed-off-by: Liad Kaufman <[email protected]> Signed-off-by: Arik Nemtsov <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2014-11-19mac80211: add TDLS channel-switch Rx flowArik Nemtsov7-1/+413
When receiving a TDLS channel switch request or response, parse the frame and call a new tdls_recv_channel_switch op in the low level driver with the parsed data. Signed-off-by: Arik Nemtsov <[email protected]> Signed-off-by: Arik Nemtsov <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2014-11-19mac80211: introduce TDLS channel switch opsArik Nemtsov9-5/+362
Implement the cfg80211 TDLS channel switch ops and introduce new mac80211 ones for low-level drivers. Verify low-level driver support for the new ops when using the relevant wiphy feature bit. Also verify the peer supports channel switching before passing the command down. Add a new STA flag to track the off-channel state with the TDLS peer and make sure to cancel the channel-switch if the peer STA is unexpectedly removed. Signed-off-by: Arik Nemtsov <[email protected]> Signed-off-by: Arik Nemtsov <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2014-11-19mac80211: add parsing of TDLS specific IEsArik Nemtsov2-0/+18
These are used in TDLS channel switching code. Signed-off-by: Arik Nemtsov <[email protected]> Signed-off-by: Arik Nemtsov <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2014-11-19cfg80211: introduce TDLS channel switch commandsArik Nemtsov4-0/+178
Introduce commands to initiate and cancel TDLS channel-switching. Once TDLS channel-switching is started, the lower level driver is responsible for continually initiating channel-switch operations and returning to the base (AP) channel to listen for beacons from time to time. Upon cancellation of the channel-switch all communication between the relevant TDLS peers will continue on the base channel. Signed-off-by: Arik Nemtsov <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2014-11-19mac80211: prepare TDLS mgmt code for channel-switch templatesArik Nemtsov1-25/+57
Split the data-generating from the Tx-sending functionality, as we do not want to send templates to the lower driver. Also add an optional chandef argument to the data-generating portion. It will be used for channel-switch templates. Signed-off-by: Arik Nemtsov <[email protected]> Signed-off-by: Arik Nemtsov <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2014-11-19mac80211: track AP and peer STA TDLS chan-switch supportArik Nemtsov6-2/+23
The AP or peer can prohibit TDLS channel switch via a bit in the extended capabilities IE. Parse the IE and track this bit. Set an appropriate STA flag if both the AP and peer STA support TDLS channel-switching. Add the new STA flag and the missing TDLS_INITIATOR to debugfs. Signed-off-by: Arik Nemtsov <[email protected]> Signed-off-by: Arik Nemtsov <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2014-11-19cfg/mac80211: define TDLS channel switch feature bitArik Nemtsov1-3/+6
Define some related TDLS protocol constants and advertise channel switch support in the extended-capabilities IE when the feature bit is defined. Actually supporting TDLS channel-switching also requires support for some new nl80211 commands, to be introduced by future patches. Signed-off-by: Arik Nemtsov <[email protected]> Signed-off-by: Arik Nemtsov <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2014-11-19mac80211: add BSS coex IE to TDLS setup framesArik Nemtsov1-0/+15
Add the BSS coex IE in case we support HT40 channels, as mandated by section 8.5.13 in IEEE802.11 2012. Signed-off-by: Arik Nemtsov <[email protected]> Signed-off-by: Arik Nemtsov <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2014-11-19mac80211: add supported channels IE during TDLS setupArik Nemtsov1-0/+71
This information element is mandatory in case TDLS channel-switching is to be supported. The channels given are ones supported and allowed to be active in the current regulatory setting. Signed-off-by: Arik Nemtsov <[email protected]> Signed-off-by: Arik Nemtsov <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2014-11-19mac80211: add function to create data frame template including keyJohannes Berg2-0/+34
For some TDLS channel switch implementations data frames need to be sent by the firmware based on a template. This template should be created by mac80211, and thus needs to properly be built from an 802.3 frame into an 802.11 frame. In addition, the device will need the key information so the select_key handler needs to be run. However, the driver/device will be responsible for all of the crypto encapsulation, as the sequence numbers etc. cannot be built by the host anyway in this case since it's a template to be used multiple times. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Arik Nemtsov <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2014-11-19mac80211: factor out 802.11 header building codeJohannes Berg1-52/+92
Factor out the 802.11 header building code from the xmit function to be able to use it separately in a later commit. While at it, fix up some documentation. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Arik Nemtsov <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2014-11-19mac80211: move skb info band assignment outJohannes Berg4-16/+16
Instead of passing the band as a parameter to ieee80211_xmit() and ieee80211_tx(), move it outside of the two functions while making sure info->band is set up before calling them. This removes the parameter and simplifies the follow commit. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Arik Nemtsov <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2014-11-19mac80211: retransmit TDLS teardown packet through AP if not ACKedLiad Kaufman4-13/+117
Since the TDLS peer station might not receive the teardown packet (e.g., when in PS), this makes sure the packet is retransmitted - this time through the AP - if the TDLS peer didn't ACK the packet. Signed-off-by: Liad Kaufman <[email protected]> Signed-off-by: Arik Nemtsov <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2014-11-19mac80211: add option for setting skb flags before xmitLiad Kaufman2-8/+16
Allows setting of an skb's flags - if needed - when calling ieee80211_subif_start_xmit(). Signed-off-by: Liad Kaufman <[email protected]> Signed-off-by: Arik Nemtsov <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2014-11-19merge nfs bugfixes into nfsd for-3.19 branchJ. Bruce Fields79-476/+1144
In addition to nfsd bugfixes, there are some fixes in -rc5 for client bugs that can interfere with my testing.
2014-11-19SUNRPC: Fix locking around callback channel reply receiveTrond Myklebust1-11/+16
Both xprt_lookup_rqst() and xprt_complete_rqst() require that you take the transport lock in order to avoid races with xprt_transmit(). Signed-off-by: Trond Myklebust <[email protected]> Cc: [email protected] Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2014-11-19Bluetooth: Convert link keys list to use RCUJohan Hedberg2-21/+20
This patch converts the hdev->link_keys list to be protected through RCU, thereby eliminating the need to hold the hdev lock while accessing the list. Signed-off-by: Johan Hedberg <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>