Hong Wu [Wed, 11 Jan 2012 18:33:39 +0000 (20:33 +0200)]
wireless: Save original maximum regulatory transmission power for the calucation of the local maximum transmit power
The local maximum transmit power is the maximum power a wireless device
allowed to transmit. If Power Constraint is presented, the local maximum
power equals to the maximum allowed power defined in regulatory domain
minus power constraint.
The maximum transmit power is maximum power a wireless device capable of
transmitting, and should be used in Power Capability element (7.3.2.16
IEEE802.11 2007).
The transmit power from a wireless device should not greater than the
local maximum transmit power.
The maximum transmit power was not calculated correctly in the current
Linux wireless/mac80211 when Power Constraint is presented.
Signed-off-by: Hong Wu <hong.wu@dspg.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
On carl9170, HW encryption is disabled on IBSS; the mac80211
software-based encryption is used instead. As mac80211 supports IBSS
RSN (per-STA GTK), claim its support in the carl9170 PHY.
Signed-off-by: Nicolas Cavallari <cavallar@lri.fr> Acked-by: Christian Lamparter <chunkeey@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Mon, 9 Jan 2012 12:57:36 +0000 (13:57 +0100)]
mac80211: refactor __ieee80211_get_channel_mode
Use a switch statement instead of a list of if
statements. Also include AP_VLAN in the list
and skip them since the AP interface will also
be looked at.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Ilan Elias [Sun, 8 Jan 2012 09:21:53 +0000 (11:21 +0200)]
NFC: Complete NCI deactivate in deactivate_ntf
If a target was active, complete the NCI deactivate request
only in deactivate_ntf. Otherwise, complete it at deactivate_rsp.
Deactivate_ntf represents the actual disconnection event (sent from
the NCI controller).
Signed-off-by: Ilan Elias <ilane@ti.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Larry Finger [Sun, 8 Jan 2012 02:46:41 +0000 (20:46 -0600)]
rtl8192cu: Remove dead code never selected
The original driver contained some conditional code that was not selected,
but was not deleted in case it would be used later. That code can now be
removed.
Reported-by: Joe Perches <joe@perches.com> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Larry Finger [Sun, 8 Jan 2012 02:46:40 +0000 (20:46 -0600)]
rtlwifi: rtl8192c_common: rtl8192de: Check for allocation failures
In https://bugzilla.redhat.com/show_bug.cgi?id=771656, a kernel bug was
triggered due to a failed skb allocation that was not checked. This event
lead to an audit of all memory allocations in the complete rtlwifi family
of drivers. This patch fixes the rest.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Stable <stable@vger.kernel.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
we would have bailed out if 'ifibss->fixed_channel'
is valid i.e. we had used 'fixed-freq' parameter in iw ibss
join command. this is with the state 'IEEE80211_IBSS_MLME_JOINED'
so no need to check for it
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Add new testmode command IWL_TM_CMD_APP2DEV_GET_FW_INFO for
reporting the following information of existing loaded uCode image.
+ uCode type
+ Instruction section size
+ Data section size
Signed-off-by: Kenny Hsu <kenny.hsu@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Kenny Hsu [Fri, 6 Jan 2012 21:16:31 +0000 (13:16 -0800)]
iwlwifi: update error dump in testmode command sram_read
The error message will be show up by using IWL_ERR
insteads of IWl_DEBUG_INFO.
Signed-off-by: Kenny Hsu <kenny.hsu@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Kenny Hsu [Fri, 6 Jan 2012 21:16:30 +0000 (13:16 -0800)]
iwlwifi: enhance testmode command sram_read
This patch enables SRAM read function to support entire target memory.
Signed-off-by: Kenny Hsu <kenny.hsu@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Kenny Hsu [Fri, 6 Jan 2012 21:16:29 +0000 (13:16 -0800)]
iwlwifi: update testmode command of direct register access
In order to make sure the testcommand function of direct register
access can be performed even NIC is asleep, replace corresponding
handler iwl_read32 and iwl_write32 by using iwl_direct_read32 and
iwl_direct_write32.
Signed-off-by: Kenny Hsu <kenny.hsu@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Wey-Yi Guy [Fri, 6 Jan 2012 21:16:28 +0000 (13:16 -0800)]
iwlwifi: Sanity check for sta_id
On my testing, I saw some strange behavior
[ 421.739708] iwlwifi 0000:01:00.0: ACTIVATE a non DRIVER active station id 148 addr 00:00:00:00:00:00
[ 421.739719] iwlwifi 0000:01:00.0: iwl_sta_ucode_activate Added STA id 148 addr 00:00:00:00:00:00 to uCode
not sure how it happen, but adding the sanity check to prevent memory
corruption
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Wey-Yi Guy [Fri, 6 Jan 2012 21:16:27 +0000 (13:16 -0800)]
iwlwifi: don't process the info from uCode if does not has ownership
When enable the testmode from user space and working with uCode, driver does
not own the uCode and should not process the notifications or pkts from uCode
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Joe Perches [Fri, 6 Jan 2012 19:31:43 +0000 (11:31 -0800)]
rtlwifi: Simplify chip version id logging
Reduce object size a few KB too.
$ size drivers/net/wireless/rtlwifi/built-in.o*
text data bss dec hex filename
584493 55333 126800 766626 bb2a2 drivers/net/wireless/rtlwifi/built-in.o.new
586904 55333 127216 769453 bbdad drivers/net/wireless/rtlwifi/built-in.o.old
Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
pr_fmt() adds them. These are unnecessary and wrong.
Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Joe Perches [Thu, 5 Jan 2012 16:29:07 +0000 (08:29 -0800)]
rtlwifi: add CONFIG_RTLWIFI_DEBUG to remove all of the debug logging code
It does seem odd though to have a DBG_EMERG and not always
emit it.
What might also be useful for any embedded use is to add
CONFIG_RTLWIFI_DEBUG to conditionally remove all of the
debug logging code to reduce the largish object size.
This reduces the object size by about 1/3 (250KB)
when CONFIG_RTLWIFI_DEBUG is not set.
$ size drivers/net/wireless/rtlwifi/built-in.o*
text data bss dec hex filename
368722 55333 94224 518279 7e887 drivers/net/wireless/rtlwifi/built-in.o.new
586904 55333 127216 769453 bbdad drivers/net/wireless/rtlwifi/built-in.o.old
Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Joe Perches [Thu, 5 Jan 2012 03:40:45 +0000 (19:40 -0800)]
rtlwifi: Optimize RT_TRACE macro use of KBUILD_MODNAME for size
Moving the KBUILD_MODNAME to the format reduces the
overall object size a small amount.
$ size drivers/net/wireless/rtlwifi/built-in.o*
text data bss dec hex filename
586904 55333 127216 769453 bbdad drivers/net/wireless/rtlwifi/built-in.o.new
588901 55333 127216 771450 bc57a drivers/net/wireless/rtlwifi/built-in.o.old
Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Joe Perches [Thu, 5 Jan 2012 03:40:44 +0000 (19:40 -0800)]
rtlwifi: Remove duplicate __func__
The RT_TRACE macro already prepends it.
Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Joe Perches [Thu, 5 Jan 2012 03:40:43 +0000 (19:40 -0800)]
rtlwifi: Convert RT_ASSERT macro to use ##__VA_ARGS__
Consolidate printks to avoid possible message interleaving
and reduce the object size.
Remove unnecessary RT_ASSERT parentheses.
Align arguments.
Coalesce formats.
Remove unnecessary __func__ use as the macro uses it.
$ size drivers/net/wireless/rtlwifi/built-in.o*
text data bss dec hex filename
588901 55333 127216 771450 bc57a drivers/net/wireless/rtlwifi/built-in.o.new
590002 55333 127560 772895 bcb1f drivers/net/wireless/rtlwifi/built-in.o.old
Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
$ size drivers/net/wireless/rtlwifi/built-in.o*
text data bss dec hex filename
590002 55333 127560 772895 bcb1f drivers/net/wireless/rtlwifi/built-in.o.new
594841 55333 129680 779854 be64e drivers/net/wireless/rtlwifi/built-in.o.old
Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Joe Perches [Thu, 5 Jan 2012 03:40:41 +0000 (19:40 -0800)]
rtlwifi: Convert RT_TRACE macro to use ##__VA_ARGS__
Consolidate printks to avoid possible message interleaving
and reduce the object size.
Remove unnecessary RT_TRACE parentheses.
Miscellaneous typo and grammar fixes.
Add missing newlines to formats.
Remove duplicate KERN_DEBUG prefixes.
Coalesce formats.
Align arguments.
$ size drivers/net/wireless/rtlwifi/built-in.o*
text data bss dec hex filename
594841 55333 129680 779854 be64e drivers/net/wireless/rtlwifi/built-in.o.new
607022 55333 138720 801075 c3933 drivers/net/wireless/rtlwifi/built-in.o.old
Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Joe Perches [Thu, 5 Jan 2012 03:40:40 +0000 (19:40 -0800)]
rtlwifi: Standardize RT_PRINT_DATA macro and uses
Use a single printk(KERN_DEBUG to emit the header line
to avoid any possible output interleaving.
Remove unnecessary parentheses from the calling uses.
Standardize header arg without trailing \n or colon.
Fix a few pairwiase/pairwise typos.
Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Use do {...} while (0) without terminating semicolons.
Add missing terminating semicolon to a few uses.
Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
All usage of ethtool_ops should be const; also add comma at end
of initializer list.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Acked-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Rafał Miłecki [Mon, 2 Jan 2012 07:41:23 +0000 (08:41 +0100)]
ssb: SPROM: extract each core power info
We already extract some basic info but it's incomplete, reads info
about the first core only. Used data structure doesn't allow easy
adding of more cores.
This patch adds new struct and array for storing power info. The plan
is to: switch all extractors (including the ones using NVRAM) to new
struct, switch drivers, then deprecate and finally drop old SSB fields.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Eliad Peller [Thu, 29 Dec 2011 12:41:39 +0000 (14:41 +0200)]
mac80211: check sta_apply_parameters() return value
Bail out if sta_apply_parameters() returns an error.
Signed-off-by: Eliad Peller <eliad@wizery.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Matt Carlson [Tue, 17 Jan 2012 15:27:23 +0000 (15:27 +0000)]
tg3: Fix single-vector MSI-X code
Kdump kernels leave MSI-X interrupts (as setup by the crashed kernel)
enabled. However, kdump only enables one CPU in the new environment,
thus causing tg3 to abort MSI-X setup. When the driver attempts to
enable INTA or MSI interrupt modes on a kdump kernel, interrupt
delivery fails.
This patch attempts to workaround the problem by forcing the driver
to enable a single MSI-X interrupt. In such a configuration, the
device's multivector interrupt mode must be disabled.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Ben Pfaff [Tue, 17 Jan 2012 13:33:39 +0000 (13:33 +0000)]
openvswitch: Fix multipart datapath dumps.
The logic to split up the list of datapaths into multiple Netlink messages
was simply wrong, causing the list to be terminated after the first part.
Only about the first 50 datapaths would be dumped. This fixes the
problem.
Reported-by: Paul Ingram <paul@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Signed-off-by: Jesse Gross <jesse@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Ben Hutchings [Tue, 17 Jan 2012 07:57:56 +0000 (07:57 +0000)]
net: WARN if skb_checksum_help() is called on skb requiring segmentation
skb_checksum_help() has never done anything useful with skbs that
require segmentation. Setting skb->ip_summed = CHECKSUM_NONE makes
them invalid and provokes a later WARNing in skb_gso_segment().
Passing such an skb to skb_checksum_help() indicates a bug, so we
should warn about it immediately. Move the warning from
skb_gso_segment() into a shared function, and add gso_type and
gso_size to it.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Yaniv Rosner [Tue, 17 Jan 2012 02:33:29 +0000 (02:33 +0000)]
bnx2x: Disable AN KR work-around for BCM57810
Disable the work-around for the autoneg KR of the BCM57810 in case the Warpcore version is 0xD108 and above, which fixes this problem.
Signed-off-by: Yaniv Rosner <yanivr@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Yaniv Rosner [Tue, 17 Jan 2012 02:33:28 +0000 (02:33 +0000)]
bnx2x: Remove AutoGrEEEn for BCM84833
Disable the autoGrEEEn feature for BCM84833.
Signed-off-by: Yaniv Rosner <yanivr@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Yaniv Rosner [Tue, 17 Jan 2012 02:33:27 +0000 (02:33 +0000)]
bnx2x: Remove 100Mb force speed for BCM84833
Remove unsupported speed of 100Mb force for BCM84833 due to hardware
limitation.
Signed-off-by: Yaniv Rosner <yanivr@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Yaniv Rosner [Tue, 17 Jan 2012 02:33:26 +0000 (02:33 +0000)]
bnx2x: Fix PFC setting on BCM57840
This patch handles the second port of a path in a 4-port device of
BCM57840.
Signed-off-by: Yaniv Rosner <yanivr@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Yaniv Rosner [Tue, 17 Jan 2012 02:33:25 +0000 (02:33 +0000)]
bnx2x: Fix Super-Isolate mode for BCM84833
The Super-Isolate mode comes to isolate the BCM84833 PHY from the
outside world. Not doing it correctly, made link partner see the link
before the driver was loaded.
This patch also involves SPIROM version fixes since it is used to
determine whether the common init of the PHY was already executed, and
the common init of this PHY is partially responsible for setting the
Super-Isolate mode.
Signed-off-by: Yaniv Rosner <yanivr@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
net: sh-eth: Fix build error by the value which is not defined
-----
drivers/net/ethernet/renesas/sh_eth.c:1706: error: 'pdid' undeclared (first use in this function)
drivers/net/ethernet/renesas/sh_eth.c:1706: error: (Each undeclared identifier is reported only once
drivers/net/ethernet/renesas/sh_eth.c:1706: error: for each function it appears in.)
make[5]: *** [drivers/net/ethernet/renesas/sh_eth.o] Error 1
-----
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> CC: Florian Fainelli <florian@openwrt.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Ben Hutchings [Mon, 16 Jan 2012 12:38:59 +0000 (12:38 +0000)]
net: Use device model to get driver name in skb_gso_segment()
ethtool operations generally require the caller to hold RTNL and are
not safe to call in atomic context. The device model provides this
information for most devices; we'll only lose it for some old ISA
drivers.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Acked-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Eric Dumazet [Mon, 16 Jan 2012 04:35:50 +0000 (04:35 +0000)]
bridge: BH already disabled in br_fdb_cleanup()
br_fdb_cleanup() is run from timer interrupt, BH already masked.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> CC: Stephen Hemminger <shemminger@vyatta.com> CC: Štefan Gula <steweg@gmail.com> Acked-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Glauber Costa [Sun, 15 Jan 2012 22:04:39 +0000 (22:04 +0000)]
net: move sock_update_memcg outside of CONFIG_INET
Although only used currently for tcp sockets, this function
is now used in common sock code (for sock_clone())
Commit 475f1b52645a29936b9df1d8fcd45f7e56bd4a9f moved the
declaration of sock_update_clone() to inside sock.c, but
this only fixes the problem when CONFIG_CGROUP_MEM_RES_CTLR_KMEM
is also not defined.
This patch here is verified to fix both problems, although
reverting the previous one is not necessary.
Signed-off-by: Glauber Costa <glommer@parallels.com> CC: David S. Miller <davem@davemloft.net> CC: Stephen Rothwell <sfr@canb.auug.org.au> Reported-by: Randy Dunlap <rdunlap@xenotime.net> Acked-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Fixing following sparse warning
>drivers/net/wireless/mwl8k.c:2780:15: warning: incorrect type in assignment (different base types)
>drivers/net/wireless/mwl8k.c:2780:15: expected restricted unsigned short [usertype] channel
>drivers/net/wireless/mwl8k.c:2780:15: got unsigned short [unsigned] [usertype] hw_value
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Helmut Schaa [Tue, 17 Jan 2012 08:22:49 +0000 (09:22 +0100)]
mac80211: Fix possible race between sta_unblock and network softirq
All other code paths in sta_unblock synchronize with the network
softirq by using local_bh_disable/enable. Do the same around
ieee80211_sta_ps_deliver_wakeup.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Dan Carpenter [Tue, 17 Jan 2012 07:33:31 +0000 (10:33 +0300)]
mwl8k: fix condition in mwl8k_cmd_encryption_remove_key()
The intent here was to check whether key->cipher was WEP40 or WEP104.
We do a similar check correctly in several other places in this file.
The current condition is always true.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Alexandre Oliva [Mon, 16 Jan 2012 19:00:12 +0000 (14:00 -0500)]
brcmfmac: work-around gcc 4.7 build issue
Alexandre Oliva <oliva@lsd.ic.unicamp.br> says:
"It's an issue brought about by GCC 4.7's partial-inlining, that ends up
splitting the udelay function just at the wrong spot, in such a way that
some sanity checks for constants fails, and we end up calling
bad_udelay.
This patch fixes the problem. Feel free to push it upstream if it makes
sense to you."
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Hiroaki SHIMODA [Sat, 14 Jan 2012 07:10:21 +0000 (07:10 +0000)]
bql: Fix inconsistency between file mode and attr method.
There is no store() method for inflight attribute in the
tx-<n>/byte_queue_limits sysfs directory.
So remove S_IWUSR bit.
Signed-off-by: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Some functions and variables in ehea are only used in their own file, so
they should be static. One particular function had a very generic name,
print_error_data.
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Linus Torvalds [Fri, 13 Jan 2012 22:58:42 +0000 (23:58 +0100)]
brcmsmac: remove PCI suspend/resume from bcma driver
The brcmsmac driver isn't a PCI driver any more, it's a bcma one. The
PCI device has been resumed by the PCI driver (the generic PCI layer,
really), we should be resuming just our own driver state.
Also add pr_debug() calls to show that we now actually get the
suspend/resume events.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
If there was a dumping error in the middle, the set-specific variable was
not zeroed out and thus the 'done' function of the dumping wrongly tried
to release the already released reference of the set. The already released
reference was caught by __ip_set_put and triggered a kernel BUG message.
Reported by Jean-Philippe Menil.
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Jozsef Kadlecsik [Tue, 17 Jan 2012 09:39:05 +0000 (10:39 +0100)]
netfilter: ipset: autoload set type modules safely
Jan Engelhardt noticed when userspace requests a set type unknown
to the kernel, it can lead to a loop due to the unsafe type module
loading. The issue is fixed in this patch.
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Yoni Divinsky [Mon, 16 Jan 2012 13:18:59 +0000 (15:18 +0200)]
mac80211: fix tx->skb NULL pointer dereference
In function ieee80211_tx_h_encrypt the var info was
initialized from tx->skb, since the fucntion
is called after the function ieee80211_tx_h_fragment
tx->skb is not valid anymore.
Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Fabio Estevam [Mon, 16 Jan 2012 02:47:12 +0000 (00:47 -0200)]
wireless: iwlwifi: iwl-scan.c: Fix build warning
Fix the following build warning:
drivers/net/wireless/iwlwifi/iwl-scan.c: In function ‘iwlagn_request_scan’:
drivers/net/wireless/iwlwifi/iwl-scan.c:572: warning: ‘cmd_len’ may be used uninitialized in this function
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jesper Juhl [Sat, 14 Jan 2012 20:52:17 +0000 (21:52 +0100)]
Net, mac80211: Fix resource leak in ieee80211_rx_h_mesh_fwding()
We may leak the 'fwd_skb' we skb_copy() in ieee80211_rx_h_mesh_fwding() if
we take the 'else' branch in the 'if' statement just below. If we take
that branch we'll end up returning from the function and since we've not
assigned 'fwd_skb' to anything at that point, we leak it when the variable
goes out of scope.
The simple fix seems to be to just kfree_skb(fwd_skb); just before we
return. That is what this patch does.
Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Sat, 14 Jan 2012 14:08:34 +0000 (15:08 +0100)]
ath9k_hw: fix interpretation of the rx KeyMiss flag
Documentation states that the KeyMiss flag is only valid if RxFrameOK is
unset, however empirical evidence has shown that this is false.
When KeyMiss is set (and RxFrameOK is 1), the hardware passes a valid frame
which has not been decrypted. The driver then falsely marks the frame
as decrypted, and when using CCMP this corrupts the rx CCMP PN, leading
to connection hangs.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Cc: stable@kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
Rafał Miłecki [Fri, 13 Jan 2012 22:58:38 +0000 (23:58 +0100)]
bcma: invalidate the mapped core over suspend/resume
This clears the currently mapped core when suspending, to force
re-mapping after resume. Without that we were touching default core
registers believing some other core is mapped. Such a behaviour
resulted in lockups on some machines.
Cc: stable@vger.kernel.org Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
netfilter: revert user-space expectation helper support
This patch partially reverts: 3d058d7 netfilter: rework user-space expectation helper support
that was applied during the 3.2 development cycle.
After this patch, the tree remains just like before patch bc01bef,
that initially added the preliminary infrastructure.
I decided to partially revert this patch because the approach
that I proposed to resolve this problem is broken in NAT setups.
Moreover, a new infrastructure will be submitted for the 3.3.x
development cycle that resolve the existing issues while
providing a neat solution.
Since nobody has been seriously using this infrastructure in
user-space, the removal of this feature should affect any know
FOSS project (to my knowledge).
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Stephen Rothwell [Wed, 11 Jan 2012 00:52:17 +0000 (11:52 +1100)]
netfilter: xt_hashlimit: fix unused variable warning if IPv6 disabled
Fixes this warning when CONFIG_IP6_NF_IPTABLES is not enabled:
net/netfilter/xt_hashlimit.c: In function ‘hashlimit_init_dst’:
net/netfilter/xt_hashlimit.c:448:9: warning: unused variable ‘frag_off’ [-Wunused-variable]
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Johannes Berg [Fri, 13 Jan 2012 13:17:59 +0000 (14:17 +0100)]
mac80211: fix no-op authorized transitions
When userspace attempts to authorize a station
that is already authorized, nothing happens as
you'd expect. Similarly, when it unauthorizes
a station that is associated, nothing happens.
However, when it unauthorizes a station that
isn't even associated yet, we erroneously try
to move the station to associated. This seems
to happen occasionally as a result of a race
when wpa_supplicant attempts to unauthorize
the port in managed mode. Particularly with my
new patches to keep stations, it can then move
a station into ASSOCIATED state before we have
really associated, which is really confusing.
I introduced this bug in
"mac80211: refactor station state transitions"
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Same devices can generate interrupt without properly setting bit in
INT_SOURCE_CSR register (spurious interrupt), what will cause IRQ line
will be disabled by interrupts controller driver.
We discovered that clearing INT_MASK_CSR stops such behaviour. We
previously first read that register, and then clear all know interrupt
sources bits and do not touch reserved bits. After this patch, we write
to all register content (I believe writing to reserved bits on that
register will not cause any problems, I tested that on my rt2800pci
device).
This fix very bad performance problem, practically making device
unusable (since worked without interrupts), reported in:
https://bugzilla.redhat.com/show_bug.cgi?id=658451
Reported-and-tested-by: Amir Hedayaty <hedayaty@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Dan Carpenter [Thu, 12 Jan 2012 06:34:50 +0000 (09:34 +0300)]
ipw2x00: signedness bug handling frame length
This is basically just a cleanup. Large positive numbers get counted as
negative but then get implicitly cast to positive again for the checks
that matter.
This does make a small difference in ipw_handle_promiscuous_rx() when we
test "if (unlikely((len + IPW_RX_FRAME_SIZE) > skb_tailroom(rxb->skb)))"
It should return there, but we don't return until a couple lines later
when we test "if (len > IPW_RX_BUF_SIZE - sizeof(struct ipw_rt_hdr)) {".
The difference is that in the second test the sizeof() means that there
is an implied cast to unsigned.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
By adding some module aliases, programs (or users) won't have to explicitly
call modprobe. Vhost-net will always be available if built into the kernel.
It does require assigning a permanent minor number for depmod to work.
Also:
- use C99 style initialization.
- add missing entry in documentation for loop-control
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Acked-By: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: David S. Miller <davem@davemloft.net>
RongQing.Li [Thu, 12 Jan 2012 22:33:46 +0000 (22:33 +0000)]
ipv6: release idev when ip6_neigh_lookup failed in icmp6_dst_alloc
release idev when ip6_neigh_lookup failed in icmp6_dst_alloc
Signed-off-by: RongQing.Li <roy.qing.li@gmail.com> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Linus Torvalds [Fri, 13 Jan 2012 04:42:54 +0000 (20:42 -0800)]
Merge branch 'akpm' (aka "Andrew's patch-bomb, take two")
Andrew explains:
- various misc stuff
- Most of the rest of MM: memcg, threaded hugepages, others.
- cpumask
- kexec
- kdump
- some direct-io performance tweaking
- radix-tree optimisations
- new selftests code
A note on this: often people will develop a new userspace-visible
feature and will develop userspace code to exercise/test that
feature. Then they merge the patch and the selftest code dies.
Sometimes we paste it into the changelog. Sometimes the code gets
thrown into Documentation/(!).
This saddens me. So this patch creates a bare-bones framework which
will henceforth allow me to ask people to include their test apps in
the kernel tree so we can keep them alive. Then when people enhance
or fix the feature, I can ask them to update the test app too.
The infrastruture is terribly trivial at present - let's see how it
evolves.
- checkpoint/restart feature work.
A note on this: this is a project by various mad Russians to perform
c/r mainly from userspace, with various oddball helper code added
into the kernel where the need is demonstrated.
So rather than some large central lump of code, what we have is
little bits and pieces popping up in various places which either
expose something new or which permit something which is normally
kernel-private to be modified.
The overall project is an ongoing thing. I've judged that the size
and scope of the thing means that we're more likely to be successful
with it if we integrate the support into mainline piecemeal rather
than allowing it all to develop out-of-tree.
However I'm less confident than the developers that it will all
eventually work! So what I'm asking them to do is to wrap each piece
of new code inside CONFIG_CHECKPOINT_RESTORE. So if it all
eventually comes to tears and the project as a whole fails, it should
be a simple matter to go through and delete all trace of it.
This lot pretty much wraps up the -rc1 merge for me.
* akpm: (96 commits)
unlzo: fix input buffer free
ramoops: update parameters only after successful init
ramoops: fix use of rounddown_pow_of_two()
c/r: prctl: add PR_SET_MM codes to set up mm_struct entries
c/r: procfs: add start_data, end_data, start_brk members to /proc/$pid/stat v4
c/r: introduce CHECKPOINT_RESTORE symbol
selftests: new x86 breakpoints selftest
selftests: new very basic kernel selftests directory
radix_tree: take radix_tree_path off stack
radix_tree: remove radix_tree_indirect_to_ptr()
dio: optimize cache misses in the submission path
vfs: cache request_queue in struct block_device
fs/direct-io.c: calculate fs_count correctly in get_more_blocks()
drivers/parport/parport_pc.c: fix warnings
panic: don't print redundant backtraces on oops
sysctl: add the kernel.ns_last_pid control
kdump: add udev events for memory online/offline
include/linux/crash_dump.h needs elf.h
kdump: fix crash_kexec()/smp_send_stop() race in panic()
kdump: crashk_res init check for /sys/kernel/kexec_crash_size
...
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (69 commits)
pptp: Accept packet with seq zero
RDS: Remove some unused iWARP code
net: fsl: fec: handle 10Mbps speed in RMII mode
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c: add missing iounmap
drivers/net/ethernet/tundra/tsi108_eth.c: add missing iounmap
ksz884x: fix mtu for VLAN
net_sched: sfq: add optional RED on top of SFQ
dp83640: Fix NOHZ local_softirq_pending 08 warning
gianfar: Fix invalid TX frames returned on error queue when time stamping
gianfar: Fix missing sock reference when processing TX time stamps
phylib: introduce mdiobus_alloc_size()
net: decrement memcg jump label when limit, not usage, is changed
net: reintroduce missing rcu_assign_pointer() calls
inet_diag: Rename inet_diag_req_compat into inet_diag_req
inet_diag: Rename inet_diag_req into inet_diag_req_v2
bond_alb: don't disable softirq under bond_alb_xmit
mac80211: fix rx->key NULL pointer dereference in promiscuous mode
nl80211: fix old station flags compatibility
mdio-octeon: use an unique MDIO bus name.
mdio-gpio: use an unique MDIO bus name.
...
Kees Cook [Fri, 13 Jan 2012 01:20:59 +0000 (17:20 -0800)]
ramoops: update parameters only after successful init
If a platform device exists on the system, but ramoops fails to attach to
it, the module parameters are overridden before ramoops can fall back and
try to use passed module parameters. Move update to end of init routine.
Marco Stornelli [Fri, 13 Jan 2012 01:20:58 +0000 (17:20 -0800)]
ramoops: fix use of rounddown_pow_of_two()
The return value of rounddown_pow_of_two wasn't evaluated, so the
operation was a no-op.
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com> Reported-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cyrill Gorcunov [Fri, 13 Jan 2012 01:20:55 +0000 (17:20 -0800)]
c/r: prctl: add PR_SET_MM codes to set up mm_struct entries
When we restore a task we need to set up text, data and data heap sizes
from userspace to the values a task had at checkpoint time. This patch
adds auxilary prctl codes for that.
While most of them have a statistical nature (their values are involved
into calculation of /proc/<pid>/statm output) the start_brk and brk values
are used to compute an allowed size of program data segment expansion.
Which means an arbitrary changes of this values might be dangerous
operation. So to restrict access the following requirements applied to
prctl calls:
- The process has to have CAP_SYS_ADMIN capability granted.
- For all opcodes except start_brk/brk members an appropriate
VMA area must exist and should fit certain VMA flags,
such as:
- code segment must be executable but not writable;
- data segment must not be executable.
start_brk/brk values must not intersect with data segment and must not
exceed RLIMIT_DATA resource limit.
Still the main guard is CAP_SYS_ADMIN capability check.
Note the kernel should be compiled with CONFIG_CHECKPOINT_RESTORE support
otherwise these prctl calls will return -EINVAL.
[akpm@linux-foundation.org: cache current->mm in a local, saving 200 bytes text] Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Reviewed-by: Kees Cook <keescook@chromium.org> Cc: Tejun Heo <tj@kernel.org> Cc: Andrew Vagin <avagin@openvz.org> Cc: Serge Hallyn <serge.hallyn@canonical.com> Cc: Pavel Emelyanov <xemul@parallels.com> Cc: Vasiliy Kulikov <segoon@openwall.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cyrill Gorcunov [Fri, 13 Jan 2012 01:20:53 +0000 (17:20 -0800)]
c/r: procfs: add start_data, end_data, start_brk members to /proc/$pid/stat v4
The mm->start_code/end_code, mm->start_data/end_data, mm->start_brk are
involved into calculation of program text/data segment sizes (which might
be seen in /proc/<pid>/statm) and into brk() call final address.
For restore we need to know all these values. While
mm->start_code/end_code already present in /proc/$pid/stat, the rest
members are not, so this patch brings them in.
The restore procedure of these members is addressed in another patch using
prctl().