aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/profile.c (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2010-10-11net: clear heap allocations for privileged ethtool actionsKees Cook1-3/+3
Several other ethtool functions leave heap uncleared (potentially) by drivers. Some interfaces appear safe (eeprom, etc), in that the sizes are well controlled. In some situations (e.g. unchecked error conditions), the heap will remain unchanged in areas before copying back to userspace. Note that these are less of an issue since these all require CAP_NET_ADMIN. Cc: stable@kernel.org Signed-off-by: Kees Cook <kees.cook@canonical.com> Acked-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-11NET: pch, fix use after freeJiri Slaby1-1/+1
Stanse found that pch_gbe_xmit_frame uses skb after it is freed. Fix that. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Masayuki Ohtake <masa-korg@dsn.okisemi.com> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-11NET: wimax, fix use after freeJiri Slaby1-13/+13
Stanse found that i2400m_rx frees skb, but still uses skb->len even though it has skb_len defined. So use skb_len properly in the code. And also define it unsinged int rather than size_t to solve compilation warnings. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com> Cc: linux-wimax@intel.com Acked-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-11ATM: iphase, remove sleep-inside-atomicJiri Slaby2-7/+1
Stanse found that ia_init_one locks a spinlock and inside of that it calls ia_start which calls: * request_irq * tx_init which does kmalloc(GFP_KERNEL) Both of them can thus sleep and result in a deadlock. I don't see a reason to have a per-device spinlock there which is used only there and inited right before the lock location. So remove it completely. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Chas Williams <chas@cmf.nrl.navy.mil> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-11ATM: mpc, fix use after freeJiri Slaby1-1/+1
Stanse found that mpc_push frees skb and then it dereferences it. It is a typo, new_skb should be dereferenced there. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Eric Dumazet <eric.dumazet@gmail.com> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-11ATM: solos-pci, remove use after freeJiri Slaby1-3/+5
Stanse found we do in console_show: kfree_skb(skb); return skb->len; which is not good. Fix that by remembering the len and use it in the function instead. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Chas Williams <chas@cmf.nrl.navy.mil> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-11neigh: speedup neigh_hh_init()Eric Dumazet3-40/+69
When a new dst is used to send a frame, neigh_resolve_output() tries to associate an struct hh_cache to this dst, calling neigh_hh_init() with the neigh rwlock write locked. Most of the time, hh_cache is already known and linked into neighbour, so we find it and increment its refcount. This patch changes the logic so that we call neigh_hh_init() with neighbour lock read locked only, so that fast path can be run in parallel by concurrent cpus. This brings part of the speedup we got with commit c7d4426a98a5f (introduce DST_NOCACHE flag) for non cached dsts, even for cached ones, removing one of the contention point that routers hit on multiqueue enabled machines. Further improvements would need to use a seqlock instead of an rwlock to protect neigh->ha[], to not dirty neigh too often and remove two atomic ops. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-10net/fec: carrier off initially to avoid root mount failureOskar Schirmer1-0/+3
with hardware slow in negotiation, the system did freeze while trying to mount root on nfs at boot time. the link state has not been initialised so network stack tried to start transmission right away. this caused instant retries, as the driver solely stated business upon link down, rendering the system unusable. notify carrier off initially to prevent transmission until phylib will report link up. Signed-off-by: Oskar Schirmer <oskar@linutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-11irda: Fix heap memory corruption in iriap.cSamuel Ortiz1-1/+2
While parsing the GetValuebyClass command frame, we could potentially write passed the skb->data pointer. Cc: stable@kernel.org Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: Samuel Ortiz <samuel@sortiz.org>
2010-10-11irda: Fix parameter extraction stack overflowSamuel Ortiz1-1/+3
Cc: stable@kernel.org Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: Samuel Ortiz <samuel@sortiz.org>
2010-10-11irda: Test index before read in stir421x_patch_device()Roel Kluin1-4/+4
Test whether index exceeds fw->size before reading the element Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Samuel Ortiz <samuel@sortiz.org>
2010-10-11irda: Remove BKL instances from irnetSamuel Ortiz2-19/+44
The code intends to lock the irnet_socket, so adding a mutex to it allows for a complet BKL removal. Signed-off-by: Samuel Ortiz <samuel@sortiz.org>
2010-10-11irda: Remove BKL instances from af_irda.cSamuel Ortiz1-174/+196
Most of the times, lock_kernel() was pointless or could simply be replaced by lock_sock(). Signed-off-by: Samuel Ortiz <samuel@sortiz.org>
2010-10-09sundance: get_stats proper lockingEric Dumazet1-4/+6
sundance get_stats() should not be run concurrently, add a lock to avoid potential losses. Note: Remove unused rx_lock field Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-09net/tg3: simplify conditionalNicolas Kaiser1-2/+1
Simplify: ((a && !b) || (!a && b)) => (a != b) Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-09ehea: simplify conditionalNicolas Kaiser1-1/+1
Simplify: ((a && b) || (!a && !b)) => (a == b) Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Acked-by: Breno Leitao <leitao@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-09net_sched: use __TCA_HTB_MAX and TCA_HTB_MAXChangli Gao1-2/+2
Signed-off-by: Changli Gao <xiaosuo@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-09r8169: use device model DMA APIStanislaw Gruszka1-24/+29
Use DMA API as PCI equivalents will be deprecated. This change also allow to allocate with GFP_KERNEL where possible. Tested-by: Neal Becker <ndbecker2@gmail.com> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-09r8169: allocate with GFP_KERNEL flag when able to sleepStanislaw Gruszka1-6/+6
We have fedora bug report where driver fail to initialize after suspend/resume because of memory allocation errors: https://bugzilla.redhat.com/show_bug.cgi?id=629158 To fix use GFP_KERNEL allocation where possible. Tested-by: Neal Becker <ndbecker2@gmail.com> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-08net: Fix rxq ref countingTom Herbert2-1/+2
The rx->count reference is used to track reference counts to the number of rx-queue kobjects created for the device. This patch eliminates initialization of the counter in netif_alloc_rx_queues and instead increments the counter each time a kobject is created. This is now symmetric with the decrement that is done when an object is released. Signed-off-by: Tom Herbert <therbert@google.com> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-08Phonet: mark the pipe controller as EXPERIMENTALRémi Denis-Courmont1-2/+2
There are a bunch of issues that need to be fixed, including: - GFP_KERNEL allocations from atomic context (and GFP_ATOMIC in process context), - abuse of the setsockopt() call convention, - unprotected/unlocked static variables... IMHO, we will need to alter the userspace ABI when we fix it. So mark the configuration option as EXPERIMENTAL for the time being (or should it be BROKEN instead?). Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-08Phonet: cleanup pipe enable socket optionRémi Denis-Courmont3-56/+34
The current code works like this: int garbage, status; socklen_t len = sizeof(status); /* enable pipe */ setsockopt(fd, SOL_PNPIPE, PNPIPE_ENABLE, &garbage, sizeof(garbage)); /* disable pipe */ setsockopt(fd, SOL_PNPIPE, PNPIPE_DISABLE, &garbage, sizeof(garbage)); /* get status */ getsockopt(fd, SOL_PNPIPE, PNPIPE_INQ, &status, &len); ...which does not follow the usual socket option pattern. This patch merges all three "options" into a single gettable&settable option, before Linux 2.6.37 gets out: int status; socklen_t len = sizeof(status); /* enable pipe */ status = 1; setsockopt(fd, SOL_PNPIPE, PNPIPE_ENABLE, &status, sizeof(status)); /* disable pipe */ status = 0; setsockopt(fd, SOL_PNPIPE, PNPIPE_ENABLE, &status, sizeof(status)); /* get status */ getsockopt(fd, SOL_PNPIPE, PNPIPE_ENABLE, &status, &len); This also fixes the error code from EFAULT to ENOTCONN. Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Cc: Kumar Sanghvi <kumar.sanghvi@stericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-08Phonet: advise against enabling the pipe controllerRémi Denis-Courmont1-1/+2
As it currently is, the new code path is not compatible with existing Nokia modems. This would break existing userspace for Nokia modem, such as the existing oFono ISI driver. Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-08Phonet: add to MAINTAINERS and add myselfRémi Denis-Courmont1-0/+8
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-08qlcnic: update driver version 5.0.11Amit Kumar Salecha1-2/+2
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-08qlcnic: change all P3 references to P3PSritej Velaga5-72/+72
This patch just rename all P3 #define to P3P. Signed-off-by: Sritej Velaga <sritej.velaga@qlogic.com> Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-08qlcnic: fix promiscous mode for VFRajesh Borundia3-3/+10
o Allow promiscous mode setting for VF's depending upon the configuration. Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com> Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-08qlcnic: fix board descriptionSritej Velaga1-1/+1
Remove "Flex-10" from board description. Signed-off-by: Sritej Velaga <sritej.velaga@qlogic.com> Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-08qlcnic: remove private LRO flagAmit Kumar Salecha3-9/+2
LRO was not getting enable after interface down/up. Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-08qlcnic: support quiescent modeAmit Kumar Salecha3-17/+74
Put device in quiescent mode during internal loopback test. Before running test, set state to NEED_QUISCENT. After getting ack from all function, change state to QUISCENT and perform test. Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-08qlcnic: driver private workqueueAmit Kumar Salecha1-1/+11
Currently fw recovery usage global workqueue. As same workqueue used by kernel for ethtool and etc., supporting quiescent mode is not possible, without driver private workqueue. Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-08ipv4: Remove leftover rcu_read_unlock calls from __mkroute_output()Dimitris Michailidis1-4/+2
Commit "fib: RCU conversion of fib_lookup()" removed rcu_read_lock() from __mkroute_output but left a couple of calls to rcu_read_unlock() in there. This causes lockdep to complain that the rcu_read_unlock() call in __ip_route_output_key causes a lock inbalance and quickly crashes the kernel. The below fixes this for me. Signed-off-by: Dimitris Michailidis <dm@chelsio.com> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-08net: clear heap allocation for ETHTOOL_GRXCLSRLALLKees Cook1-1/+1
Calling ETHTOOL_GRXCLSRLALL with a large rule_cnt will allocate kernel heap without clearing it. For the one driver (niu) that implements it, it will leave the unused portion of heap unchanged and copy the full contents back to userspace. Signed-off-by: Kees Cook <kees.cook@canonical.com> Acked-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-08sfc: Don't try to set filters with search depths we know won't workBen Hutchings1-1/+10
The filter engine will time-out and ignore filters beyond 200-something hops. We also need to avoid infinite loops in efx_filter_search() when the table is full. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-08net: Update kernel-doc for netif_set_real_num_rx_queues()Ben Hutchings1-2/+2
Synchronise the comment with the preceding implementation change. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-08isdn: strcpy() => strlcpy()Dan Carpenter1-4/+14
setup.phone and setup.eazmsn are 32 character buffers. rcvmsg.msg_data.byte_array is a 48 character buffer. sc_adapter[card]->channel[rcvmsg.phy_link_no - 1].dn is 50 chars. The rcvmsg struct comes from the memcpy_fromio() in receivemessage(). I guess that means it's data off the wire. I'm not very familiar with this code but I don't see any reason to assume these strings are NULL terminated. Also it's weird that "dn" in a 50 character buffer but we only seem to use 32 characters. In drivers/isdn/sc/scioc.h, "dn" is only a 49 character buffer. So potentially there is still an issue there. The important thing for now is to prevent the memory corruption. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-07ath9k_hw: Fix hw reset failure with HTC driverRajkumar Manoharan1-4/+0
The following commit removed DISABLE_REGWRITE_BUFFER ops. The unnecessary REGWRITE_BUFFER_FLUSH was not removed properly which is causing failure on hw reset. Author: Felix Fietkau <nbd@openwrt.org> Date: Tue Oct 5 12:03:42 2010 +0200 ath9k_hw: clean up register write buffering Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-10-07cfg80211: constify WDS addressJohannes Berg3-3/+3
There's no need for the WDS peer address to not be const, so make it const. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-10-07nl80211: use new genl helpers for WDSJohannes Berg1-33/+12
Bill Jordan's patch to allow setting the WDS peer crossed with my patch removing all the boilerplate code in nl80211, and consequently he didn't make use of it yet. Fix that. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-10-07mac80211: fix sw scan lockingJohannes Berg1-2/+1
The recent scan overhaul broke locking because now we can jump to code that attempts to unlock, while we don't have the mutex held. Fix this by holding the mutex around all the relevant code. Reported-by: Ben Greear <greearb@candelatech.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-10-07wl1271: Support FEM autodetectionJuuso Oikarinen1-4/+17
In the NVS/INI-parameters for the driver/firmware there is the FEM (front end module) selection option, which may configure the hardware FEM via autodetection or manual selection. So far, there has been support for manual selection only. Add support for FEM autodetection. Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-10-07Revert "mac80211: use netif_receive_skb in ieee80211_tx_status callpath"John W. Linville1-2/+2
This reverts commit 5ed3bc7288487bd4f891f420a07319e0b538b4fe. It turns-out that not all drivers are calling ieee80211_tx_status from a compatible context. Revert this for now and try again later... Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-10-07Revert "rtl8180: use NAPI for bottom-half processing"John W. Linville1-69/+59
This reverts commit 030725d2c7c1fafec7ede618647bf30ed79601f0. This commit relies on commit 5ed3bc7288487bd4f891f420a07319e0b538b4fe ("mac80211: use netif_receive_skb in ieee80211_tx_status callpath") Unfortunately not all drivers are calling ieee80211_tx_status from a compatible context, so that commit needs to be reverted in 2.6.36. Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-10-06ixgbe: Use affinity_hint when Flow Director is enabledPeter Waskiewicz2-0/+27
Use the new infrastructure to balance interrupts for flow alignment when ATR or Flow Director are enabled. Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-06drivers/net/stmmac/: add HAS_IOMEM dependencyMartin Schwidefsky1-1/+1
The stmmac driver does not compile on s390: drivers/net/stmmac/stmmac_main.c: In function 'stmmac_adjust_link': drivers/net/stmmac/stmmac_main.c:210: error: implicit declaration of function 'readl' drivers/net/stmmac/stmmac_main.c:263: error: implicit declaration of function 'writel' drivers/net/stmmac/stmmac_main.c: In function 'stmmac_dvr_probe': drivers/net/stmmac/stmmac_main.c:1674: error: implicit declaration of function 'ioremap' drivers/net/stmmac/stmmac_main.c:1674: warning: assignment makes pointer from integer without a cast drivers/net/stmmac/stmmac_main.c:1761: error: implicit declaration of function 'iounmap' make[3]: *** [drivers/net/stmmac/stmmac_main.o] Error 1 Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Giuseppe CAVALLARO <peppe.cavallaro@st.com> Cc: David S. Miller <davem@davemloft.net> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-06net: netif_set_real_num_rx_queues may cap num_rx_queues at init timeJohn Fastabend1-2/+0
Do not set num_rx_queues in netif_set_real_num_rx_queues() some drivers will increase the real_num_rx_queues later due to a feature changes or available interrupts increasing. By setting num_rx_queues here this ends up creating a cap on the number of rx queues available. For example the ixgbe driver sets the max number of queues it intends to use ever then sets the current number in use with the netif_set_num_{rx|tx}_queues calls. With the current implementation the number of rx queues gets limited so when a feature such as DCB or FCoE is enabled the queues are no longer available. kobjects will only be allocated for real_num_rx_queues so the waste in memory is minimal. Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-06eicon: make buffer largerDan Carpenter2-2/+2
In diva_mnt_add_xdi_adapter() we do this: strcpy (clients[id].drvName, tmp); strcpy (clients[id].Dbg.drvName, tmp); The "clients[id].drvName" is a 128 character buffer and "clients[id].Dbg.drvName" was originally a 16 character buffer but I've changed it to 128 as well. We don't actually use 128 characters but we do use more than 16. I've also changed the size of "tmp" to 128 characters instead of 256. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-06dccp: Kill dead code and add static markers.stephen hemminger5-40/+25
Remove dead code and make some functions static. Compile tested only. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-06sundance: Drop legacy _COMPAT_WITH_OLD_KERNEL includesDenis Kirjanov1-7/+0
Drop legacy includes since 2.4.x Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-06TCP: Fix setting of snd_ssthresh in tcp_mtu_probe_successJohn Heffner1-1/+1
This looks like a simple typo that has gone unnoticed for some time. The impact is relatively low but it's clearly wrong. Signed-off-by: John Heffner <johnwheffner@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>