3.4.29-stable review
Subsystems (23)
Greg Kroah-Hartman
maintainercover 3.4.29-stable review
This is the start of the stable review cycle for the 3.4.29 release. There are 33 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun Feb 3 10:47:08 UTC 2013. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.4.29-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 3.4.29-rc1
Nicholas Bellinger <[email protected]>
target: fix regression with dev_link_magic in target_fabric_port_link
H. Peter Anvin <[email protected]>
x86/Sandy Bridge: Sandy Bridge workaround depends on CONFIG_PCI
Matt Fleming <[email protected]>
x86, efi: Set runtime_version to the EFI spec revision
Nathan Zimmer <[email protected]>
efi, x86: Pass a proper identity mapping in efi_call_phys_prelog
Alan Cox <[email protected]>
x86/msr: Add capabilities check
Wang YanQing <[email protected]>
smp: Fix SMP function call empty cpu mask race
Trond Myklebust <[email protected]>
NFS: Don't silently fail setattr() requests on mountpoints
Stanislaw Gruszka <[email protected]>
mac80211: synchronize scan off/on-channel and PS states
Daniel Vetter <[email protected]>
iommu/intel: disable DMAR for g4x integrated gfx
Anderson Lizardo <[email protected]>
Bluetooth: Fix incorrect strncpy() in hidp_setup_hid()
Chris Rattray <[email protected]>
ASoC: wm2200: correct mixer values and text
Dan Carpenter <[email protected]>
EDAC: Test correct variable in ->store function
Takashi Iwai <[email protected]>
ALSA: hda - Add a fixup for Packard-Bell desktop with ALC880
Clemens Ladisch <[email protected]>
ALSA: usb-audio: fix invalid length check for RME and other UAC 2 devices
Felix Fietkau <[email protected]>
ath9k: fix double-free bug on beacon generate failure
Felix Fietkau <[email protected]>
ath9k: do not link receive buffers during flush
Sujith Manoharan <[email protected]>
ath9k_htc: Fix memory leak
Johannes Berg <[email protected]>
mac80211: fix FT roaming
Piotr Haber <[email protected]>
brcmsmac: increase timer reference count for new timers only
Stanislaw Gruszka <[email protected]>
iwlegacy: fix IBSS cleanup
Avinash Patil <[email protected]>
mwifiex: fix typo in PCIe adapter NULL check
Jan Kara <[email protected]>
xfs: Fix possible use-after-free with AIO
Suravee Suthikulpanit <[email protected]>
IOMMU, AMD Family15h Model10-1Fh erratum 746 Workaround
xueminsu <[email protected]>
radeon_display: Use pointer return error codes
Jerome Glisse <[email protected]>
drm/radeon: fix cursor corruption on DCE6 and newer
Szymon Janc <[email protected]>
Bluetooth: Fix sending HCI commands after reset
Stephen Boyd <[email protected]>
ARM: 7627/1: Predicate preempt logic on PREEMP_COUNT not PREEMPT alone
Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
ARM: at91: rm9200: remake the BGA as default version
Russell King <[email protected]>
ARM: DMA: Fix struct page iterator in dma_cache_maint() to work with sparsemem
Cong Ding <[email protected]>
fs/cifs/cifs_dfs_ref.c: fix potential memory leakage
Olivier Sobrie <[email protected]>
can: pch_can: fix invalid error codes
Olivier Sobrie <[email protected]>
can: ti_hecc: fix invalid error codes
Olivier Sobrie <[email protected]>
can: c_can: fix invalid error codes
-------------
Diffstat:
Makefile | 4 +-- arch/arm/mach-at91/setup.c | 2 ++ arch/arm/mm/dma-mapping.c | 18 ++++++----- arch/arm/vfp/entry.S | 6 ++-- arch/arm/vfp/vfphw.S | 4 +-- arch/x86/kernel/msr.c | 3 ++ arch/x86/kernel/setup.c | 2 ++ arch/x86/platform/efi/efi.c | 2 +- arch/x86/platform/efi/efi_64.c | 22 ++++++++++---- drivers/edac/edac_pci_sysfs.c | 2 +- drivers/gpu/drm/radeon/radeon_cursor.c | 3 +- drivers/gpu/drm/radeon/radeon_display.c | 2 +- drivers/iommu/amd_iommu_init.c | 34 +++++++++++++++++++++ drivers/iommu/intel-iommu.c | 21 +++++++++---- drivers/net/can/c_can/c_can.c | 4 +-- drivers/net/can/pch_can.c | 2 +- drivers/net/can/ti_hecc.c | 4 +-- drivers/net/wireless/ath/ath9k/beacon.c | 1 + drivers/net/wireless/ath/ath9k/htc_hst.c | 2 ++ drivers/net/wireless/ath/ath9k/recv.c | 10 ++++--- .../net/wireless/brcm80211/brcmsmac/mac80211_if.c | 7 +++-- drivers/net/wireless/iwlegacy/common.c | 35 +++++++++------------- drivers/net/wireless/mwifiex/pcie.c | 2 +- drivers/target/target_core_fabric_configfs.c | 11 ++++--- fs/cifs/cifs_dfs_ref.c | 2 ++ fs/nfs/namespace.c | 20 +++++++++++++ fs/xfs/xfs_aops.c | 2 +- kernel/smp.c | 13 +++++++- net/bluetooth/hci_event.c | 2 +- net/bluetooth/hidp/core.c | 2 +- net/mac80211/cfg.c | 12 +++++++- net/mac80211/ieee80211_i.h | 6 ++-- net/mac80211/offchannel.c | 17 ++++------- net/mac80211/scan.c | 15 ++++------ net/mac80211/work.c | 4 +-- sound/pci/hda/patch_realtek.c | 1 + sound/soc/codecs/wm2200.c | 3 -- sound/usb/mixer.c | 17 +++++++---- 38 files changed, 209 insertions(+), 110 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/33 can: c_can: fix invalid error codes
3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Olivier Sobrie <[email protected]>
commit 6ea45886865c1abb01bb861f7f6bdd5d0f398cb3 upstream.
Errors in CAN protocol (location) are reported in data[3] of the can frame instead of data[2].
--- drivers/net/can/c_can/c_can.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/can/c_can/c_can.c +2 -2
@@ -914,7 +914,7 @@ static int c_can_handle_bus_err(struct nbreak ;case LEC_ACK_ERROR :netdev_dbg (dev,"ack error\n" ); - cf->data[2 ] |= (CAN_ERR_PROT_LOC_ACK | + cf->data[3 ] |= (CAN_ERR_PROT_LOC_ACK |CAN_ERR_PROT_LOC_ACK_DEL );break ;case LEC_BIT1_ERROR :
@@ -927,7 +927,7 @@ static int c_can_handle_bus_err(struct nbreak ;case LEC_CRC_ERROR :netdev_dbg (dev,"CRC error\n" ); - cf->data[2 ] |= (CAN_ERR_PROT_LOC_CRC_SEQ | + cf->data[3 ] |= (CAN_ERR_PROT_LOC_CRC_SEQ |CAN_ERR_PROT_LOC_CRC_DEL );break ;default :
Greg Kroah-Hartman
maintainerPATCH 2/33 can: ti_hecc: fix invalid error codes
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Olivier Sobrie <[email protected]>
commit 71088c4bd9b8f8cbffb0e66f2abc14297e4b2ca8 upstream.
Errors in CAN protocol (location) are reported in data[3] of the can frame instead of data[2].
--- drivers/net/can/ti_hecc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/can/ti_hecc.c +2 -2
@@ -746,12 +746,12 @@ static int ti_hecc_error(struct net_devi }if (err_status &HECC_CANES_CRCE ) {hecc_set_bit (priv,HECC_CANES ,HECC_CANES_CRCE ); - cf->data[2 ] |=CAN_ERR_PROT_LOC_CRC_SEQ | + cf->data[3 ] |=CAN_ERR_PROT_LOC_CRC_SEQ |CAN_ERR_PROT_LOC_CRC_DEL ; }if (err_status &HECC_CANES_ACKE ) {hecc_set_bit (priv,HECC_CANES ,HECC_CANES_ACKE ); - cf->data[2 ] |=CAN_ERR_PROT_LOC_ACK | + cf->data[3 ] |=CAN_ERR_PROT_LOC_ACK |CAN_ERR_PROT_LOC_ACK_DEL ; } }
Greg Kroah-Hartman
maintainerPATCH 3/33 can: pch_can: fix invalid error codes
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Olivier Sobrie <[email protected]>
commit ee50e135aeb048b90fab662e661c58b67341830b upstream.
Errors in CAN protocol (location) are reported in data[3] of the can frame instead of data[2].
--- drivers/net/can/pch_can.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/pch_can.c +1 -1
@@ -560,7 +560,7 @@ static void pch_can_error(struct net_dev stats->rx_errors++;break ;case PCH_CRC_ERR : - cf->data[2 ] |=CAN_ERR_PROT_LOC_CRC_SEQ | + cf->data[3 ] |=CAN_ERR_PROT_LOC_CRC_SEQ |CAN_ERR_PROT_LOC_CRC_DEL ; priv->can.can_stats.bus_error++; stats->rx_errors++;
Greg Kroah-Hartman
maintainerPATCH 4/33 fs/cifs/cifs_dfs_ref.c: fix potential memory leakage
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cong Ding <[email protected]>
commit 10b8c7dff5d3633b69e77f57d404dab54ead3787 upstream.
When it goes to error through line 144, the memory allocated to *devname is not freed, and the caller doesn't free it either in line 250. So we free the memroy of *devname in function cifs_compose_mount_options() when it goes to error.
--- fs/cifs/cifs_dfs_ref.c | 2 ++ 1 file changed, 2 insertions(+)
fs/cifs/cifs_dfs_ref.c +2 -0
@@ -226,6 +226,8 @@ compose_mount_options_out: compose_mount_options_err:kfree (mountdata); mountdata =ERR_PTR (rc); +kfree (*devname); + *devname =NULL ; goto compose_mount_options_out; }
Greg Kroah-Hartman
maintainerPATCH 5/33 ARM: DMA: Fix struct page iterator in dma_cache_maint() to work with sparsemem
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Russell King <[email protected]>
commit 15653371c67c3fbe359ae37b720639dd4c7b42c5 upstream.
Subhash Jadavani reported this partial backtrace:
Now consider this call stack from MMC block driver (this is on the ARMv7 based board):
[<c001b50c>] (v7_dma_inv_range+0x30/0x48) from [<c0017b8c>] (dma_cache_maint_page+0x1c4/0x24c) [<c0017b8c>] (dma_cache_maint_page+0x1c4/0x24c) from [<c0017c28>] (___dma_page_cpu_to_dev+0x14/0x1c) [<c0017c28>] (___dma_page_cpu_to_dev+0x14/0x1c) from [<c0017ff8>] (dma_map_sg+0x3c/0x114)
This is caused by incrementing the struct page pointer, and running off the end of the sparsemem page array. Fix this by incrementing by pfn instead, and convert the pfn to a struct page.
--- arch/arm/mm/dma-mapping.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
arch/arm/mm/dma-mapping.c +10 -8
@@ -503,25 +503,27 @@ static void dma_cache_maint_page(struct size_t size, enum dma_data_direction dir, void (*op)(const void *, size_t, int)) { + unsigned long pfn; +size_t left = size; + + pfn =page_to_pfn (page) + offset /PAGE_SIZE ; + offset %=PAGE_SIZE ; +/* * A single sg entry may refer to multiple physically contiguous * pages. But we still need to process highmem pages individually. * If highmem is not configured then the bulk of this loop gets * optimized out. */ -size_t left = size; do { size_t len = left; void *vaddr; + page = pfn_to_page(pfn); + if (PageHighMem(page)) { - if (len + offset > PAGE_SIZE) { - if (offset >= PAGE_SIZE) { - page += offset / PAGE_SIZE; - offset %= PAGE_SIZE; - } + if (len + offset > PAGE_SIZE) len = PAGE_SIZE - offset; - } vaddr = kmap_high_get(page); if (vaddr) { vaddr += offset;
@@ -538,7 +540,7 @@ static void dma_cache_maint_page(structop (vaddr, len, dir); } offset =0 ; - page++; + pfn++; left -= len; }while (left); }
Greg Kroah-Hartman
maintainerPATCH 6/33 ARM: at91: rm9200: remake the BGA as default version
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
commit 36224d0fe0f34cdde66a381708853ebadeac799c upstream.
Make BGA as the default version as we are supposed to just have to specify when we use the PQFP version.
Issue was existing since commit:
3e90772 (ARM: at91: fix at91rm9200 soc subtype handling).
--- arch/arm/mach-at91/setup.c | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/mach-at91/setup.c +2 -0
@@ -104,6 +104,8 @@ static void __init soc_detect(u32 dbgu_bswitch (socid) {case ARCH_ID_AT91RM9200 : at91_soc_initdata.type =AT91_SOC_RM9200 ; +if (at91_soc_initdata.subtype ==AT91_SOC_SUBTYPE_NONE ) + at91_soc_initdata.subtype =AT91_SOC_RM9200_BGA ; at91_boot_soc = at91rm9200_soc;break ;
Greg Kroah-Hartman
maintainerPATCH 7/33 ARM: 7627/1: Predicate preempt logic on PREEMP_COUNT not PREEMPT alone
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Boyd <[email protected]>
commit 568dca15aa2a0f4ddee255894ec393a159f13147 upstream.
Patrik Kluba reports that the preempt count becomes invalid due to the preempt_enable() call being unbalanced with a preempt_disable() call in the vfp assembly routines. This happens because preempt_enable() and preempt_disable() update preempt counts under PREEMPT_COUNT=y but the vfp assembly routines do so under PREEMPT=y. In a configuration where PREEMPT=n and DEBUG_ATOMIC_SLEEP=y, PREEMPT_COUNT=y and so the preempt_enable() call in VFP_bounce() keeps subtracting from the preempt count until it goes negative.
Fix this by always using PREEMPT_COUNT to decided when to update preempt counts in the ARM assembly code.
--- arch/arm/vfp/entry.S | 6 +++--- arch/arm/vfp/vfphw.S | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/vfp/entry.S +3 -3
@@ -22,7 +22,7 @@ @ IRQs disabled. @ ENTRY(do_vfp) -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPT_COUNT ldr r4, [r10, #TI_PREEMPT] @ get preempt count add r11, r4, #1 @ increment it str r11, [r10, #TI_PREEMPT]
@@ -35,7 +35,7 @@ ENTRY(do_vfp) ENDPROC(do_vfp) ENTRY(vfp_null_entry) -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPT_COUNT get_thread_info r10 ldr r4, [r10, #TI_PREEMPT] @ get preempt count sub r11, r4, #1 @ decrement it
@@ -53,7 +53,7 @@ ENDPROC(vfp_null_entry) __INIT ENTRY(vfp_testing_entry) -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPT_COUNT get_thread_info r10 ldr r4, [r10, #TI_PREEMPT] @ get preempt count sub r11, r4, #1 @ decrement it
arch/arm/vfp/vfphw.S +2 -2
@@ -167,7 +167,7 @@ vfp_hw_state_valid: @ else it's one 32-bit instruction, so @ always subtract 4 from the following @ instruction address. -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPT_COUNT get_thread_info r10 ldr r4, [r10, #TI_PREEMPT] @ get preempt count sub r11, r4, #1 @ decrement it
@@ -191,7 +191,7 @@ look_for_VFP_exceptions: @ not recognised by VFP DBGSTR "not VFP" -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPT_COUNT get_thread_info r10 ldr r4, [r10, #TI_PREEMPT] @ get preempt count sub r11, r4, #1 @ decrement it
Greg Kroah-Hartman
maintainerPATCH 8/33 Bluetooth: Fix sending HCI commands after reset
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Szymon Janc <[email protected]>
commit dbccd791a3fbbdac12c33834b73beff3984988e9 upstream.
After sending reset command wait for its command complete event before sending next command. Some chips sends CC event for command received before reset if reset was send before chip replied with CC.
This is also required by specification that host shall not send additional HCI commands before receiving CC for reset.
< HCI Command: Reset (0x03|0x0003) plen 0 [hci0] 18.404612
Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 4 [hci0] 18.405850
Write Extended Inquiry Response (0x03|0x0052) ncmd 1
Status: Success (0x00)< HCI Command: Read Local Supported Features (0x04|0x0003) plen 0 [hci0] 18.406079
Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 4 [hci0] 18.407864
Reset (0x03|0x0003) ncmd 1
Status: Success (0x00)< HCI Command: Read Local Supported Features (0x04|0x0003) plen 0 [hci0] 18.408062
Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 12 [hci0] 18.408835
--- net/bluetooth/hci_event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/hci_event.c +1 -1
@@ -2366,7 +2366,7 @@ static inline void hci_cmd_complete_evt(if (ev->opcode !=HCI_OP_NOP )del_timer (&hdev->cmd_timer); -if (ev->ncmd) { +if (ev->ncmd && !test_bit (HCI_RESET , &hdev->flags)) {atomic_set (&hdev->cmd_cnt,1 );if (!skb_queue_empty (&hdev->cmd_q))queue_work (hdev->workqueue, &hdev->cmd_work);
Greg Kroah-Hartman
maintainerPATCH 9/33 drm/radeon: fix cursor corruption on DCE6 and newer
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jerome Glisse <[email protected]>
commit e521a29014794d139cca46396d1af8faf1295a26 upstream.
Aruba and newer gpu does not need the avivo cursor work around, quite the opposite this work around lead to corruption.
agd5f: check DCE6 rather than ARUBA since the issue is DCE version specific rather than family specific.
--- drivers/gpu/drm/radeon/radeon_cursor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_cursor.c +2 -1
@@ -238,7 +238,8 @@ int radeon_crtc_cursor_move(struct drm_c y =0 ; } -if (ASIC_IS_AVIVO (rdev)) { +/* fixed on DCE6 and newer */ +if (ASIC_IS_AVIVO (rdev) && !ASIC_IS_DCE6 (rdev)) {int i =0 ;struct drm_crtc *crtc_p;
Greg Kroah-Hartman
maintainerPATCH 10/33 radeon_display: Use pointer return error codes
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: xueminsu <[email protected]>
commit b2f4b03f8a378cd626d2ea67d19e7470c050a098 upstream.
drm_mode_addfb() expects fb_create return error code instead of NULL.
--- drivers/gpu/drm/radeon/radeon_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_display.c +1 -1
@@ -1136,7 +1136,7 @@ radeon_user_framebuffer_create(struct drif (ret) {kfree (radeon_fb);drm_gem_object_unreference_unlocked (obj); -return NULL ; +return ERR_PTR (ret); }return &radeon_fb->base;
Greg Kroah-Hartman
maintainerPATCH 11/33 IOMMU, AMD Family15h Model10-1Fh erratum 746 Workaround
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Suravee Suthikulpanit <[email protected]>
commit 318fe782539c4150d1b8e4e6c9dc3a896512cb8a upstream.
The IOMMU may stop processing page translations due to a perceived lack of credits for writing upstream peripheral page service request (PPR) or event logs. If the L2B miscellaneous clock gating feature is enabled the IOMMU does not properly register credits after the log request has completed, leading to a potential system hang.
BIOSes are supposed to disable L2B micellaneous clock gating by setting L2_L2B_CK_GATE_CONTROL[CKGateL2BMiscDisable](D0F2xF4_x90[2]) = 1b. This patch corrects that for those which do not enable this workaround.
--- drivers/iommu/amd_iommu_init.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)
drivers/iommu/amd_iommu_init.c +34 -0
@@ -1002,6 +1002,38 @@ static void __init free_iommu_all(void) }/* +* Family15h Model 10h-1fh erratum 746 (IOMMU Logging May Stall Translations) +* Workaround: +* BIOS should disable L2B micellaneous clock gating by setting +* L2_L2B_CK_GATE_CONTROL[CKGateL2BMiscDisable](D0F2xF4_x90[2]) = 1b +*/ +static void __init amd_iommu_erratum_746_workaround (struct amd_iommu *iommu) +{ +u32 value; + +if ((boot_cpu_data.x86 !=0x15 ) || + (boot_cpu_data.x86_model <0x10 ) || + (boot_cpu_data.x86_model >0x1f )) +return ; + +pci_write_config_dword (iommu->dev,0xf0 ,0x90 ); +pci_read_config_dword (iommu->dev,0xf4 , &value); + +if (value &BIT (2 )) +return ; + +/* Select NB indirect register 0x90 and enable writing */ +pci_write_config_dword (iommu->dev,0xf0 ,0x90 | (1 <<8 )); + +pci_write_config_dword (iommu->dev,0xf4 , value |0x4 ); +pr_info ("AMD-Vi: Applying erratum 746 workaround for IOMMU at %s\n" , +dev_name (&iommu->dev->dev)); + +/* Clear the enable writing bit */ +pci_write_config_dword (iommu->dev,0xf0 ,0x90 ); +} + +/* * This function clues the initialization function for one IOMMU * together and also allocates the command buffer and programs the * hardware. It does NOT enable the IOMMU. This is done afterwards.
@@ -1062,6 +1094,8 @@ static int __init init_iommu_one(structif (iommu->cap & (1UL <<IOMMU_CAP_NPCACHE )) amd_iommu_np_cache = true; +amd_iommu_erratum_746_workaround (iommu); +return pci_enable_device (iommu->dev); }
Greg Kroah-Hartman
maintainerPATCH 12/33 xfs: Fix possible use-after-free with AIO
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <[email protected]>
commit 4b05d09c18d9aa62d2e7fb4b057f54e5a38963f5 upstream.
Running AIO is pinning inode in memory using file reference. Once AIO is completed using aio_complete(), file reference is put and inode can be freed from memory. So we have to be sure that calling aio_complete() is the last thing we do with the inode.
--- fs/xfs/xfs_aops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_aops.c +1 -1
@@ -89,11 +89,11 @@ xfs_destroy_ioend( }if (ioend->io_iocb) { +inode_dio_done (ioend->io_inode);if (ioend->io_isasync) {aio_complete (ioend->io_iocb, ioend->io_error ? ioend->io_error : ioend->io_result,0 ); } -inode_dio_done (ioend->io_inode); }mempool_free (ioend, xfs_ioend_pool);
Greg Kroah-Hartman
maintainerPATCH 13/33 mwifiex: fix typo in PCIe adapter NULL check
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avinash Patil <[email protected]>
commit 83f0c6d1f502bd75bb4a9e31e8d64e59c6894ad1 upstream.
Add missing "!" as we are supposed to check "!card->adapter" in PCIe suspend handler.
--- drivers/net/wireless/mwifiex/pcie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mwifiex/pcie.c +1 -1
@@ -158,7 +158,7 @@ static int mwifiex_pcie_suspend(struct pif (pdev) { card = (struct pcie_service_card *)pci_get_drvdata (pdev); -if (!card || card->adapter) { +if (!card || !card->adapter) {pr_err ("Card or adapter structure is not valid\n" );return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 14/33 iwlegacy: fix IBSS cleanup
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanislaw Gruszka <[email protected]>
commit fa4cffcba9e13798ed7c6b8526b91b1631ecb53e upstream.
We do not correctly change interface type when switching from IBSS mode to STA mode, that results in microcode errors.
Resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=886946
--- drivers/net/wireless/iwlegacy/common.c | 35 +++++++++++++-------------------- 1 file changed, 14 insertions(+), 21 deletions(-)
drivers/net/wireless/iwlegacy/common.c +14 -21
@@ -3957,17 +3957,21 @@ il_connection_init_rx_config(struct il_pmemset (&il->staging,0 ,sizeof (il->staging)); -if (!il->vif) { +switch (il->iw_mode) { +case NL80211_IFTYPE_UNSPECIFIED : il->staging.dev_type =RXON_DEV_TYPE_ESS ; - }else if (il->vif->type ==NL80211_IFTYPE_STATION ) { +break ; +case NL80211_IFTYPE_STATION : il->staging.dev_type =RXON_DEV_TYPE_ESS ; il->staging.filter_flags =RXON_FILTER_ACCEPT_GRP_MSK ; - }else if (il->vif->type ==NL80211_IFTYPE_ADHOC ) { +break ; +case NL80211_IFTYPE_ADHOC : il->staging.dev_type =RXON_DEV_TYPE_IBSS ; il->staging.flags =RXON_FLG_SHORT_PREAMBLE_MSK ; il->staging.filter_flags =RXON_FILTER_BCON_AWARE_MSK |RXON_FILTER_ACCEPT_GRP_MSK ; - }else { +break ; +default :IL_ERR ("Unsupported interface type %d\n" , il->vif->type);return ; }
@@ -4550,8 +4554,7 @@ out:EXPORT_SYMBOL (il_mac_add_interface);static void -il_teardown_interface (struct il_priv *il,struct ieee80211_vif *vif, -bool mode_change) +il_teardown_interface (struct il_priv *il,struct ieee80211_vif *vif) {lockdep_assert_held (&il->mutex);
@@ -4560,9 +4563,7 @@ il_teardown_interface(struct il_priv *ilil_force_scan_end (il); } -if (!mode_change) -il_set_mode (il); - +il_set_mode (il); }void
@@ -4575,8 +4576,8 @@ il_mac_remove_interface(struct ieee80211WARN_ON (il->vif != vif); il->vif =NULL ; - -il_teardown_interface (il, vif, false); + il->iw_mode =NL80211_IFTYPE_UNSPECIFIED ; +il_teardown_interface (il, vif);memset (il->bssid,0 ,ETH_ALEN );D_MAC80211 ("leave\n" );
@@ -4685,18 +4686,10 @@ il_mac_change_interface(struct ieee80211 }/* success */ -il_teardown_interface (il, vif, true); vif->type = newtype; vif->p2p = false; - err =il_set_mode (il); -WARN_ON (err); -/* -* We've switched internally, but submitting to the -* device may have failed for some reason. Mask this -* error, because otherwise mac80211 will not switch -* (and set the interface type back) and we'll be -* out of sync with it. -*/ + il->iw_mode = newtype; +il_teardown_interface (il, vif); err =0 ; out:
Re: [ 14/33] iwlegacy: fix IBSS cleanup
Quoted 11 lines · Greg Kroah-Hartman
3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanislaw Gruszka <[email protected]>
commit
fa4cffcba9e13798ed7c6b8526b91b1631ecb53eupstream.We do not correctly change interface type when switching from IBSS mode to STA mode, that results in microcode errors.
Quoted 7 lines
Resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=886946Reported-by Jaroslav Skarvada <[email protected]>Signed-off-by Stanislaw Gruszka <[email protected]>Signed-off-by John W. Linville <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
[...]
This one didn't apply to 3.2 or presumably to 3.0. Do they have the bug and if so could you provide a backport?
Ben.
Signature · 3 lines
Ben Hutchings
Everything should be made as simple as possible, but not simpler.
- Albert EinsteinRe: [ 14/33] iwlegacy: fix IBSS cleanup
Quoted 15 lines · Ben Hutchings
Quoted 14 lines · Greg Kroah-Hartman
3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanislaw Gruszka <[email protected]>
commit
fa4cffcba9e13798ed7c6b8526b91b1631ecb53eupstream.We do not correctly change interface type when switching from IBSS mode to STA mode, that results in microcode errors.
Quoted 8 lines
Quoted 4 lines
Reported-by Jaroslav Skarvada <[email protected]>Signed-off-by Stanislaw Gruszka <[email protected]>Signed-off-by John W. Linville <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>[...]
This one didn't apply to 3.2 or presumably to 3.0. Do they have the bug and if so could you provide a backport?
They have the bug, but backport is not simple and require testing. I prefer to not do it. We have workaround for the bug - reload module after disconnecting from IBSS network.
Stanislaw
Greg Kroah-Hartman
maintainerPATCH 15/33 brcmsmac: increase timer reference count for new timers only
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Piotr Haber <[email protected]>
commit a1fe52801a992e590cdaee2fb47a94bac9b5da90 upstream.
On hardware reintialization reference count of already existing timers would be increased again. This leads to problems on module unloading.
--- drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +4 -3
@@ -1400,9 +1400,10 @@ void brcms_add_timer(struct brcms_timer#endif t->ms = ms; t->periodic = (bool ) periodic; - t->set = true; - -atomic_inc (&t->wl->callbacks); +if (!t->set) { + t->set = true; +atomic_inc (&t->wl->callbacks); + }ieee80211_queue_delayed_work (hw, &t->dly_wrk,msecs_to_jiffies (ms)); }
Greg Kroah-Hartman
maintainerPATCH 16/33 mac80211: fix FT roaming
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
commit 1626e0fa740dec8665a973cf2349405cdfeb46dc upstream.
During FT roaming, wpa_supplicant attempts to set the key before association. This used to be rejected, but as a side effect of my commit 66e67e418908442389d3a9e ("mac80211: redesign auth/assoc") the key was accepted causing hardware crypto to not be used for it as the station isn't added to the driver yet.
It would be possible to accept the key and then add it to the driver when the station has been added. However, this may run into issues with drivers using the state- based station adding if they accept the key only after association like it used to be.
For now, revert to the behaviour from before the auth and assoc change.
--- net/mac80211/cfg.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
net/mac80211/cfg.c +11 -1
@@ -151,7 +151,17 @@ static int ieee80211_add_key(struct wiph sta =sta_info_get (sdata, mac_addr); else sta =sta_info_get_bss (sdata, mac_addr); -if (!sta) { +/* +* The ASSOC test makes sure the driver is ready to +* receive the key. When wpa_supplicant has roamed +* using FT, it attempts to set the key before +* association has completed, this rejects that attempt +* so it will set the key again after assocation. +* +* TODO: accept the key if we have a station entry and +* add it to the device after the station. +*/ +if (!sta || !test_sta_flag (sta,WLAN_STA_ASSOC )) {ieee80211_key_free (sdata->local, key); err = -ENOENT ; goto out_unlock;
Greg Kroah-Hartman
maintainerPATCH 17/33 ath9k_htc: Fix memory leak
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sujith Manoharan <[email protected]>
commit 0981c3b24ef664f5611008a6e6d0622fac6d892b upstream.
SKBs that are allocated in the HTC layer do not have callbacks registered and hence ended up not being freed, Fix this by freeing them properly in the TX completion routine.
--- drivers/net/wireless/ath/ath9k/htc_hst.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/wireless/ath/ath9k/htc_hst.c +2 -0
@@ -342,6 +342,8 @@ void ath9k_htc_txcompletion_cb(struct ht endpoint->ep_callbacks.tx (endpoint->ep_callbacks.priv, skb, htc_hdr->endpoint_id, txok); + }else { +kfree_skb (skb); } }
Greg Kroah-Hartman
maintainerPATCH 18/33 ath9k: do not link receive buffers during flush
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <[email protected]>
commit a3dc48e82bb146ef11cf75676c8410c1df29b0c4 upstream.
On AR9300 the rx FIFO needs to be empty during reset to ensure that no further DMA activity is generated, otherwise it might lead to memory corruption issues.
--- drivers/net/wireless/ath/ath9k/recv.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath9k/recv.c +6 -4
@@ -778,6 +778,7 @@ static struct ath_buf *ath_get_next_rx_breturn NULL ; } +list_del (&bf->list);if (!bf->bf_mpdu)return bf;
@@ -1966,14 +1967,15 @@ requeue_drop_frag: sc->rx.frag =NULL ; } requeue: +list_add_tail (&bf->list, &sc->rx.rxbuf); +if (flush) +continue ; +if (edma) { -list_add_tail (&bf->list, &sc->rx.rxbuf);ath_rx_edma_buf_link (sc, qtype); }else { -list_move_tail (&bf->list, &sc->rx.rxbuf);ath_rx_buf_link (sc, bf); -if (!flush) -ath9k_hw_rxena (ah); +ath9k_hw_rxena (ah); } }while (1 );
Greg Kroah-Hartman
maintainerPATCH 19/33 ath9k: fix double-free bug on beacon generate failure
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <[email protected]>
commit 1adb2e2b5f85023d17eb4f95386a57029df27c88 upstream.
When the next beacon is sent, the ath_buf from the previous run is reused. If getting a new beacon from mac80211 fails, bf->bf_mpdu is not reset, yet the skb is freed, leading to a double-free on the next beacon tx attempt, resulting in a system crash.
--- drivers/net/wireless/ath/ath9k/beacon.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/ath/ath9k/beacon.c +1 -0
@@ -154,6 +154,7 @@ static struct ath_buf *ath_beacon_genera skb->len, DMA_TO_DEVICE);dev_kfree_skb_any (skb); bf->bf_buf_addr =0 ; + bf->bf_mpdu =NULL ; }/* Get a new beacon from mac80211 */
Greg Kroah-Hartman
maintainerPATCH 20/33 ALSA: usb-audio: fix invalid length check for RME and other UAC 2 devices
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Clemens Ladisch <[email protected]>
commit d56268fb108c7c21e19933588ca4d94652585183 upstream.
Commit 23caaf19b11e (ALSA: usb-mixer: Add support for Audio Class v2.0) forgot to adjust the length check for UAC 2.0 feature unit descriptors. This would make the code abort on encountering a feature unit without per-channel controls, and thus prevented the driver to work with any device having such a unit, such as the RME Babyface or Fireface UCX.
--- sound/usb/mixer.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
sound/usb/mixer.c +12 -5
@@ -1239,16 +1239,23 @@ static int parse_audio_feature_unit(stru } channels = (hdr->bLength -7 ) / csize -1 ; bmaControls = hdr->bmaControls; +if (hdr->bLength <7 + csize) { +snd_printk (KERN_ERR "usbaudio: unit %u: " +"invalid UAC_FEATURE_UNIT descriptor\n" , + unitid); +return -EINVAL ; + } }else {struct uac2_feature_unit_descriptor *ftr = _ftr; csize =4 ; channels = (hdr->bLength -6 ) /4 -1 ; bmaControls = ftr->bmaControls; - } - -if (hdr->bLength <7 || !csize || hdr->bLength <7 + csize) { -snd_printk (KERN_ERR "usbaudio: unit %u: invalid UAC_FEATURE_UNIT descriptor\n" , unitid); -return -EINVAL ; +if (hdr->bLength <6 + csize) { +snd_printk (KERN_ERR "usbaudio: unit %u: " +"invalid UAC_FEATURE_UNIT descriptor\n" , + unitid); +return -EINVAL ; + } }/* parse the source unit */
Greg Kroah-Hartman
maintainerPATCH 21/33 ALSA: hda - Add a fixup for Packard-Bell desktop with ALC880
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 0712eea349d8e2b6d0e44b94a752d999319027fb upstream.
A Packard-Bell desktop machine gives no proper pin configuration from BIOS. It's almost equivalent with the 6stack+fp standard config, just take the existing fixup.
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=901846
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -4741,6 +4741,7 @@ static const struct snd_pci_quirk alc880SND_PCI_QUIRK (0x1584 ,0x9077 ,"Uniwill P53" ,ALC880_FIXUP_VOL_KNOB ),SND_PCI_QUIRK (0x161f ,0x203d ,"W810" ,ALC880_FIXUP_W810 ),SND_PCI_QUIRK (0x161f ,0x205d ,"Medion Rim 2150" ,ALC880_FIXUP_MEDION_RIM ), +SND_PCI_QUIRK (0x1631 ,0xe011 ,"PB 13201056" ,ALC880_FIXUP_6ST ),SND_PCI_QUIRK (0x1734 ,0x107c ,"FSC F1734" ,ALC880_FIXUP_F1734 ),SND_PCI_QUIRK (0x1734 ,0x1094 ,"FSC Amilo M1451G" ,ALC880_FIXUP_FUJITSU ), SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
Greg Kroah-Hartman
maintainerPATCH 22/33 EDAC: Test correct variable in ->store function
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit 8024c4c0b1057d1cd811fc9c3f88f81de9729fcd upstream.
We're testing for ->show but calling ->store().
--- drivers/edac/edac_pci_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/edac/edac_pci_sysfs.c +1 -1
@@ -257,7 +257,7 @@ static ssize_t edac_pci_dev_store(structstruct edac_pci_dev_attribute *edac_pci_dev; edac_pci_dev = (struct edac_pci_dev_attribute *)attr; -if (edac_pci_dev->show) +if (edac_pci_dev->store)return edac_pci_dev->store (edac_pci_dev->value, buffer, count);return -EIO ; }
Greg Kroah-Hartman
maintainerPATCH 23/33 ASoC: wm2200: correct mixer values and text
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Rattray <[email protected]>
commit a80cc734282805e15b5e023751a4d02f7ffbcc91 upstream.
--- sound/soc/codecs/wm2200.c | 3 --- 1 file changed, 3 deletions(-)
sound/soc/codecs/wm2200.c +0 -3
@@ -897,8 +897,6 @@ static const char *wm2200_mixer_texts[]"EQR" ,"LHPF1" ,"LHPF2" , -"LHPF3" , -"LHPF4" ,"DSP1.1" ,"DSP1.2" , "DSP1.3",
@@ -931,7 +929,6 @@ static int wm2200_mixer_values[] = {0x25 ,0x50 ,/* EQ */ 0x51 , -0x52 ,0x60 ,/* LHPF1 */ 0x61 ,/* LHPF2 */ 0x68, /* DSP1 */
Greg Kroah-Hartman
maintainerPATCH 24/33 Bluetooth: Fix incorrect strncpy() in hidp_setup_hid()
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anderson Lizardo <[email protected]>
commit 0a9ab9bdb3e891762553f667066190c1d22ad62b upstream.
The length parameter should be sizeof(req->name) - 1 because there is no guarantee that string provided by userspace will contain the trailing '\0'.
Can be easily reproduced by manually setting req->name to 128 non-zero bytes prior to ioctl(HIDPCONNADD) and checking the device name setup on input subsystem:
$ cat /sys/devices/pnp0/00\:04/tty/ttyS0/hci0/hci0\:1/input8/name AAAAAA[...]AAAAAAAAf0:af:f0:af:f0:af
("f0:af:f0:af:f0:af" is the device bluetooth address, taken from "phys" field in struct hid_device due to overflow.)
--- net/bluetooth/hidp/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/hidp/core.c +1 -1
@@ -949,7 +949,7 @@ static int hidp_setup_hid(struct hidp_se hid->version = req->version; hid->country = req->country; -strncpy (hid->name, req->name,128 ); +strncpy (hid->name, req->name,sizeof (req->name) -1 );strncpy (hid->phys,batostr (&bt_sk (session->ctrl_sock->sk)->src),64 );strncpy (hid->uniq,batostr (&bt_sk (session->ctrl_sock->sk)->dst),64 );
Greg Kroah-Hartman
maintainerPATCH 25/33 iommu/intel: disable DMAR for g4x integrated gfx
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Vetter <[email protected]>
commit 9452618e7462181ed9755236803b6719298a13ce upstream.
DMAR support on g4x/gm45 integrated gpus seems to be totally busted. So don't bother, but instead disable it by default to allow distros to unconditionally enable DMAR support.
v2: Actually wire up the right quirk entry, spotted by Adam Jackson.
Note that according to intel marketing materials only g45 and gm45 support DMAR/VT-d. So we have reports for all relevant gen4 pci ids by now. Still, keep all the other gen4 ids in the quirk table in case the marketing stuff confused me again, which would not be the first time.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=51921
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=538163
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=538163
--- drivers/iommu/intel-iommu.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)
drivers/iommu/intel-iommu.c +15 -6
@@ -4193,6 +4193,21 @@ static struct iommu_ops intel_iommu_ops .pgsize_bitmap = INTEL_IOMMU_PGSIZES, }; +static void __devinit quirk_iommu_g4x_gfx (struct pci_dev *dev) +{ +/* G4x/GM45 integrated gfx dmar support is totally busted. */ +printk (KERN_INFO "DMAR: Disabling IOMMU for graphics on this chipset\n" ); + dmar_map_gfx =0 ; +} + +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x2a40 , quirk_iommu_g4x_gfx); +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x2e00 , quirk_iommu_g4x_gfx); +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x2e10 , quirk_iommu_g4x_gfx); +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x2e20 , quirk_iommu_g4x_gfx); +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x2e30 , quirk_iommu_g4x_gfx); +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x2e40 , quirk_iommu_g4x_gfx); +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x2e90 , quirk_iommu_g4x_gfx); +static void __devinit quirk_iommu_rwbf (struct pci_dev *dev) {/*
@@ -4201,12 +4216,6 @@ static void __devinit quirk_iommu_rwbf(s*/ printk (KERN_INFO "DMAR: Forcing write-buffer flush capability\n" ); rwbf_quirk =1 ; - -/* https://bugzilla.redhat.com/show_bug.cgi?id=538163 */ -if (dev->revision ==0x07 ) { -printk (KERN_INFO "DMAR: Disabling IOMMU for graphics on this chipset\n" ); - dmar_map_gfx =0 ; - } }DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x2a40 , quirk_iommu_rwbf);
Greg Kroah-Hartman
maintainerPATCH 26/33 mac80211: synchronize scan off/on-channel and PS states
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanislaw Gruszka <[email protected]>
commit aacde9ee45225f7e0b90960f479aef83c66bfdc0 upstream.
Since:
commit b23b025fe246f3acc2988eb6d400df34c27cb8ae
Author: Ben Greear <[email protected]> Date: Fri Feb 4 11:54:17 2011 -0800
mac80211: Optimize scans on current operating channel.
we do not disable PS while going back to operational channel (on ieee80211_scan_state_suspend) and deffer that until scan finish. But since we are allowed to send frames, we can send a frame to AP without PM bit set, so disable PS on AP side. Then when we switch to off-channel (in ieee80211_scan_state_resume) we do not enable PS. Hence we are off-channel with PS disabled, frames are not buffered by AP.
To fix remove offchannel_ps_disable argument and always enable PS when going off-channel and disable it when going on-channel, like it was before.
--- net/mac80211/ieee80211_i.h | 6 ++---- net/mac80211/offchannel.c | 17 ++++++----------- net/mac80211/scan.c | 15 +++++---------- net/mac80211/work.c | 4 ++-- 4 files changed, 15 insertions(+), 27 deletions(-)
net/mac80211/ieee80211_i.h +2 -4
@@ -1264,10 +1264,8 @@ int ieee80211_request_sched_scan_stop(stvoid ieee80211_sched_scan_stopped_work (struct work_struct *work);/* off-channel helpers */ -void ieee80211_offchannel_stop_vifs (struct ieee80211_local *local, -bool offchannel_ps_enable); -void ieee80211_offchannel_return (struct ieee80211_local *local, -bool offchannel_ps_disable); +void ieee80211_offchannel_stop_vifs (struct ieee80211_local *local); +void ieee80211_offchannel_return (struct ieee80211_local *local);void ieee80211_hw_roc_setup (struct ieee80211_local *local);/* interface handling */
net/mac80211/offchannel.c +6 -11
@@ -103,8 +103,7 @@ static void ieee80211_offchannel_ps_disaieee80211_sta_reset_conn_monitor (sdata); } -void ieee80211_offchannel_stop_vifs (struct ieee80211_local *local, -bool offchannel_ps_enable) +void ieee80211_offchannel_stop_vifs (struct ieee80211_local *local) {struct ieee80211_sub_if_data *sdata;
@@ -129,8 +128,7 @@ void ieee80211_offchannel_stop_vifs(struif (sdata->vif.type !=NL80211_IFTYPE_MONITOR ) {netif_tx_stop_all_queues (sdata->dev); -if (offchannel_ps_enable && - (sdata->vif.type ==NL80211_IFTYPE_STATION ) && +if (sdata->vif.type ==NL80211_IFTYPE_STATION && sdata->u.mgd.associated)ieee80211_offchannel_ps_enable (sdata, true); }
@@ -138,8 +136,7 @@ void ieee80211_offchannel_stop_vifs(strumutex_unlock (&local->iflist_mtx); } -void ieee80211_offchannel_return (struct ieee80211_local *local, -bool offchannel_ps_disable) +void ieee80211_offchannel_return (struct ieee80211_local *local) {struct ieee80211_sub_if_data *sdata;
@@ -152,11 +149,9 @@ void ieee80211_offchannel_return(structcontinue ;/* Tell AP we're back */ -if (offchannel_ps_disable && - sdata->vif.type ==NL80211_IFTYPE_STATION ) { -if (sdata->u.mgd.associated) -ieee80211_offchannel_ps_disable (sdata); - } +if (sdata->vif.type ==NL80211_IFTYPE_STATION && + sdata->u.mgd.associated) +ieee80211_offchannel_ps_disable (sdata);if (sdata->vif.type !=NL80211_IFTYPE_MONITOR ) {/*
net/mac80211/scan.c +5 -10
@@ -329,7 +329,7 @@ static void __ieee80211_scan_completed(sif (!was_hw_scan) {ieee80211_configure_filter (local);drv_sw_scan_complete (local); -ieee80211_offchannel_return (local, true); +ieee80211_offchannel_return (local); }ieee80211_recalc_idle (local);
@@ -374,7 +374,7 @@ static int ieee80211_start_sw_scan(struc local->next_scan_state =SCAN_DECISION ; local->scan_channel_idx =0 ; -ieee80211_offchannel_stop_vifs (local, true); +ieee80211_offchannel_stop_vifs (local);ieee80211_configure_filter (local);
@@ -629,12 +629,8 @@ static void ieee80211_scan_state_suspend local->scan_channel =NULL ;ieee80211_hw_config (local,IEEE80211_CONF_CHANGE_CHANNEL ); -/* -* Re-enable vifs and beaconing. Leave PS -* in off-channel state..will put that back -* on-channel at the end of scanning. -*/ -ieee80211_offchannel_return (local, false); +/* disable PS */ +ieee80211_offchannel_return (local); *next_delay =HZ /5 ;/* afterwards, resume scan & go to next channel */
@@ -644,8 +640,7 @@ static void ieee80211_scan_state_suspendstatic void ieee80211_scan_state_resume (struct ieee80211_local *local,unsigned long *next_delay) { -/* PS already is in off-channel mode */ -ieee80211_offchannel_stop_vifs (local, false); +ieee80211_offchannel_stop_vifs (local);if (local->ops->flush) {drv_flush (local, false);
net/mac80211/work.c +2 -2
@@ -148,7 +148,7 @@ static void ieee80211_work_work(struct w }if (!started && !local->tmp_channel) { -ieee80211_offchannel_stop_vifs (local, true); +ieee80211_offchannel_stop_vifs (local); local->tmp_channel = wk->chan; local->tmp_channel_type = wk->chan_type;
@@ -220,7 +220,7 @@ static void ieee80211_work_work(struct w local->tmp_channel =NULL ;ieee80211_hw_config (local,0 ); -ieee80211_offchannel_return (local, true); +ieee80211_offchannel_return (local);/* give connection some time to breathe */ run_again (local, jiffies +HZ /2 );
Greg Kroah-Hartman
maintainerPATCH 27/33 NFS: Dont silently fail setattr() requests on mountpoints
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
commit ab225417825963b6dc66be7ea80f94ac1378dfdf upstream.
Ensure that any setattr and getattr requests for junctions and/or mountpoints are sent to the server. Ever since commit 0ec26fd0698 (vfs: automount should ignore LOOKUP_FOLLOW), we have silently dropped any setattr requests to a server-side mountpoint. For referrals, we have silently dropped both getattr and setattr requests.
This patch restores the original behaviour for setattr on mountpoints, and tries to do the same for referrals, provided that we have a filehandle...
--- fs/nfs/namespace.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
fs/nfs/namespace.c +20 -0
@@ -253,11 +253,31 @@ out_nofree:return mnt; } +static int +nfs_namespace_getattr (struct vfsmount *mnt,struct dentry *dentry,struct kstat *stat) +{ +if (NFS_FH (dentry->d_inode)->size !=0 ) +return nfs_getattr (mnt, dentry, stat); +generic_fillattr (dentry->d_inode, stat); +return 0 ; +} + +static int +nfs_namespace_setattr (struct dentry *dentry,struct iattr *attr) +{ +if (NFS_FH (dentry->d_inode)->size !=0 ) +return nfs_setattr (dentry, attr); +return -EACCES ; +} +const struct inode_operations nfs_mountpoint_inode_operations = { .getattr = nfs_getattr, + .setattr = nfs_setattr, };const struct inode_operations nfs_referral_inode_operations = { + .getattr = nfs_namespace_getattr, + .setattr = nfs_namespace_setattr, };static void nfs_expire_automounts (struct work_struct *work)
Greg Kroah-Hartman
maintainerPATCH 28/33 smp: Fix SMP function call empty cpu mask race
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wang YanQing <[email protected]>
commit f44310b98ddb7f0d06550d73ed67df5865e3eda5 upstream.
I get the following warning every day with v3.7, once or twice a day:
[ 2235.186027] WARNING: at /mnt/sda7/kernel/linux/arch/x86/kernel/apic/ipi.c:109 default_send_IPI_mask_logical+0x2f/0xb8()
As explained by Linus as well:
| | Once we've done the "list_add_rcu()" to add it to the | queue, we can have (another) IPI to the target CPU that can | now see it and clear the mask. | | So by the time we get to actually send the IPI, the mask might | have been cleared by another IPI. |
This patch also fixes a system hang problem, if the data->cpumask gets cleared after passing this point:
if (WARN_ONCE(!mask, "empty IPI mask"))
return;
then the problem in commit 83d349f35e1a ("x86: don't send an IPI to the empty set of CPU's") will happen again.
--- kernel/smp.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
kernel/smp.c +12 -1
@@ -31,6 +31,7 @@ struct call_function_data {struct call_single_data csd;atomic_t refs;cpumask_var_t cpumask; +cpumask_var_t cpumask_ipi; }; static DEFINE_PER_CPU_SHARED_ALIGNED(struct call_function_data, cfd_data);
@@ -54,6 +55,9 @@ hotplug_cfd(struct notifier_block *nfb,if (!zalloc_cpumask_var_node (&cfd->cpumask,GFP_KERNEL ,cpu_to_node (cpu)))return notifier_from_errno (-ENOMEM ); +if (!zalloc_cpumask_var_node (&cfd->cpumask_ipi,GFP_KERNEL , +cpu_to_node (cpu))) +return notifier_from_errno (-ENOMEM );break ;#ifdef CONFIG_HOTPLUG_CPU
@@ -63,6 +67,7 @@ hotplug_cfd(struct notifier_block *nfb,case CPU_DEAD :case CPU_DEAD_FROZEN :free_cpumask_var (cfd->cpumask); +free_cpumask_var (cfd->cpumask_ipi);break ;#endif };
@@ -524,6 +529,12 @@ void smp_call_function_many(const structreturn ; } +/* +* After we put an entry into the list, data->cpumask +* may be cleared again when another CPU sends another IPI for +* a SMP function call, so data->cpumask will be zero. +*/ +cpumask_copy (data->cpumask_ipi, data->cpumask);raw_spin_lock_irqsave (&call_function.lock, flags);/* * Place entry at the _HEAD_ of the list, so that any cpu still
@@ -547,7 +558,7 @@ void smp_call_function_many(const structsmp_mb ();/* Send a message to all CPUs in the map */ -arch_send_call_function_ipi_mask (data->cpumask); +arch_send_call_function_ipi_mask (data->cpumask_ipi);/* Optionally wait for the CPUs to complete */ if (wait)
Greg Kroah-Hartman
maintainerPATCH 29/33 x86/msr: Add capabilities check
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Cox <[email protected]>
commit c903f0456bc69176912dee6dd25c6a66ee1aed00 upstream.
At the moment the MSR driver only relies upon file system checks. This means that anything as root with any capability set can write to MSRs. Historically that wasn't very interesting but on modern processors the MSRs are such that writing to them provides several ways to execute arbitary code in kernel space. Sample code and documentation on doing this is circulating and MSR attacks are used on Windows 64bit rootkits already.
In the Linux case you still need to be able to open the device file so the impact is fairly limited and reduces the security of some capability and security model based systems down towards that of a generic "root owns the box" setup.
Therefore they should require CAP_SYS_RAWIO to prevent an elevation of capabilities. The impact of this is fairly minimal on most setups because they don't have heavy use of capabilities. Those using SELinux, SMACK or AppArmor rules might want to consider if their rulesets on the MSR driver could be tighter.
--- arch/x86/kernel/msr.c | 3 +++ 1 file changed, 3 insertions(+)
arch/x86/kernel/msr.c +3 -0
@@ -174,6 +174,9 @@ static int msr_open(struct inode *inode,unsigned int cpu;struct cpuinfo_x86 *c; +if (!capable (CAP_SYS_RAWIO )) +return -EPERM ; + cpu =iminor (file->f_path.dentry->d_inode);if (cpu >= nr_cpu_ids || !cpu_online (cpu))return -ENXIO ;/* No such CPU */
Greg Kroah-Hartman
maintainerPATCH 30/33 efi, x86: Pass a proper identity mapping in efi_call_phys_prelog
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nathan Zimmer <[email protected]>
commit b8f2c21db390273c3eaf0e5308faeaeb1e233840 upstream.
Update efi_call_phys_prelog to install an identity mapping of all available memory. This corrects a bug on very large systems with more then 512 GB in which bios would not be able to access addresses above not in the mapping.
The result is a crash that looks much like this.
BUG: unable to handle kernel paging request at 000000effd870020 IP: [<0000000078bce331>] 0x78bce330 PGD 0 Oops: 0000 [#1] SMP Modules linked in: CPU 0 Pid: 0, comm: swapper/0 Tainted: G W 3.8.0-rc1-next-20121224-medusa_ntz+ #2 Intel Corp. Stoutland Platform RIP: 0010:[<0000000078bce331>] [<0000000078bce331>] 0x78bce330 RSP: 0000:ffffffff81601d28 EFLAGS: 00010006 RAX: 0000000078b80e18 RBX: 0000000000000004 RCX: 0000000000000004 RDX: 0000000078bcf958 RSI: 0000000000002400 RDI: 8000000000000000 RBP: 0000000078bcf760 R08: 000000effd870000 R09: 0000000000000000 R10: 0000000000000000 R11: 00000000000000c3 R12: 0000000000000030 R13: 000000effd870000 R14: 0000000000000000 R15: ffff88effd870000 FS: 0000000000000000(0000) GS:ffff88effe400000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000effd870020 CR3: 000000000160c000 CR4: 00000000000006b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Process swapper/0 (pid: 0, threadinfo ffffffff81600000, task ffffffff81614400) Stack: 0000000078b80d18 0000000000000004 0000000078bced7b ffff880078b81fff 0000000000000000 0000000000000082 0000000078bce3a8 0000000000002400 0000000060000202 0000000078b80da0 0000000078bce45d ffffffff8107cb5a Call Trace: [<ffffffff8107cb5a>] ? on_each_cpu+0x77/0x83 [<ffffffff8102f4eb>] ? change_page_attr_set_clr+0x32f/0x3ed [<ffffffff81035946>] ? efi_call4+0x46/0x80 [<ffffffff816c5abb>] ? efi_enter_virtual_mode+0x1f5/0x305 [<ffffffff816aeb24>] ? start_kernel+0x34a/0x3d2 [<ffffffff816ae5ed>] ? repair_env_string+0x60/0x60 [<ffffffff816ae2be>] ? x86_64_start_reservations+0xba/0xc1 [<ffffffff816ae120>] ? early_idt_handlers+0x120/0x120 [<ffffffff816ae419>] ? x86_64_start_kernel+0x154/0x163 Code: Bad RIP value. RIP [<0000000078bce331>] 0x78bce330 RSP <ffffffff81601d28> CR2: 000000effd870020 ---[ end trace ead828934fef5eab ]---
--- arch/x86/platform/efi/efi_64.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-)
arch/x86/platform/efi/efi_64.c +17 -5
@@ -38,7 +38,7 @@#include <asm/cacheflush.h> #include <asm/fixmap.h> -static pgd_t save_pgd__initdata ; +static pgd_t *save_pgd__initdata ;static unsigned long efi_flags__initdata ;static void __init early_code_mapping_set_exec (int executable)
@@ -61,12 +61,20 @@ static void __init early_code_mapping_sevoid __init efi_call_phys_prelog (void ) {unsigned long vaddress; +int pgd; +int n_pgds;early_code_mapping_set_exec (1 );local_irq_save (efi_flags); - vaddress = (unsigned long )__va (0x0UL ); - save_pgd = *pgd_offset_k (0x0UL ); -set_pgd (pgd_offset_k (0x0UL ), *pgd_offset_k (vaddress)); + + n_pgds =DIV_ROUND_UP ((max_pfn <<PAGE_SHIFT ),PGDIR_SIZE ); + save_pgd =kmalloc (n_pgds *sizeof (pgd_t),GFP_KERNEL ); + +for (pgd =0 ; pgd < n_pgds; pgd++) { + save_pgd[pgd] = *pgd_offset_k (pgd *PGDIR_SIZE ); + vaddress = (unsigned long )__va (pgd *PGDIR_SIZE ); +set_pgd (pgd_offset_k (pgd *PGDIR_SIZE ), *pgd_offset_k (vaddress)); + }__flush_tlb_all (); }
@@ -75,7 +83,11 @@ void __init efi_call_phys_epilog(void)/* * After the lock is released, the original page table is restored. */ -set_pgd (pgd_offset_k (0x0UL ), save_pgd); +int pgd; +int n_pgds =DIV_ROUND_UP ((max_pfn <<PAGE_SHIFT ) ,PGDIR_SIZE ); +for (pgd =0 ; pgd < n_pgds; pgd++) +set_pgd (pgd_offset_k (pgd *PGDIR_SIZE ), save_pgd[pgd]); +kfree (save_pgd);__flush_tlb_all ();local_irq_restore (efi_flags);early_code_mapping_set_exec (0 );
Greg Kroah-Hartman
maintainerPATCH 31/33 x86, efi: Set runtime_version to the EFI spec revision
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matt Fleming <[email protected]>
commit 712ba9e9afc4b3d3d6fa81565ca36fe518915c01 upstream.
efi.runtime_version is erroneously being set to the value of the vendor's firmware revision instead of that of the implemented EFI specification. We can't deduce which EFI functions are available based on the revision of the vendor's firmware since the version scheme is likely to be unique to each vendor.
What we really need to know is the revision of the implemented EFI specification, which is available in the EFI System Table header.
--- arch/x86/platform/efi/efi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/platform/efi/efi.c +1 -1
@@ -900,7 +900,7 @@ void __init efi_enter_virtual_mode(void)* * Call EFI services through wrapper functions. */ - efi.runtime_version = efi_systab.fw_revision; + efi.runtime_version = efi_systab.hdr.revision; efi.get_time = virt_efi_get_time; efi.set_time = virt_efi_set_time; efi.get_wakeup_time = virt_efi_get_wakeup_time;
Greg Kroah-Hartman
maintainerPATCH 32/33 x86/Sandy Bridge: Sandy Bridge workaround depends on CONFIG_PCI
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: "H. Peter Anvin" <[email protected]>
commit e43b3cec711a61edf047adf6204d542f3a659ef8 upstream.
early_pci_allowed() and read_pci_config_16() are only available if CONFIG_PCI is defined.
--- arch/x86/kernel/setup.c | 2 ++ 1 file changed, 2 insertions(+)
arch/x86/kernel/setup.c +2 -0
@@ -622,6 +622,7 @@ static unsigned reserve_low = CONFIG_X86static bool __init snb_gfx_workaround_needed (void ) { +#ifdef CONFIG_PCI int i;u16 vendor, devid; static const u16 snb_ids[] = {
@@ -646,6 +647,7 @@ static bool __init snb_gfx_workaround_nefor (i =0 ; i <ARRAY_SIZE (snb_ids); i++)if (devid == snb_ids[i])return true; +#endif return false; }
Greg Kroah-Hartman
maintainerPATCH 33/33 target: fix regression with dev_link_magic in target_fabric_port_link
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Bellinger <[email protected]>
This is to fix a regression that only affect the stable (not for the mainline) that the stable commit fdf9d86 was incorrectly placed dev->dev_link_magic check before the *dev assignment in target_fabric_port_link() due to fuzzy automatically context adjustment during the back-porting.
--- drivers/target/target_core_fabric_configfs.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/target/target_core_fabric_configfs.c +5 -6
@@ -752,12 +752,6 @@ static int target_fabric_port_link(struct target_fabric_configfs *tf;int ret; -if (dev->dev_link_magic !=SE_DEV_LINK_MAGIC ) { -pr_err ("Bad dev->dev_link_magic, not a valid se_dev_ci pointer:" -" %p to struct se_device: %p\n" , se_dev_ci, dev); -return -EFAULT ; - } - tpg_ci = &lun_ci->ci_parent->ci_group->cg_item; se_tpg =container_of (to_config_group (tpg_ci), struct se_portal_group, tpg_group);
@@ -775,6 +769,11 @@ static int target_fabric_port_link( ret = -ENODEV ; goto out; } +if (dev->dev_link_magic !=SE_DEV_LINK_MAGIC ) { +pr_err ("Bad dev->dev_link_magic, not a valid se_dev_ci pointer:" +" %p to struct se_device: %p\n" , se_dev_ci, dev); +return -EFAULT ; + } lun_p =core_dev_add_lun (se_tpg, dev->se_hba, dev, lun->unpacked_lun);
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.4.29 release. There are 33 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun Feb 3 10:47:08 UTC 2013. Anything received after that time might be too late.
Quoted 8 lines
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.4.29-rc1.gzand the diffstat can be found below.
thanks,
greg k-h
Patches applied cleanly to 3.0.61, 3.4.28, and 3.7.5. Compiled and booted on the following systems:
HP EliteBook 6930p Intel(R) Core(TM)2 Duo CPU T9400 @ 2.53GHz HP ProBook 6475b AMD A10-4600M APU with Radeon(tm) HD Graphics
Cross-compile tests:
alpha: defconfig passed on all
arm: defconfig passed on all
arm64: not applicable to 3.0.y, 3.4.y. defconfig passed on 3.7.y
c6x: not applicable to 3.0.y, defconfig passed on 3.4.y, and 3.7.y.
mips: defconfig passed on all
mipsel: defconfig passed on all
powerpc: wii_defconfig passed on all
sh: defconfig passed on all
sparc: defconfig passed on all
tile: tilegx_defconfig passed on all
-- Shuah
At Fri, 1 Feb 2013 11:49:05 +0100,
Quoted 6 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.4.29 release. There are 33 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Quoted 6 lines
Responses should be made by Sun Feb 3 10:47:08 UTC 2013. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.4.29-rc1.gzand the diffstat can be found below.
This kernel can be built and boot without any problem. Building a kernel with this kernel also works fine.
- Build Machine: debian wheezy x86_64
CPU: Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz x 4
memory: 8GB
- Test machine: debian wheezy x86_64(KVM guest on the Build Machine)
vCPU: x2
memory: 2GB
I reviewed the following patches and it looks good to me.
Quoted 5 lines
-------------
Pseudo-Shortlog of commits:Greg Kroah-Hartman <[email protected]>
Linux 3.4.29-rc1
...
Quoted 5 lines
H. Peter Anvin <[email protected]>
x86/Sandy Bridge: Sandy Bridge workaround depends onCONFIG_PCIMatt Fleming <[email protected]>
x86, efi: Setruntime_versionto the EFI spec revision
...
Quoted 5 lines
Alan Cox <[email protected]>
x86/msr: Add capabilities checkWang YanQing <[email protected]>
smp: Fix SMP function call empty cpu mask race
...
Quoted 2 lines
Jan Kara <[email protected]>
xfs: Fix possible use-after-free with AIO
...
Quoted 2 lines
Cong Ding <[email protected]>
fs/cifs/cifs_dfs_ref.c: fix potential memory leakage
Thanks,
Satoru