3.10.8-stable review
Subsystems (40)
Greg Kroah-Hartman
maintainercover 3.10.8-stable review
This is the start of the stable review cycle for the 3.10.8 release. There are 45 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 Tue Aug 20 20:36:09 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.10.8-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 3.10.8-rc1
Li Zefan <[email protected]>
cpuset: fix the return value of cpuset_write_u64()
Jan Kara <[email protected]>
jbd2: Fix use after free after error in jbd2_journal_dirty_metadata()
Guenter Roeck <[email protected]>
s390: Fix broken build
Geert Uytterhoeven <[email protected]>
m68k/atari: ARAnyM - Fix NatFeat module support
Andreas Schwab <[email protected]>
m68k: Truncate base in do_div()
Will Deacon <[email protected]>
ARM: 7809/1: perf: fix event validation for software group leaders
Linus Torvalds <[email protected]>
Fix TLB gather virtual address range invalidation corner cases
Thomas Pugliese <[email protected]>
wusbcore: fix kernel panic when disconnecting a wireless USB->serial device
Stephen Boyd <[email protected]>
PM / QoS: Fix workqueue deadlock when using pm_qos_update_request_timeout()
Matt Burtch <[email protected]>
USB-Serial: Fix error handling of usb_wwan
Alan Stern <[email protected]>
USB: EHCI: accept very late isochronous URBs
Johan Hovold <[email protected]>
USB: keyspan: fix null-deref at disconnect and release
Johan Hovold <[email protected]>
USB: mos7720: fix broken control requests
Johan Hovold <[email protected]>
USB: mos7840: fix big-endian probe
Johan Hovold <[email protected]>
USB: ti_usb_3410_5052: fix big-endian firmware handling
Oliver Neukum <[email protected]>
usb: add two quirky touchscreen
Johannes Berg <[email protected]>
nl80211: fix another nl80211_fam.attrbuf race
Takashi Iwai <[email protected]>
ALSA: hda - Add a fixup for Gateway LT27
Takashi Iwai <[email protected]>
ALSA: hda - Add pinfix for LG LW25 laptop
Takashi Iwai <[email protected]>
ALSA: hda - Fix missing mute controls for CX5051
Torsten Schenk <[email protected]>
ALSA: 6fire: make buffers DMA-able (midi)
Torsten Schenk <[email protected]>
ALSA: 6fire: make buffers DMA-able (pcm)
Maksim A. Boyko <[email protected]>
ALSA: usb-audio: Fix invalid volume resolution for Logitech HD Webcam C525
Stephen Warren <[email protected]>
ASoC: tegra: fix Tegra30 I2S capture parameter setup
Brian Austin <[email protected]>
ASoC: cs42l52: Reorder Min/Max and update to SX_TLV for Beep Volume
Lars-Peter Clausen <[email protected]>
ASoC: dapm: Fix empty list check in dapm_new_mux()
Johannes Berg <[email protected]>
cfg80211: fix P2P GO interface teardown
Johannes Berg <[email protected]>
genetlink: fix family dump race
Stephane Grosjean <[email protected]>
can: pcan_usb: fix wrong memcpy() bytes length
Johannes Berg <[email protected]>
mac80211: continue using disabled channels while connected
Chris Wright <[email protected]>
mac80211: fix infinite loop in ieee80211_determine_chantype
Johannes Berg <[email protected]>
mac80211: ignore HT primary channel while connected
Stanislaw Gruszka <[email protected]>
iwl4965: reset firmware after rfkill off
Stanislaw Gruszka <[email protected]>
iwl4965: set power mode early
Marc Zyngier <[email protected]>
ARM: KVM: clear exclusive monitor on all exception returns
Marc Zyngier <[email protected]>
ARM: KVM: add missing dsb before invalidating Stage-2 TLBs
Marc Zyngier <[email protected]>
ARM: KVM: perform save/restore of PAR
Jianpeng Ma <[email protected]>
elevator: Fix a race in elevator switching
Peter Zijlstra <[email protected]>
sched: Ensure update_cfs_shares() is called for parents of continuously-running tasks
yonghua zheng <[email protected]>
fs/proc/task_mmu.c: fix buffer overflow in add_page_map()
Radu Caragea <[email protected]>
x86 get_unmapped_area(): use proper mmap base for bottom-up direction
Michal Simek <[email protected]>
microblaze: fix clone syscall
Andrey Vagin <[email protected]>
memcg: don't initialize kmem-cache destroying work for root caches
Stephen Boyd <[email protected]>
perf/arm: Fix armpmu_map_hw_event()
Vince Weaver <[email protected]>
perf/x86: Fix intel QPI uncore event definitions
-------------
Diffstat:
Makefile | 4 +-- arch/Kconfig | 6 ++++ arch/arm/include/asm/kvm_asm.h | 22 +++++++------- arch/arm/include/asm/tlb.h | 7 +++-- arch/arm/kernel/perf_event.c | 10 ++++++- arch/arm/kvm/coproc.c | 4 +++ arch/arm/kvm/interrupts.S | 16 ++++++++++- arch/arm/kvm/interrupts_head.S | 10 +++++-- arch/arm64/include/asm/tlb.h | 7 +++-- arch/ia64/include/asm/tlb.h | 9 ++++-- arch/m68k/emu/natfeat.c | 23 ++++++++++++--- arch/m68k/include/asm/div64.h | 9 +++--- arch/microblaze/Kconfig | 2 +- arch/s390/include/asm/tlb.h | 8 ++++-- arch/sh/include/asm/tlb.h | 6 ++-- arch/um/include/asm/tlb.h | 6 ++-- arch/x86/kernel/cpu/perf_event_intel_uncore.c | 4 +-- arch/x86/kernel/sys_x86_64.c | 2 +- arch/x86/mm/mmap.c | 2 +- block/cfq-iosched.c | 17 +++++++++-- block/deadline-iosched.c | 16 +++++++++-- block/elevator.c | 25 ++++------------ block/noop-iosched.c | 17 +++++++++-- drivers/net/can/usb/peak_usb/pcan_usb.c | 2 +- drivers/net/wireless/iwlegacy/4965-mac.c | 16 +++++------ drivers/net/wireless/iwlegacy/common.c | 1 + drivers/usb/core/quirks.c | 6 ++++ drivers/usb/host/ehci-sched.c | 13 ++++----- drivers/usb/serial/keyspan.c | 2 +- drivers/usb/serial/mos7720.c | 21 +++++++++----- drivers/usb/serial/mos7840.c | 2 +- drivers/usb/serial/ti_usb_3410_5052.c | 9 +++--- drivers/usb/serial/usb_wwan.c | 20 ++++++------- drivers/usb/wusbcore/wa-xfer.c | 9 ++++-- fs/exec.c | 4 +-- fs/ext4/ext4_jbd2.c | 8 +++--- fs/proc/task_mmu.c | 8 +++--- include/asm-generic/tlb.h | 2 +- include/linux/elevator.h | 6 +++- include/linux/sched.h | 1 + include/linux/syscalls.h | 5 ++++ kernel/cpuset.c | 6 ++-- kernel/fork.c | 6 ++++ kernel/power/qos.c | 13 ++++++++- kernel/sched/fair.c | 1 + mm/hugetlb.c | 2 +- mm/memcontrol.c | 4 +-- mm/memory.c | 36 +++++++++++++---------- mm/mmap.c | 4 +-- net/mac80211/mlme.c | 39 +++++++++++++++---------- net/netlink/genetlink.c | 7 +++++ net/wireless/core.c | 1 + net/wireless/nl80211.c | 6 ++-- sound/pci/hda/hda_generic.c | 6 ++-- sound/pci/hda/patch_realtek.c | 11 +++++++ sound/soc/codecs/cs42l52.c | 2 +- sound/soc/soc-dapm.c | 7 +++-- sound/soc/tegra/tegra30_i2s.c | 2 +- sound/usb/6fire/midi.c | 16 ++++++++++- sound/usb/6fire/midi.h | 6 +--- sound/usb/6fire/pcm.c | 41 ++++++++++++++++++++++++++- sound/usb/6fire/pcm.h | 2 +- sound/usb/mixer.c | 1 + 63 files changed, 406 insertions(+), 180 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/45 perf/x86: Fix intel QPI uncore event definitions
3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vince Weaver <[email protected]>
commit c9601247f8f3fdc18aed7ed7e490e8dfcd07f122 upstream.
John McCalpin reports that the "drs_data" and "ncb_data" QPI uncore events are missing the "extra bit" and always return zero values unless the bit is properly set.
More details from him:
According to the Xeon E5-2600 Product Family Uncore Performance Monitoring Guide, Table 2-94, about 1/2 of the QPI Link Layer events (including the ones that "perf" calls "drs_data" and "ncb_data") require that the "extra bit" be set.
This was confusing for a while -- a note at the bottom of page 94 says that the "extra bit" is bit 16 of the control register. Unfortunately, Table 2-86 clearly says that bit 16 is reserved and must be zero. Looking around a bit, I found that bit 21 appears to be the correct "extra bit", and further investigation shows that "perf" actually agrees with me:
[[email protected]]# cat /sys/bus/event_source/devices/uncore_qpi_0/format/event config:0-7,21
So the command
# perf -e "uncore_qpi_0/event=drs_data/" Is the same as # perf -e "uncore_qpi_0/event=0x02,umask=0x08/" While it should be # perf -e "uncore_qpi_0/event=0x102,umask=0x08/"
I confirmed that this last version gives results that agree with the amount of data that I expected the STREAM benchmark to move across the QPI link in the second (cross-chip) test of the original script.
--- arch/x86/kernel/cpu/perf_event_intel_uncore.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/cpu/perf_event_intel_uncore.c +2 -2
@@ -314,8 +314,8 @@ static struct uncore_event_desc snbep_unstatic struct uncore_event_desc snbep_uncore_qpi_events[] = {INTEL_UNCORE_EVENT_DESC (clockticks,"event=0x14" ),INTEL_UNCORE_EVENT_DESC (txl_flits_active,"event=0x00,umask=0x06" ), -INTEL_UNCORE_EVENT_DESC (drs_data,"event=0x02,umask=0x08" ), -INTEL_UNCORE_EVENT_DESC (ncb_data,"event=0x03,umask=0x04" ), +INTEL_UNCORE_EVENT_DESC (drs_data,"event=0x102,umask=0x08" ), +INTEL_UNCORE_EVENT_DESC (ncb_data,"event=0x103,umask=0x04" ), {/* end: all zeroes */ }, };
Greg Kroah-Hartman
maintainerPATCH 2/45 perf/arm: Fix armpmu_map_hw_event()
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Boyd <[email protected]>
commit b88a2595b6d8aedbd275c07dfa784657b4f757eb upstream.
Fix constraint check in armpmu_map_hw_event().
--- arch/arm/kernel/perf_event.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
arch/arm/kernel/perf_event.c +6 -1
@@ -53,7 +53,12 @@ armpmu_map_cache_event(const unsigned (*static int armpmu_map_hw_event (const unsigned (*event_map)[PERF_COUNT_HW_MAX ],u64 config) { -int mapping = (*event_map)[config]; +int mapping; + +if (config >=PERF_COUNT_HW_MAX ) +return -ENOENT ; + + mapping = (*event_map)[config];return mapping ==HW_OP_UNSUPPORTED ? -ENOENT : mapping; }
Greg Kroah-Hartman
maintainerPATCH 3/45 memcg: dont initialize kmem-cache destroying work for root caches
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrey Vagin <[email protected]>
commit 3e6b11df245180949938734bc192eaf32f3a06b3 upstream.
struct memcg_cache_params has a union. Different parts of this union are used for root and non-root caches. A part with destroying work is used only for non-root caches.
I fixed the same problem in another place v3.9-rc1-16204-gf101a94, but didn't notice this one.
This patch fixes the kernel panic:
[ 46.848187] BUG: unable to handle kernel paging request at 000000fffffffeb8 [ 46.849026] IP: [<ffffffff811a484c>] kmem_cache_destroy_memcg_children+0x6c/0xc0 [ 46.849092] PGD 0 [ 46.849092] Oops: 0000 [#1] SMP
...
--- mm/memcontrol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
mm/memcontrol.c +2 -2
@@ -3186,11 +3186,11 @@ int memcg_register_cache(struct mem_cgroif (!s->memcg_params)return -ENOMEM ; -INIT_WORK (&s->memcg_params->destroy, - kmem_cache_destroy_work_func);if (memcg) { s->memcg_params->memcg = memcg; s->memcg_params->root_cache = root_cache; +INIT_WORK (&s->memcg_params->destroy, + kmem_cache_destroy_work_func); }else s->memcg_params->is_root_cache = true;
Greg Kroah-Hartman
maintainerPATCH 4/45 microblaze: fix clone syscall
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Simek <[email protected]>
commit dfa9771a7c4784bafd0673bc7abcee3813088b77 upstream.
Fix inadvertent breakage in the clone syscall ABI for Microblaze that was introduced in commit f3268edbe6fe ("microblaze: switch to generic fork/vfork/clone").
The Microblaze syscall ABI for clone takes the parent tid address in the 4th argument; the third argument slot is used for the stack size. The incorrectly-used CLONE_BACKWARDS type assigned parent tid to the 3rd slot.
This commit restores the original ABI so that existing userspace libc code will work correctly.
All kernel versions from v3.8-rc1 were affected.
--- arch/Kconfig | 6 ++++++ arch/microblaze/Kconfig | 2 +- include/linux/syscalls.h | 5 +++++ kernel/fork.c | 6 ++++++ 4 files changed, 18 insertions(+), 1 deletion(-)
arch/Kconfig +6 -0
@@ -404,6 +404,12 @@ config CLONE_BACKWARDS2 help Architecture has the first two arguments of clone(2) swapped. +config CLONE_BACKWARDS3 + bool + help + Architecture has tls passed as the 3rd argument of clone(2), + not the 5th one. + config ODD_RT_SIGACTION bool help
arch/microblaze/Kconfig +1 -1
@@ -28,7 +28,7 @@ config MICROBLAZE select GENERIC_CLOCKEVENTS select GENERIC_IDLE_POLL_SETUP select MODULES_USE_ELF_RELA - select CLONE_BACKWARDS + select CLONE_BACKWARDS3 config SWAP def_bool n
include/linux/syscalls.h +5 -0
@@ -802,9 +802,14 @@ asmlinkage long sys_vfork(void);asmlinkage long sys_clone (unsigned long ,unsigned long ,int __user *,int ,int __user *);#else +#ifdef CONFIG_CLONE_BACKWARDS3 +asmlinkage long sys_clone (unsigned long ,unsigned long ,int ,int __user *, +int __user *,int ); +#else asmlinkage long sys_clone (unsigned long ,unsigned long ,int __user *,int __user *,int );#endif +#endif asmlinkage long sys_execve(const char __user *filename, const char __user *const __user *argv,
kernel/fork.c +6 -0
@@ -1675,6 +1675,12 @@ SYSCALL_DEFINE5(clone, unsigned long, ne int __user *, parent_tidptr, int __user *, child_tidptr, int, tls_val) +#elif defined(CONFIG_CLONE_BACKWARDS3) +SYSCALL_DEFINE6(clone, unsigned long, clone_flags, unsigned long, newsp, + int, stack_size, + int __user *, parent_tidptr, + int __user *, child_tidptr, + int, tls_val) #else SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp, int __user *, parent_tidptr,
Greg Kroah-Hartman
maintainerPATCH 5/45 x86 get_unmapped_area(): use proper mmap base for bottom-up direction
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Radu Caragea <[email protected]>
commit df54d6fa54275ce59660453e29d1228c2b45a826 upstream.
When the stack is set to unlimited, the bottomup direction is used for mmap-ings but the mmap_base is not used and thus effectively renders ASLR for mmapings along with PIE useless.
--- arch/x86/kernel/sys_x86_64.c | 2 +- arch/x86/mm/mmap.c | 2 +- include/linux/sched.h | 1 + 3 files changed, 3 insertions(+), 2 deletions(-)
arch/x86/kernel/sys_x86_64.c +1 -1
@@ -101,7 +101,7 @@ static void find_start_end(unsigned long *begin = new_begin; } }else { - *begin =TASK_UNMAPPED_BASE ; + *begin =mmap_legacy_base (); *end =TASK_SIZE ; } }
arch/x86/mm/mmap.c +1 -1
@@ -98,7 +98,7 @@ static unsigned long mmap_base(void)* Bottom-up (legacy) layout on X86_32 did not support randomization, X86_64 * does, but not when emulating X86_32 */ -static unsigned long mmap_legacy_base (void ) +unsigned long mmap_legacy_base (void ) {if (mmap_is_ia32 ())return TASK_UNMAPPED_BASE ;
include/linux/sched.h +1 -0
@@ -314,6 +314,7 @@ struct nsproxy;struct user_namespace ;#ifdef CONFIG_MMU +extern unsigned long mmap_legacy_base (void );extern void arch_pick_mmap_layout (struct mm_struct *mm); extern unsigned long arch_get_unmapped_area(struct file *, unsigned long, unsigned long,
Greg Kroah-Hartman
maintainerPATCH 6/45 fs/proc/task_mmu.c: fix buffer overflow in add_page_map()
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: yonghua zheng <[email protected]>
commit 8c8296223f3abb142be8fc31711b18a704c0e7d8 upstream.
Recently we met quite a lot of random kernel panic issues after enabling CONFIG_PROC_PAGE_MONITOR. After debuggind we found this has something to do with following bug in pagemap:
In struct pagemapread:
struct pagemapread {
int pos, len;
pagemap_entry_t *buffer;
bool v2;
};pos is number of PM_ENTRY_BYTES in buffer, but len is the size of buffer, it is a mistake to compare pos and len in add_page_map() for checking buffer is full or not, and this can lead to buffer overflow and random kernel panic issue.
Correct len to be total number of PM_ENTRY_BYTES in buffer.
--- fs/proc/task_mmu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
fs/proc/task_mmu.c +4 -4
@@ -792,14 +792,14 @@ typedef struct { } pagemap_entry_t;struct pagemapread { -int pos, len; +int pos, len;/* units: PM_ENTRY_BYTES, not bytes */ pagemap_entry_t *buffer; };#define PAGEMAP_WALK_SIZE (PMD_SIZE)#define PAGEMAP_WALK_MASK (PMD_MASK) -#define PM_ENTRY_BYTES sizeof(u64) +#define PM_ENTRY_BYTES sizeof(pagemap_entry_t)#define PM_STATUS_BITS 3#define PM_STATUS_OFFSET (64 - PM_STATUS_BITS)#define PM_STATUS_MASK (((1LL << PM_STATUS_BITS) - 1) << PM_STATUS_OFFSET)
@@ -1038,8 +1038,8 @@ static ssize_t pagemap_read(struct fileif (!count) goto out_task; - pm.len =PM_ENTRY_BYTES * (PAGEMAP_WALK_SIZE >>PAGE_SHIFT ); - pm.buffer =kmalloc (pm.len,GFP_TEMPORARY ); + pm.len = (PAGEMAP_WALK_SIZE >>PAGE_SHIFT ); + pm.buffer =kmalloc (pm.len *PM_ENTRY_BYTES ,GFP_TEMPORARY ); ret = -ENOMEM ;if (!pm.buffer) goto out_task;
Greg Kroah-Hartman
maintainerPATCH 7/45 sched: Ensure update_cfs_shares() is called for parents of continuously-running tasks
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <[email protected]>
commit bf0bd948d1682e3996adc093b43021ed391983e6 upstream.
We typically update a task_group's shares within the dequeue/enqueue path. However, continuously running tasks sharing a CPU are not subject to these updates as they are only put/picked. Unfortunately, when we reverted f269ae046 (in 17bc14b7), we lost the augmenting periodic update that was supposed to account for this; resulting in a potential loss of fairness.
To fix this, re-introduce the explicit update in update_cfs_rq_blocked_load() [called via entity_tick()].
--- kernel/sched/fair.c | 1 + 1 file changed, 1 insertion(+)
kernel/sched/fair.c +1 -0
@@ -1984,6 +1984,7 @@ entity_tick(struct cfs_rq *cfs_rq, struc*/ update_entity_load_avg (curr,1 );update_cfs_rq_blocked_load (cfs_rq,1 ); +update_cfs_shares (cfs_rq);#ifdef CONFIG_SCHED_HRTICK /*
Greg Kroah-Hartman
maintainerPATCH 8/45 elevator: Fix a race in elevator switching
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jianpeng Ma <[email protected]>
commit d50235b7bc3ee0a0427984d763ea7534149531b4 upstream.
There's a race between elevator switching and normal io operation.
Because the allocation of struct elevator_queue and struct elevator_data don't in a atomic operation.So there are have chance to use NULL ->elevator_data.
For example:
Thread A: Thread B
blk_queu_bio elevator_switch
spin_lock_irq(q->queue_block) elevator_alloc
elv_merge elevator_init_fn
Because call elevator_alloc, it can't hold queue_lock and the ->elevator_data is NULL.So at the same time, threadA call elv_merge and nedd some info of elevator_data.So the crash happened.
Move the elevator_alloc into func elevator_init_fn, it make the operations in a atomic operation.
Using the follow method can easy reproduce this bug
1:dd if=/dev/sdb of=/dev/null
2:while true;do echo noop > scheduler;echo deadline > scheduler;done
The test method also use this method.
--- block/cfq-iosched.c | 17 ++++++++++++++--- block/deadline-iosched.c | 16 +++++++++++++--- block/elevator.c | 25 +++++-------------------- block/noop-iosched.c | 17 ++++++++++++++--- include/linux/elevator.h | 6 +++++- 5 files changed, 51 insertions(+), 30 deletions(-)
block/cfq-iosched.c +14 -3
@@ -4347,18 +4347,28 @@ static void cfq_exit_queue(struct elevatkfree (cfqd); } -static int cfq_init_queue (struct request_queue *q) +static int cfq_init_queue (struct request_queue *q,struct elevator_type *e) {struct cfq_data *cfqd;struct blkcg_gq *blkg__maybe_unused ;int i, ret; +struct elevator_queue *eq; + + eq =elevator_alloc (q, e); +if (!eq) +return -ENOMEM ; cfqd =kmalloc_node (sizeof (*cfqd),GFP_KERNEL | __GFP_ZERO, q->node); -if (!cfqd) +if (!cfqd) { +kobject_put (&eq->kobj);return -ENOMEM ; + } + eq->elevator_data = cfqd; cfqd->queue = q; - q->elevator->elevator_data = cfqd; +spin_lock_irq (q->queue_lock); + q->elevator = eq; +spin_unlock_irq (q->queue_lock);/* Init root service tree */ cfqd->grp_service_tree =CFQ_RB_ROOT ;
@@ -4433,6 +4443,7 @@ static int cfq_init_queue(struct request out_free:kfree (cfqd); +kobject_put (&eq->kobj);return ret; }
block/deadline-iosched.c +13 -3
@@ -337,13 +337,21 @@ static void deadline_exit_queue(struct e/* * initialize elevator private data (deadline_data). */ -static int deadline_init_queue (struct request_queue *q) +static int deadline_init_queue (struct request_queue *q,struct elevator_type *e) {struct deadline_data *dd; +struct elevator_queue *eq; + + eq =elevator_alloc (q, e); +if (!eq) +return -ENOMEM ; dd =kmalloc_node (sizeof (*dd),GFP_KERNEL | __GFP_ZERO, q->node); -if (!dd) +if (!dd) { +kobject_put (&eq->kobj);return -ENOMEM ; + } + eq->elevator_data = dd;INIT_LIST_HEAD (&dd->fifo_list[READ ]);INIT_LIST_HEAD (&dd->fifo_list[WRITE ]);
@@ -355,7 +363,9 @@ static int deadline_init_queue(struct re dd->front_merges =1 ; dd->fifo_batch = fifo_batch; - q->elevator->elevator_data = dd; +spin_lock_irq (q->queue_lock); + q->elevator = eq; +spin_unlock_irq (q->queue_lock);return 0 ; }
block/elevator.c +5 -20
@@ -150,7 +150,7 @@ void __init load_default_elevator_modulestatic struct kobj_type elv_ktype; -static struct elevator_queue *elevator_alloc (struct request_queue *q, +struct elevator_queue *elevator_alloc (struct request_queue *q,struct elevator_type *e) {struct elevator_queue *eq;
@@ -170,6 +170,7 @@ err:elevator_put (e);return NULL ; } +EXPORT_SYMBOL (elevator_alloc);static void elevator_release (struct kobject *kobj) {
@@ -221,16 +222,7 @@ int elevator_init(struct request_queue * } } - q->elevator =elevator_alloc (q, e); -if (!q->elevator) -return -ENOMEM ; - - err = e->ops.elevator_init_fn (q); -if (err) { -kobject_put (&q->elevator->kobj); -return err; - } - + err = e->ops.elevator_init_fn (q, e);return 0 ; }EXPORT_SYMBOL (elevator_init);
@@ -935,17 +927,10 @@ static int elevator_switch(struct requesspin_unlock_irq (q->queue_lock);/* allocate, init and register new elevator */ - err = -ENOMEM ; - q->elevator =elevator_alloc (q, new_e); -if (!q->elevator) + err = new_e->ops.elevator_init_fn (q, new_e); +if (err) goto fail_init; - err = new_e->ops.elevator_init_fn (q); -if (err) { -kobject_put (&q->elevator->kobj); - goto fail_init; - } -if (registered) { err =elv_register_queue (q);if (err)
block/noop-iosched.c +14 -3
@@ -59,16 +59,27 @@ noop_latter_request(struct request_queue return list_entry(rq->queuelist.next, struct request, queuelist); } -static int noop_init_queue (struct request_queue *q) +static int noop_init_queue (struct request_queue *q,struct elevator_type *e) {struct noop_data *nd; +struct elevator_queue *eq; + + eq =elevator_alloc (q, e); +if (!eq) +return -ENOMEM ; nd =kmalloc_node (sizeof (*nd),GFP_KERNEL , q->node); -if (!nd) +if (!nd) { +kobject_put (&eq->kobj);return -ENOMEM ; + } + eq->elevator_data = nd;INIT_LIST_HEAD (&nd->queue); - q->elevator->elevator_data = nd; + +spin_lock_irq (q->queue_lock); + q->elevator = eq; +spin_unlock_irq (q->queue_lock);return 0 ; }
include/linux/elevator.h +5 -1
@@ -7,6 +7,7 @@#ifdef CONFIG_BLOCK struct io_cq ; +struct elevator_type ;typedef int (elevator_merge_fn ) (struct request_queue *,struct request **,struct bio *);
@@ -35,7 +36,8 @@ typedef void (elevator_put_req_fn) (strutypedef void (elevator_activate_req_fn ) (struct request_queue *,struct request *);typedef void (elevator_deactivate_req_fn ) (struct request_queue *,struct request *); -typedef int (elevator_init_fn ) (struct request_queue *); +typedef int (elevator_init_fn ) (struct request_queue *, +struct elevator_type *e);typedef void (elevator_exit_fn ) (struct elevator_queue *);struct elevator_ops
@@ -155,6 +157,8 @@ extern int elevator_init(struct request_extern void elevator_exit (struct elevator_queue *);extern int elevator_change (struct request_queue *,const char *);extern bool elv_rq_merge_ok (struct request *,struct bio *); +extern struct elevator_queue *elevator_alloc (struct request_queue *, +struct elevator_type *);/* * Helper functions.
Greg Kroah-Hartman
maintainerPATCH 9/45 ARM: KVM: perform save/restore of PAR
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Zyngier <[email protected]>
commit 6a077e4ab9cbfbf279fb955bae05b03781c97013 upstream.
Not saving PAR is an unfortunate oversight. If the guest performs an AT* operation and gets scheduled out before reading the result of the translation from PAR, it could become corrupted by another guest or the host.
Saving this register is made slightly more complicated as KVM also uses it on the permission fault handling path, leading to an ugly "stash and restore" sequence. Fortunately, this is already a slow path so we don't really care. Also, Linux doesn't do any AT* operation, so Linux guests are not impacted by this bug.
[ Slightly tweaked to use an even register as first operand to ldrd
and strd operations in interrupts_head.S - Christoffer ]
--- arch/arm/include/asm/kvm_asm.h | 22 ++++++++++++---------- arch/arm/kvm/coproc.c | 4 ++++ arch/arm/kvm/interrupts.S | 12 +++++++++++- arch/arm/kvm/interrupts_head.S | 10 ++++++++-- 4 files changed, 35 insertions(+), 13 deletions(-)
arch/arm/include/asm/kvm_asm.h +12 -10
@@ -37,16 +37,18 @@#define c5_AIFSR 15/* Auxilary Instrunction Fault Status R */ #define c6_DFAR 16/* Data Fault Address Register */ #define c6_IFAR 17/* Instruction Fault Address Register */ -#define c9_L2CTLR 18/* Cortex A15 L2 Control Register */ -#define c10_PRRR 19/* Primary Region Remap Register */ -#define c10_NMRR 20/* Normal Memory Remap Register */ -#define c12_VBAR 21/* Vector Base Address Register */ -#define c13_CID 22/* Context ID Register */ -#define c13_TID_URW 23/* Thread ID, User R/W */ -#define c13_TID_URO 24/* Thread ID, User R/O */ -#define c13_TID_PRIV 25/* Thread ID, Privileged */ -#define c14_CNTKCTL 26/* Timer Control Register (PL1) */ -#define NR_CP15_REGS 27/* Number of regs (incl. invalid) */ +#define c7_PAR 18/* Physical Address Register */ +#define c7_PAR_high 19/* PAR top 32 bits */ +#define c9_L2CTLR 20/* Cortex A15 L2 Control Register */ +#define c10_PRRR 21/* Primary Region Remap Register */ +#define c10_NMRR 22/* Normal Memory Remap Register */ +#define c12_VBAR 23/* Vector Base Address Register */ +#define c13_CID 24/* Context ID Register */ +#define c13_TID_URW 25/* Thread ID, User R/W */ +#define c13_TID_URO 26/* Thread ID, User R/O */ +#define c13_TID_PRIV 27/* Thread ID, Privileged */ +#define c14_CNTKCTL 28/* Timer Control Register (PL1) */ +#define NR_CP15_REGS 29/* Number of regs (incl. invalid) */ #define ARM_EXCEPTION_RESET 0#define ARM_EXCEPTION_UNDEFINED 1
arch/arm/kvm/coproc.c +4 -0
@@ -180,6 +180,10 @@ static const struct coproc_reg cp15_regs NULL, reset_unknown, c6_DFAR }, {CRn (6 ),CRm (0 ),Op1 (0 ),Op2 (2 ), is32, NULL, reset_unknown, c6_IFAR }, + +/* PAR swapped by interrupt.S */ + { CRn( 7), Op1( 0), is64, NULL, reset_unknown64, c7_PAR }, +/* * DC{C,I,CI}SW operations: */
arch/arm/kvm/interrupts.S +11 -1
@@ -414,6 +414,10 @@ guest_trap: mrcne p15, 4, r2, c6, c0, 4 @ HPFAR bne 3f + /* Preserve PAR */ + mrrc p15, 0, r0, r1, c7 @ PAR + push {r0, r1} + /* Resolve IPA using the xFAR */ mcr p15, 0, r2, c7, c8, 0 @ ATS1CPR isb
@@ -424,13 +428,19 @@ guest_trap: lsl r2, r2, #4 orr r2, r2, r1, lsl #24 + /* Restore PAR */ + pop {r0, r1} + mcrr p15, 0, r0, r1, c7 @ PAR + 3: load_vcpu @ Load VCPU pointer to r0 str r2, [r0, #VCPU_HPFAR] 1: mov r1, #ARM_EXCEPTION_HVC b __kvm_vcpu_return -4: pop {r0, r1, r2} @ Failed translation, return to guest +4: pop {r0, r1} @ Failed translation, return to guest + mcrr p15, 0, r0, r1, c7 @ PAR + pop {r0, r1, r2} eret /*
arch/arm/kvm/interrupts_head.S +8 -2
@@ -302,11 +302,14 @@ vcpu .req r0 @ vcpu pointer always in r .endif mrc p15, 0, r2, c14, c1, 0 @ CNTKCTL + mrrc p15, 0, r4, r5, c7 @ PAR .if \store_to_vcpu == 0 - push {r2} + push {r2,r4-r5} .else str r2, [vcpu, #CP15_OFFSET(c14_CNTKCTL)] + add r12, vcpu, #CP15_OFFSET(c7_PAR) + strd r4, r5, [r12] .endif .endm
@@ -319,12 +322,15 @@ vcpu .req r0 @ vcpu pointer always in r */ .macro write_cp15_state read_from_vcpu .if \read_from_vcpu == 0 - pop {r2} + pop {r2,r4-r5} .else ldr r2, [vcpu, #CP15_OFFSET(c14_CNTKCTL)] + add r12, vcpu, #CP15_OFFSET(c7_PAR) + ldrd r4, r5, [r12] .endif mcr p15, 0, r2, c14, c1, 0 @ CNTKCTL + mcrr p15, 0, r4, r5, c7 @ PAR .if \read_from_vcpu == 0 pop {r2-r12}
Greg Kroah-Hartman
maintainerPATCH 10/45 ARM: KVM: add missing dsb before invalidating Stage-2 TLBs
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Zyngier <[email protected]>
commit 479c5ae2f8a55509b691494cd13691d3dc31d102 upstream.
When performing a Stage-2 TLB invalidation, it is necessary to make sure the write to the page tables is observable by all CPUs.
For this purpose, add a dsb instruction to __kvm_tlb_flush_vmid_ipa before doing the TLB invalidation itself.
--- arch/arm/kvm/interrupts.S | 1 + 1 file changed, 1 insertion(+)
arch/arm/kvm/interrupts.S +1 -0
@@ -49,6 +49,7 @@ __kvm_hyp_code_start: ENTRY(__kvm_tlb_flush_vmid_ipa) push {r2, r3} + dsb ishst add r0, r0, #KVM_VTTBR ldrd r2, r3, [r0] mcrr p15, 6, r2, r3, c2 @ Write VTTBR
Greg Kroah-Hartman
maintainerPATCH 11/45 ARM: KVM: clear exclusive monitor on all exception returns
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Zyngier <[email protected]>
commit 22cfbb6d730ca2fda236b507d9fba17bf002736c upstream.
Make sure we clear the exclusive monitor on all exception returns, which otherwise could lead to lock corruptions.
--- arch/arm/kvm/interrupts.S | 3 +++ 1 file changed, 3 insertions(+)
arch/arm/kvm/interrupts.S +3 -0
@@ -292,6 +292,7 @@ THUMB( orr r2, r2, #PSR_T_BIT ) ldr r2, =BSYM(panic) msr ELR_hyp, r2 ldr r0, =\panic_str + clrex @ Clear exclusive monitor eret .endm
@@ -441,6 +442,7 @@ guest_trap: 4: pop {r0, r1} @ Failed translation, return to guest mcrr p15, 0, r0, r1, c7 @ PAR + clrex pop {r0, r1, r2} eret
@@ -467,6 +469,7 @@ switch_to_guest_vfp: pop {r3-r7} pop {r0-r2} + clrex eret #endif
Greg Kroah-Hartman
maintainerPATCH 12/45 iwl4965: set power mode early
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanislaw Gruszka <[email protected]>
commit eca396d7a5bdcc1fd67b1b12f737c213ac78a6f4 upstream.
If device was put into a sleep and system was restarted or module reloaded, we have to wake device up before sending other commands. Otherwise it will fail to start with Microcode error.
--- drivers/net/wireless/iwlegacy/4965-mac.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/iwlegacy/4965-mac.c +3 -3
@@ -5316,6 +5316,9 @@ il4965_alive_start(struct il_priv *il) il->active_rate =RATES_MASK ; +il_power_update_mode (il, true); +D_INFO ("Updated power mode\n" ); +if (il_is_associated (il)) {struct il_rxon_cmd *active_rxon = (struct il_rxon_cmd *)&il->active;
@@ -5346,9 +5349,6 @@ il4965_alive_start(struct il_priv *il)D_INFO ("ALIVE processing complete.\n" );wake_up (&il->wait_command_queue); -il_power_update_mode (il, true); -D_INFO ("Updated power mode\n" ); -return ; restart:
Greg Kroah-Hartman
maintainerPATCH 13/45 iwl4965: reset firmware after rfkill off
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanislaw Gruszka <[email protected]>
commit 788f7a56fce1bcb2067b62b851a086fca48a0056 upstream.
Using rfkill switch can make firmware unstable, what cause various Microcode errors and kernel warnings. Reseting firmware just after rfkill off (radio on) helped with that.
Resolve:
https://bugzilla.redhat.com/show_bug.cgi?id=977053
--- drivers/net/wireless/iwlegacy/4965-mac.c | 10 +++++----- drivers/net/wireless/iwlegacy/common.c | 1 + 2 files changed, 6 insertions(+), 5 deletions(-)
drivers/net/wireless/iwlegacy/4965-mac.c +5 -5
@@ -4442,12 +4442,12 @@ il4965_irq_tasklet(struct il_priv *il)* is killed. Hence update the killswitch state here. The * rfkill handler will care about restarting if needed. */ -if (!test_bit (S_ALIVE , &il->status)) { -if (hw_rf_kill) -set_bit (S_RFKILL , &il->status); -else -clear_bit (S_RFKILL , &il->status); +if (hw_rf_kill) { +set_bit (S_RFKILL , &il->status); + }else { +clear_bit (S_RFKILL , &il->status);wiphy_rfkill_set_hw_state (il->hw->wiphy, hw_rf_kill); +il_force_reset (il, true); } handled |=CSR_INT_BIT_RF_KILL ;
drivers/net/wireless/iwlegacy/common.c +1 -0
@@ -4660,6 +4660,7 @@ il_force_reset(struct il_priv *il, boolreturn 0 ; } +EXPORT_SYMBOL (il_force_reset); int il_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
Greg Kroah-Hartman
maintainerPATCH 14/45 mac80211: ignore HT primary channel while connected
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
commit 5cdaed1e878d723d56d04ae0be1738124acf9f46 upstream.
While we're connected, the AP shouldn't change the primary channel in the HT information. We checked this, and dropped the connection if it did change it.
Unfortunately, this is causing problems on some APs, e.g. on the Netgear WRT610NL: the beacons seem to always contain a bad channel and if we made a connection using a probe response (correct data) we drop the connection immediately and can basically not connect properly at all.
Work around this by ignoring the HT primary channel information in beacons if we're already connected.
Also print out more verbose messages in the other situations to help diagnose similar bugs quicker in the future.
--- net/mac80211/mlme.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)
net/mac80211/mlme.c +13 -13
@@ -237,8 +237,9 @@ ieee80211_determine_chantype(struct ieeestruct ieee80211_channel *channel, const struct ieee80211_ht_operation *ht_oper, const struct ieee80211_vht_operation *vht_oper, - struct cfg80211_chan_def *chandef, bool verbose) + struct cfg80211_chan_def *chandef, bool tracking) { + struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;struct cfg80211_chan_def vht_chandef;u32 ht_cfreq, ret;
@@ -257,7 +258,7 @@ ieee80211_determine_chantype(struct ieee ht_cfreq =ieee80211_channel_to_frequency (ht_oper->primary_chan, channel->band);/* check that channel matches the right operating channel */ -if (channel->center_freq != ht_cfreq) { +if (!tracking && channel->center_freq != ht_cfreq) {/* * It's possible that some APs are confused here; * Netgear WNDR3700 sometimes reports 4 higher than
@@ -265,11 +266,10 @@ ieee80211_determine_chantype(struct ieee* since we look at probe response/beacon data here * it should be OK. */ -if (verbose) -sdata_info (sdata, -"Wrong control channel: center-freq: %d ht-cfreq: %d ht->primary_chan: %d band: %d - Disabling HT\n" , - channel->center_freq, ht_cfreq, - ht_oper->primary_chan, channel->band); +sdata_info (sdata, +"Wrong control channel: center-freq: %d ht-cfreq: %d ht->primary_chan: %d band: %d - Disabling HT\n" , + channel->center_freq, ht_cfreq, + ht_oper->primary_chan, channel->band); ret =IEEE80211_STA_DISABLE_HT |IEEE80211_STA_DISABLE_VHT ; goto out; }
@@ -323,7 +323,7 @@ ieee80211_determine_chantype(struct ieee channel->band);break ;default : -if (verbose) +if (!(ifmgd->flags &IEEE80211_STA_DISABLE_VHT ))sdata_info (sdata,"AP VHT operation IE has invalid channel width (%d), disable VHT\n" , vht_oper->chan_width);
@@ -332,7 +332,7 @@ ieee80211_determine_chantype(struct ieee }if (!cfg80211_chandef_valid (&vht_chandef)) { -if (verbose) +if (!(ifmgd->flags &IEEE80211_STA_DISABLE_VHT ))sdata_info (sdata,"AP VHT information is invalid, disable VHT\n" ); ret =IEEE80211_STA_DISABLE_VHT ;
@@ -345,7 +345,7 @@ ieee80211_determine_chantype(struct ieee }if (!cfg80211_chandef_compatible (chandef, &vht_chandef)) { -if (verbose) +if (!(ifmgd->flags &IEEE80211_STA_DISABLE_VHT ))sdata_info (sdata,"AP VHT information doesn't match HT, disable VHT\n" ); ret =IEEE80211_STA_DISABLE_VHT ;
@@ -372,7 +372,7 @@ out: ret |=chandef_downgrade (chandef); } -if (chandef->width != vht_chandef.width && verbose) +if (chandef->width != vht_chandef.width && !tracking)sdata_info (sdata,"capabilities/regulatory prevented using AP HT/VHT configuration, downgraded\n" );
@@ -412,7 +412,7 @@ static int ieee80211_config_bw(struct ie/* calculate new channel (type) based on HT/VHT operation IEs */ flags =ieee80211_determine_chantype (sdata, sband, chan, ht_oper, - vht_oper, &chandef, false); + vht_oper, &chandef, true);/* * Downgrade the new channel if we associated with restricted
@@ -3906,7 +3906,7 @@ static int ieee80211_prep_channel(struct ifmgd->flags |=ieee80211_determine_chantype (sdata, sband, cbss->channel, ht_oper, vht_oper, - &chandef, true); + &chandef, false); sdata->needed_rx_chains =min (ieee80211_ht_vht_rx_chains (sdata, cbss), local->rx_chains);
Greg Kroah-Hartman
maintainerPATCH 15/45 mac80211: fix infinite loop in ieee80211_determine_chantype
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Wright <[email protected]>
commit b56e4b857c5210e848bfb80e074e5756a36cd523 upstream.
Commit "3d9646d mac80211: fix channel selection bug" introduced a possible infinite loop by moving the out target above the chandef_downgrade while loop. When we downgrade to NL80211_CHAN_WIDTH_20_NOHT, we jump back up to re-run the while loop...indefinitely. Replace goto with break and carry on. This may not be sufficient to connect to the AP, but will at least keep the cpu from livelocking. Thanks to Derek Atkins as an extra pair of debugging eyes.
--- net/mac80211/mlme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/mlme.c +1 -1
@@ -366,7 +366,7 @@ out:if (WARN_ON (chandef->width ==NL80211_CHAN_WIDTH_20_NOHT )) { ret =IEEE80211_STA_DISABLE_HT |IEEE80211_STA_DISABLE_VHT ; - goto out; +break ; } ret |=chandef_downgrade (chandef);
Greg Kroah-Hartman
maintainerPATCH 16/45 mac80211: continue using disabled channels while connected
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
commit ddfe49b42d8ad4bfdf92d63d4a74f162660d878d upstream.
In case the AP has different regulatory information than we do, it can happen that we connect to an AP based on e.g. the world roaming regulatory data, and then update our database with the AP's country information disables the channel the AP is using. If this happens on an HT AP, the bandwidth tracking code will hit the WARN_ON() and disconnect. Since that's not very useful, ignore the channel-disable flag in bandwidth tracking.
--- net/mac80211/mlme.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
net/mac80211/mlme.c +10 -1
@@ -361,8 +361,17 @@ out:if (ret &IEEE80211_STA_DISABLE_VHT ) vht_chandef = *chandef; +/* +* Ignore the DISABLED flag when we're already connected and only +* tracking the APs beacon for bandwidth changes - otherwise we +* might get disconnected here if we connect to an AP, update our +* regulatory information based on the AP's country IE and the +* information we have is wrong/outdated and disables the channel +* that we're actually using for the connection to the AP. +*/ while (!cfg80211_chandef_usable (sdata->local->hw.wiphy, chandef, -IEEE80211_CHAN_DISABLED )) { + tracking ?0 : +IEEE80211_CHAN_DISABLED )) {if (WARN_ON (chandef->width ==NL80211_CHAN_WIDTH_20_NOHT )) { ret =IEEE80211_STA_DISABLE_HT |IEEE80211_STA_DISABLE_VHT ;
Greg Kroah-Hartman
maintainerPATCH 17/45 can: pcan_usb: fix wrong memcpy() bytes length
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephane Grosjean <[email protected]>
commit 3c322a56b01695df15c70bfdc2d02e0ccd80654e upstream.
Fix possibly wrong memcpy() bytes length since some CAN records received from PCAN-USB could define a DLC field in range [9..15].
In that case, the real DLC value MUST be used to move forward the record pointer but, only 8 bytes max. MUST be copied into the data field of the struct can_frame object of the skb given to the network core.
--- drivers/net/can/usb/peak_usb/pcan_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/usb/peak_usb/pcan_usb.c +1 -1
@@ -649,7 +649,7 @@ static int pcan_usb_decode_data(struct pif ((mc->ptr + rec_len) > mc->end) goto decode_failed; -memcpy (cf->data, mc->ptr, rec_len); +memcpy (cf->data, mc->ptr, cf->can_dlc); mc->ptr += rec_len; }
Greg Kroah-Hartman
maintainerPATCH 18/45 genetlink: fix family dump race
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
commit 58ad436fcf49810aa006016107f494c9ac9013db upstream.
When dumping generic netlink families, only the first dump call is locked with genl_lock(), which protects the list of families, and thus subsequent calls can access the data without locking, racing against family addition/removal. This can cause a crash. Fix it - the locking needs to be conditional because the first time around it's already locked.
A similar bug was reported to me on an old kernel (3.4.47) but the exact scenario that happened there is no longer possible, on those kernels the first round wasn't locked either. Looking at the current code I found the race described above, which had also existed on the old kernel.
--- net/netlink/genetlink.c | 7 +++++++ 1 file changed, 7 insertions(+)
net/netlink/genetlink.c +7 -0
@@ -789,6 +789,10 @@ static int ctrl_dumpfamily(struct sk_bufstruct net *net =sock_net (skb->sk);int chains_to_skip = cb->args[0 ];int fams_to_skip = cb->args[1 ]; +bool need_locking = chains_to_skip || fams_to_skip; + +if (need_locking) +genl_lock ();for (i = chains_to_skip; i <GENL_FAM_TAB_SIZE ; i++) { n =0 ;
@@ -810,6 +814,9 @@ errout: cb->args[0 ] = i; cb->args[1 ] = n; +if (need_locking) +genl_unlock (); +return skb->len; }
Greg Kroah-Hartman
maintainerPATCH 19/45 cfg80211: fix P2P GO interface teardown
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
commit 74418edec915d0f446debebde08d170c7b8ba0ee upstream.
When a P2P GO interface goes down, cfg80211 doesn't properly tear it down, leading to warnings later. Add the GO interface type to the enumeration to tear it down like AP interfaces. Otherwise, we leave it pending and mac80211's state can get very confused, leading to warnings later.
--- net/wireless/core.c | 1 + 1 file changed, 1 insertion(+)
net/wireless/core.c +1 -0
@@ -876,6 +876,7 @@ void cfg80211_leave(struct cfg80211_regicfg80211_leave_mesh (rdev, dev);break ;case NL80211_IFTYPE_AP : +case NL80211_IFTYPE_P2P_GO :cfg80211_stop_ap (rdev, dev);break ;default :
Greg Kroah-Hartman
maintainerPATCH 20/45 ASoC: dapm: Fix empty list check in dapm_new_mux()
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lars-Peter Clausen <[email protected]>
commit fe581391147cb3d738d961d0f1233d91a9e1113c upstream.
list_first_entry() will always return a valid pointer, even if the list is empty. So the check whether path is NULL will always be false. So we end up calling dapm_create_or_share_mixmux_kcontrol() with a path struct that points right in the middle of the widget struct and by trying to modify the path the widgets memory will become corrupted. Fix this by using list_emtpy() to check if the widget doesn't have any paths.
--- sound/soc/soc-dapm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
sound/soc/soc-dapm.c +4 -3
@@ -682,13 +682,14 @@ static int dapm_new_mux(struct snd_soc_dreturn -EINVAL ; } - path = list_first_entry(&w->sources, struct snd_soc_dapm_path, - list_sink); -if (!path) { +if (list_empty (&w->sources)) {dev_err (dapm->dev,"ASoC: mux %s has no paths\n" , w->name);return -EINVAL ; } + path = list_first_entry(&w->sources, struct snd_soc_dapm_path, + list_sink); + ret =dapm_create_or_share_mixmux_kcontrol (w,0 , path);if (ret <0 )return ret;
Greg Kroah-Hartman
maintainerPATCH 21/45 ASoC: cs42l52: Reorder Min/Max and update to SX_TLV for Beep Volume
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Brian Austin <[email protected]>
commit e2c98a8bba958045bde861fe1d66be54315c7790 upstream.
Beep Volume Min/Max was backwards.
Change to SOC_SONGLE_SX_TLV for correct volume representation
--- sound/soc/codecs/cs42l52.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/cs42l52.c +1 -1
@@ -451,7 +451,7 @@ static const struct snd_kcontrol_new cs4SOC_ENUM ("Beep Pitch" , beep_pitch_enum),SOC_ENUM ("Beep on Time" , beep_ontime_enum),SOC_ENUM ("Beep off Time" , beep_offtime_enum), -SOC_SINGLE_TLV ("Beep Volume" ,CS42L52_BEEP_VOL ,0 ,0x1f ,0x07 , hl_tlv), +SOC_SINGLE_SX_TLV ("Beep Volume" ,CS42L52_BEEP_VOL ,0 ,0x07 ,0x1f , hl_tlv),SOC_SINGLE ("Beep Mixer Switch" ,CS42L52_BEEP_TONE_CTL ,5 ,1 ,1 ),SOC_ENUM ("Beep Treble Corner Freq" , beep_treble_enum), SOC_ENUM("Beep Bass Corner Freq", beep_bass_enum),
Greg Kroah-Hartman
maintainerPATCH 22/45 ASoC: tegra: fix Tegra30 I2S capture parameter setup
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Warren <[email protected]>
commit c90c0d7a96e634a73ef1580f1d20993606545647 upstream.
The Tegra30 I2S driver was writing the AHUB interface parameters to the playback path register rather than the capture path register. This caused the capture parameters not to be configured at all, so if capturing using non-HW-default parameters (e.g. 16-bit stereo rather than 8-bit mono) the audio would be corrupted.
With this fixed, audio capture from an analog microphone works correctly on the Cardhu board.
--- sound/soc/tegra/tegra30_i2s.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/tegra/tegra30_i2s.c +1 -1
@@ -228,7 +228,7 @@ static int tegra30_i2s_hw_params(struct reg =TEGRA30_I2S_CIF_RX_CTRL ; }else { val |=TEGRA30_AUDIOCIF_CTRL_DIRECTION_TX ; - reg =TEGRA30_I2S_CIF_RX_CTRL ; + reg =TEGRA30_I2S_CIF_TX_CTRL ; }regmap_write (i2s->regmap, reg, val);
Greg Kroah-Hartman
maintainerPATCH 23/45 ALSA: usb-audio: Fix invalid volume resolution for Logitech HD Webcam C525
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Maksim A. Boyko" <[email protected]>
commit 140d37de62ffe8405282a1d6498f3b4099006384 upstream.
Add the volume control quirk for avoiding the kernel warning for the Logitech HD Webcam C525
as in the similar commit 36691e1be6ec551eef4a5225f126a281f8c051c2 for the Logitech HD Webcam C310.
--- sound/usb/mixer.c | 1 + 1 file changed, 1 insertion(+)
sound/usb/mixer.c +1 -0
@@ -888,6 +888,7 @@ static void volume_control_quirks(structcase USB_ID (0x046d ,0x081b ):/* HD Webcam c310 */ case USB_ID (0x046d ,0x081d ):/* HD Webcam c510 */ case USB_ID (0x046d ,0x0825 ):/* HD Webcam c270 */ +case USB_ID (0x046d ,0x0826 ):/* HD Webcam c525 */ case USB_ID (0x046d ,0x0991 ):/* Most audio usb devices lie about volume resolution. * Most Logitech webcams have res = 384.
Greg Kroah-Hartman
maintainerPATCH 24/45 ALSA: 6fire: make buffers DMA-able (pcm)
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Torsten Schenk <[email protected]>
commit 5ece263f1d93fba8d992e67e3ab8a71acf674db9 upstream.
Patch makes pcm buffers DMA-able by allocating each one separately.
--- sound/usb/6fire/pcm.c | 41 ++++++++++++++++++++++++++++++++++++++++- sound/usb/6fire/pcm.h | 2 +- 2 files changed, 41 insertions(+), 2 deletions(-)
sound/usb/6fire/pcm.c +40 -1
@@ -580,6 +580,33 @@ static void usb6fire_pcm_init_urb(struct urb->instance.number_of_packets =PCM_N_PACKETS_PER_URB ; } +static int usb6fire_pcm_buffers_init (struct pcm_runtime *rt) +{ +int i; + +for (i =0 ; i <PCM_N_URBS ; i++) { + rt->out_urbs[i].buffer =kzalloc (PCM_N_PACKETS_PER_URB + *PCM_MAX_PACKET_SIZE ,GFP_KERNEL ); +if (!rt->out_urbs[i].buffer) +return -ENOMEM ; + rt->in_urbs[i].buffer =kzalloc (PCM_N_PACKETS_PER_URB + *PCM_MAX_PACKET_SIZE ,GFP_KERNEL ); +if (!rt->in_urbs[i].buffer) +return -ENOMEM ; + } +return 0 ; +} + +static void usb6fire_pcm_buffers_destroy (struct pcm_runtime *rt) +{ +int i; + +for (i =0 ; i <PCM_N_URBS ; i++) { +kfree (rt->out_urbs[i].buffer); +kfree (rt->in_urbs[i].buffer); + } +} +int usb6fire_pcm_init (struct sfire_chip *chip) {int i;
@@ -591,6 +618,13 @@ int usb6fire_pcm_init(struct sfire_chipif (!rt)return -ENOMEM ; + ret =usb6fire_pcm_buffers_init (rt); +if (ret) { +usb6fire_pcm_buffers_destroy (rt); +kfree (rt); +return ret; + } + rt->chip = chip; rt->stream_state =STREAM_DISABLED ; rt->rate =ARRAY_SIZE (rates);
@@ -612,6 +646,7 @@ int usb6fire_pcm_init(struct sfire_chip ret =snd_pcm_new (chip->card,"DMX6FireUSB" ,0 ,1 ,1 , &pcm);if (ret <0 ) { +usb6fire_pcm_buffers_destroy (rt);kfree (rt); snd_printk(KERN_ERR PREFIX "cannot create pcm instance.\n");return ret;
@@ -627,6 +662,7 @@ int usb6fire_pcm_init(struct sfire_chipsnd_dma_continuous_data (GFP_KERNEL ), MAX_BUFSIZE, MAX_BUFSIZE);if (ret) { +usb6fire_pcm_buffers_destroy (rt);kfree (rt); snd_printk(KERN_ERR PREFIX "error preallocating pcm buffers.\n");
@@ -671,6 +707,9 @@ void usb6fire_pcm_abort(struct sfire_chivoid usb6fire_pcm_destroy (struct sfire_chip *chip) { -kfree (chip->pcm); +struct pcm_runtime *rt = chip->pcm; + +usb6fire_pcm_buffers_destroy (rt); +kfree (rt); chip->pcm =NULL ; }
sound/usb/6fire/pcm.h +1 -1
@@ -32,7 +32,7 @@ struct pcm_urb {struct urb instance;struct usb_iso_packet_descriptor packets[PCM_N_PACKETS_PER_URB ];/* END DO NOT SEPARATE */ -u8 buffer[PCM_N_PACKETS_PER_URB *PCM_MAX_PACKET_SIZE ]; +u8 *buffer;struct pcm_urb *peer; };
Greg Kroah-Hartman
maintainerPATCH 25/45 ALSA: 6fire: make buffers DMA-able (midi)
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Torsten Schenk <[email protected]>
commit 4c2aee0032b70083dafebd733ed9c774633b2fa3 upstream.
Patch makes midi output buffer DMA-able by allocating it separately.
--- sound/usb/6fire/midi.c | 16 +++++++++++++++- sound/usb/6fire/midi.h | 6 +----- 2 files changed, 16 insertions(+), 6 deletions(-)
sound/usb/6fire/midi.c +15 -1
@@ -19,6 +19,10 @@#include "chip.h" #include "comm.h" +enum { +MIDI_BUFSIZE =64 +}; +static void usb6fire_midi_out_handler (struct urb *urb) {struct midi_runtime *rt = urb->context;
@@ -156,6 +160,12 @@ int usb6fire_midi_init(struct sfire_chipif (!rt)return -ENOMEM ; + rt->out_buffer =kzalloc (MIDI_BUFSIZE ,GFP_KERNEL ); +if (!rt->out_buffer) { +kfree (rt); +return -ENOMEM ; + } + rt->chip = chip; rt->in_received = usb6fire_midi_in_received; rt->out_buffer[0 ] =0x80 ;/* 'send midi' command */
@@ -169,6 +179,7 @@ int usb6fire_midi_init(struct sfire_chip ret =snd_rawmidi_new (chip->card,"6FireUSB" ,0 ,1 ,1 , &rt->instance);if (ret <0 ) { +kfree (rt->out_buffer);kfree (rt); snd_printk(KERN_ERR PREFIX "unable to create midi.\n");return ret;
@@ -197,6 +208,9 @@ void usb6fire_midi_abort(struct sfire_chvoid usb6fire_midi_destroy (struct sfire_chip *chip) { -kfree (chip->midi); +struct midi_runtime *rt = chip->midi; + +kfree (rt->out_buffer); +kfree (rt); chip->midi =NULL ; }
sound/usb/6fire/midi.h +1 -5
@@ -16,10 +16,6 @@#include "common.h" -enum { -MIDI_BUFSIZE =64 -}; -struct midi_runtime {struct sfire_chip *chip;struct snd_rawmidi *instance;
@@ -32,7 +28,7 @@ struct midi_runtime {struct snd_rawmidi_substream *out;struct urb out_urb;u8 out_serial;/* serial number of out packet */ -u8 out_buffer[MIDI_BUFSIZE ]; +u8 *out_buffer;int buffer_offset;void (*in_received)(struct midi_runtime *rt,u8 *data,int length);
Greg Kroah-Hartman
maintainerPATCH 26/45 ALSA: hda - Fix missing mute controls for CX5051
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit f69910ddbd8c29391958cf82b598dd78fe5c8640 upstream.
We've added a fake mute control (setting the amp volume to zero) for CX5051 at commit [3868137e: ALSA: hda - Add a fake mute feature], but this feature was overlooked in the generic parser implementation. Now the driver lacks of mute controls on these codecs.
The fix is just to check both AC_AMPCAP_MUTE and AC_AMPCAP_MIN_MUTE bits in each place checking the amp capabilities.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=59001
--- sound/pci/hda/hda_generic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/pci/hda/hda_generic.c +3 -3
@@ -519,7 +519,7 @@ static bool same_amp_caps(struct hda_cod }#define nid_has_mute (codec, nid, dir) \ - check_amp_caps(codec, nid, dir, AC_AMPCAP_MUTE) + check_amp_caps(codec, nid, dir, (AC_AMPCAP_MUTE | AC_AMPCAP_MIN_MUTE))#define nid_has_volume (codec, nid, dir) \ check_amp_caps(codec, nid, dir, AC_AMPCAP_NUM_STEPS)
@@ -621,7 +621,7 @@ static int get_amp_val_to_activate(strucif (enable) val = (caps &AC_AMPCAP_OFFSET ) >>AC_AMPCAP_OFFSET_SHIFT ; } -if (caps &AC_AMPCAP_MUTE ) { +if (caps & (AC_AMPCAP_MUTE |AC_AMPCAP_MIN_MUTE )) {if (!enable) val |=HDA_AMP_MUTE ; }
@@ -645,7 +645,7 @@ static unsigned int get_amp_mask_to_modi {unsigned int mask =0xff ; -if (caps &AC_AMPCAP_MUTE ) { +if (caps & (AC_AMPCAP_MUTE |AC_AMPCAP_MIN_MUTE )) {if (is_ctl_associated (codec, nid, dir, idx,NID_PATH_MUTE_CTL )) mask &= ~0x80 ; }
Greg Kroah-Hartman
maintainerPATCH 27/45 ALSA: hda - Add pinfix for LG LW25 laptop
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit db8a38e5063a4daf61252e65d47ab3495c705f4c upstream.
Correct the pins for a line-in and a headphone on LG LW25 laptop with ALC880 codec. Other pins seem fine.
--- sound/pci/hda/patch_realtek.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
sound/pci/hda/patch_realtek.c +10 -0
@@ -1027,6 +1027,7 @@ enum {ALC880_FIXUP_GPIO2 ,ALC880_FIXUP_MEDION_RIM ,ALC880_FIXUP_LG , +ALC880_FIXUP_LG_LW25 ,ALC880_FIXUP_W810 ,ALC880_FIXUP_EAPD_COEF , ALC880_FIXUP_TCL_S700,
@@ -1085,6 +1086,14 @@ static const struct hda_fixup alc880_fix { } } }, + [ALC880_FIXUP_LG_LW25] = { + .type = HDA_FIXUP_PINS, + .v.pins = (const struct hda_pintbl[]) { + { 0x1a, 0x0181344f }, /* line-in */ + { 0x1b, 0x0321403f }, /* headphone */ + { } + } + }, [ALC880_FIXUP_W810] = { .type = HDA_FIXUP_PINS, .v.pins = (const struct hda_pintbl[]) {
@@ -1337,6 +1346,7 @@ static const struct snd_pci_quirk alc880SND_PCI_QUIRK (0x1854 ,0x003b ,"LG" ,ALC880_FIXUP_LG ),SND_PCI_QUIRK (0x1854 ,0x005f ,"LG P1 Express" ,ALC880_FIXUP_LG ),SND_PCI_QUIRK (0x1854 ,0x0068 ,"LG w1" ,ALC880_FIXUP_LG ), +SND_PCI_QUIRK (0x1854 ,0x0077 ,"LG LW25" ,ALC880_FIXUP_LG_LW25 ), SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),/* Below is the copied entries from alc880_quirks.c.
Greg Kroah-Hartman
maintainerPATCH 28/45 ALSA: hda - Add a fixup for Gateway LT27
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 1801928e0f99d94c55e33c584c5eb2ff5e246ee6 upstream.
Gateway LT27 needs a fixup for the inverted digital mic.
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -4210,6 +4210,7 @@ static const struct snd_pci_quirk alc662SND_PCI_QUIRK (0x1025 ,0x0308 ,"Acer Aspire 8942G" ,ALC662_FIXUP_ASPIRE ),SND_PCI_QUIRK (0x1025 ,0x031c ,"Gateway NV79" ,ALC662_FIXUP_SKU_IGNORE ),SND_PCI_QUIRK (0x1025 ,0x0349 ,"eMachines eM250" ,ALC662_FIXUP_INV_DMIC ), +SND_PCI_QUIRK (0x1025 ,0x034a ,"Gateway LT27" ,ALC662_FIXUP_INV_DMIC ),SND_PCI_QUIRK (0x1025 ,0x038b ,"Acer Aspire 8943G" ,ALC662_FIXUP_ASPIRE ),SND_PCI_QUIRK (0x1028 ,0x05d8 ,"Dell" ,ALC668_FIXUP_DELL_MIC_NO_PRESENCE ), SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
Re: [ 28/45] ALSA: hda - Add a fixup for Gateway LT27
No objection, other than that I submitted a revision to that patch... Added an additional piece of hardware. The full patch should be include two lines.
Quoted 31 lines · Greg Kroah-Hartman
3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit
1801928e0f99d94c55e33c584c5eb2ff5e246ee6upstream.Gateway LT27 needs a fixup for the inverted digital mic.
Reported-by "Nathanael D. Noblet" <[email protected]>Signed-off-by Takashi Iwai <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)sound/pci/hda/patch_realtek.c +1
-0@@ -4210,6 +4210,7 @@ static const struct snd_pci_quirk alc662SND_PCI_QUIRK (0x1025 ,0x0308 ,"Acer Aspire 8942G" ,ALC662_FIXUP_ASPIRE ),SND_PCI_QUIRK (0x1025 ,0x031c ,"Gateway NV79" ,ALC662_FIXUP_SKU_IGNORE ),SND_PCI_QUIRK (0x1025 ,0x0349 ,"eMachines eM250" ,ALC662_FIXUP_INV_DMIC ), +SND_PCI_QUIRK (0x1025 ,0x034a ,"Gateway LT27" ,ALC662_FIXUP_INV_DMIC ),SND_PCI_QUIRK (0x1025 ,0x038b ,"Acer Aspire 8943G" ,ALC662_FIXUP_ASPIRE ),SND_PCI_QUIRK (0x1028 ,0x05d8 ,"Dell" ,ALC668_FIXUP_DELL_MIC_NO_PRESENCE ), SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
Signature · 2 lines
Nathanael d. Noblet t 403.875.4613
sound/pci/hda/patch_realtek.c +2 -0
@@ -4208,6 +4208,8 @@SND_PCI_QUIRK (0x17aa ,0x3a0d ,"Lenovo Ideapad Y550" ,ALC662_FIXUP_IDEAPAD ),SND_PCI_QUIRK (0x19da ,0xa130 ,"Zotac Z68" ,ALC662_FIXUP_ZOTAC_Z68 ),SND_PCI_QUIRK (0x1b35 ,0x2206 ,"CZC P10T" ,ALC662_FIXUP_CZC_P10T ), +SND_PCI_QUIRK (0x1025 ,0x034a ,"Gateway LT27" ,ALC662_FIXUP_INV_DMIC ), +SND_PCI_QUIRK (0x1025 ,0x022f ,"Acer Aspire One" ,ALC662_FIXUP_INV_DMIC ), #if 0/* Below is a quirk table taken from the old code.
Greg Kroah-Hartman
maintainerRe: [ 28/45] ALSA: hda - Add a fixup for Gateway LT27
Quoted 3 lines · Nathanael D. Noblet
No objection, other than that I submitted a revision to that patch... Added an additional piece of hardware. The full patch should be include two lines.
That patch needs to get into Linus's tree before I can add it to the stable tree.
thanks,
greg k-h
Re: [ 28/45] ALSA: hda - Add a fixup for Gateway LT27
At Mon, 19 Aug 2013 10:48:06 -0700,
Quoted 8 lines · Greg Kroah-Hartman
Quoted 3 lines · Nathanael D. Noblet
No objection, other than that I submitted a revision to that patch... Added an additional piece of hardware. The full patch should be include two lines.
That patch needs to get into Linus's tree before I can add it to the stable tree.
Don't worry, the patch was applied now. It'll be included in either 3.11-rc7 or 3.12-rc1.
thanks,
Takashi
Greg Kroah-Hartman
maintainerPATCH 29/45 nl80211: fix another nl80211_fam.attrbuf race
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
commit c319d50bfcf678c2857038276d9fab3c6646f3bf upstream.
This is similar to the race Linus had reported, but in this case it's an older bug: nl80211_prepare_wdev_dump() uses the wiphy index in cb->args[0] as it is and thus parses the message over and over again instead of just once because 0 is the first valid wiphy index. Similar code in nl80211_testmode_dump() correctly offsets the wiphy_index by 1, do that here as well.
--- net/wireless/nl80211.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
net/wireless/nl80211.c +4 -2
@@ -471,10 +471,12 @@ static int nl80211_prepare_wdev_dump(str goto out_unlock; } *rdev =wiphy_to_dev ((*wdev)->wiphy); - cb->args[0 ] = (*rdev)->wiphy_idx; +/* 0 is the first index - add 1 to parse only once */ + cb->args[0 ] = (*rdev)->wiphy_idx +1 ; cb->args[1 ] = (*wdev)->identifier; }else { -struct wiphy *wiphy =wiphy_idx_to_wiphy (cb->args[0 ]); +/* subtract the 1 again here */ +struct wiphy *wiphy =wiphy_idx_to_wiphy (cb->args[0 ] -1 );struct wireless_dev *tmp;if (!wiphy) {
Greg Kroah-Hartman
maintainerPATCH 30/45 usb: add two quirky touchscreen
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oliver Neukum <[email protected]>
commit 304ab4ab079a8ed03ce39f1d274964a532db036b upstream.
These devices tend to become unresponsive after S3
--- drivers/usb/core/quirks.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/usb/core/quirks.c +6 -0
@@ -78,6 +78,12 @@ static const struct usb_device_id usb_qu { USB_DEVICE(0x04d8, 0x000c), .driver_info = USB_QUIRK_CONFIG_INTF_STRINGS }, + /* CarrolTouch 4000U */ + { USB_DEVICE(0x04e7, 0x0009), .driver_info = USB_QUIRK_RESET_RESUME }, + + /* CarrolTouch 4500U */ + { USB_DEVICE(0x04e7, 0x0030), .driver_info = USB_QUIRK_RESET_RESUME }, + /* Samsung Android phone modem - ID conflict with SPH-I500 */ { USB_DEVICE(0x04e8, 0x6601), .driver_info = USB_QUIRK_CONFIG_INTF_STRINGS },
Greg Kroah-Hartman
maintainerPATCH 31/45 USB: ti_usb_3410_5052: fix big-endian firmware handling
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit e877dd2f2581628b7119df707d4cf03d940cff49 upstream.
Fix endianess bugs in firmware handling introduced by commits cb7a7c6a ("ti_usb_3410_5052: add Multi-Tech modem support") and 05a3d905 ("ti_usb_3410_5052: support alternate firmware") which made the driver use the wrong firmware for certain devices on big-endian machines.
--- drivers/usb/serial/ti_usb_3410_5052.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/usb/serial/ti_usb_3410_5052.c +5 -4
@@ -1536,14 +1536,15 @@ static int ti_download_firmware(struct tchar buf[32 ];/* try ID specific firmware first, then try generic firmware */ -sprintf (buf,"ti_usb-v%04x-p%04x.fw" , dev->descriptor.idVendor, - dev->descriptor.idProduct); +sprintf (buf,"ti_usb-v%04x-p%04x.fw" , +le16_to_cpu (dev->descriptor.idVendor), +le16_to_cpu (dev->descriptor.idProduct)); status =request_firmware (&fw_p, buf, &dev->dev);if (status !=0 ) { buf[0 ] ='\0' ; -if (dev->descriptor.idVendor ==MTS_VENDOR_ID ) { -switch (dev->descriptor.idProduct) { +if (le16_to_cpu (dev->descriptor.idVendor) ==MTS_VENDOR_ID ) { +switch (le16_to_cpu (dev->descriptor.idProduct)) {case MTS_CDMA_PRODUCT_ID :strcpy (buf,"mts_cdma.fw" );break ;
Greg Kroah-Hartman
maintainerPATCH 32/45 USB: mos7840: fix big-endian probe
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit d551ec9b690f3de65b0091a2e767f1382adc792d upstream.
Fix bug in device-type detection on big-endian machines originally introduced by commit 0eafe4de ("USB: serial: mos7840: add support for MCS7810 devices") which always matched on little-endian product ids.
--- drivers/usb/serial/mos7840.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/serial/mos7840.c +1 -1
@@ -2208,7 +2208,7 @@ static int mos7810_check(struct usb_seristatic int mos7840_probe (struct usb_serial *serial,const struct usb_device_id *id) { -u16 product = serial->dev->descriptor.idProduct; +u16 product =le16_to_cpu (serial->dev->descriptor.idProduct);u8 *buf;int device_type;
Greg Kroah-Hartman
maintainerPATCH 33/45 USB: mos7720: fix broken control requests
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit ef6c8c1d733e244f0499035be0dabe1f4ed98c6f upstream.
The parallel-port code of the drivers used a stack allocated control-request buffer for asynchronous (and possibly deferred) control requests. This not only violates the no-DMA-from-stack requirement but could also lead to corrupt control requests being submitted.
--- drivers/usb/serial/mos7720.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
drivers/usb/serial/mos7720.c +14 -7
@@ -90,6 +90,7 @@ struct urbtracker {struct list_head urblist_entry;struct kref ref_count;struct urb *urb; +struct usb_ctrlrequest *setup; };enum mos7715_pp_modes {
@@ -271,6 +272,7 @@ static void destroy_urbtracker(struct krstruct mos7715_parport *mos_parport = urbtrack->mos_parport;usb_free_urb (urbtrack->urb); +kfree (urbtrack->setup);kfree (urbtrack);kref_put (&mos_parport->ref_count, destroy_mos_parport); }
@@ -355,7 +357,6 @@ static int write_parport_reg_nonblock(ststruct urbtracker *urbtrack;int ret_val;unsigned long flags; -struct usb_ctrlrequest setup;struct usb_serial *serial = mos_parport->serial;struct usb_device *usbdev = serial->dev;
@@ -373,14 +374,20 @@ static int write_parport_reg_nonblock(stkfree (urbtrack);return -ENOMEM ; } - setup.bRequestType = (__u8 )0x40 ; - setup.bRequest = (__u8 )0x0e ; - setup.wValue =get_reg_value (reg, dummy); - setup.wIndex =get_reg_index (reg); - setup.wLength =0 ; + urbtrack->setup =kmalloc (sizeof (*urbtrack->setup),GFP_KERNEL ); +if (!urbtrack->setup) { +usb_free_urb (urbtrack->urb); +kfree (urbtrack); +return -ENOMEM ; + } + urbtrack->setup->bRequestType = (__u8 )0x40 ; + urbtrack->setup->bRequest = (__u8 )0x0e ; + urbtrack->setup->wValue =get_reg_value (reg, dummy); + urbtrack->setup->wIndex =get_reg_index (reg); + urbtrack->setup->wLength =0 ;usb_fill_control_urb (urbtrack->urb, usbdev,usb_sndctrlpipe (usbdev,0 ), - (unsigned char *)&setup, + (unsigned char *)urbtrack->setup,NULL ,0 , async_complete, urbtrack);kref_init (&urbtrack->ref_count);INIT_LIST_HEAD (&urbtrack->urblist_entry);
Greg Kroah-Hartman
maintainerPATCH 34/45 USB: keyspan: fix null-deref at disconnect and release
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit ff8a43c10f1440f07a5faca0c1556921259f7f76 upstream.
Make sure to fail properly if the device is not accepted during attach in order to avoid null-pointer derefs (of missing interface private data) at disconnect or release.
--- drivers/usb/serial/keyspan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/serial/keyspan.c +1 -1
@@ -2315,7 +2315,7 @@ static int keyspan_startup(struct usb_seif (d_details ==NULL ) {dev_err (&serial->dev->dev,"%s - unknown product id %x\n" , __func__,le16_to_cpu (serial->dev->descriptor.idProduct)); -return 1 ; +return -ENODEV ; }/* Setup private data for serial driver */
Greg Kroah-Hartman
maintainerPATCH 35/45 USB: EHCI: accept very late isochronous URBs
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>
commit 24f531371de17010f2b1b57d90e42240032e7733 upstream.
Since commits 4005ad4390bf (EHCI: implement new semantics for URB_ISO_ASAP) and c75c5ab575af (ALSA: USB: adjust for changed 3.8 USB API) became widely distributed, people have been experiencing problems with audio transfers. The slightest underrun causes complete failure, requiring the audio stream to be restarted.
It turns out that the current isochronous API doesn't handle underruns in the best way. The ALSA developers would much rather have transfers that are submitted too late be accepted and complete in the normal fashion, rather than being refused outright.
This patch implements the requested approach. When an isochronous URB submission is so late that all its scheduled slots have already expired, a debugging message will be printed in the log and the URB will be accepted as usual. Assuming it was submitted by a completion handler (which is normally the case), it will complete shortly thereafter with all the usb_iso_packet_descriptor status fields marked -EXDEV.
This fixes (for ehci-hcd)
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1191603
It should be applied to all kernels that include commit 4005ad4390bf.
--- drivers/usb/host/ehci-sched.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/usb/host/ehci-sched.c +6 -7
@@ -1391,21 +1391,20 @@ iso_stream_schedule (/* Behind the scheduling threshold? */ if (unlikely (start < next)) { +unsigned now2 = (now - base) & (mod -1 );/* USB_ISO_ASAP: Round up to the first available slot */ if (urb->transfer_flags &URB_ISO_ASAP ) start += (next - start + period -1 ) & -period;/* -* Not ASAP: Use the next slot in the stream. If -* the entire URB falls before the threshold, fail. +* Not ASAP: Use the next slot in the stream, +* no matter what. */ -else if (start + span - period < next) { -ehci_dbg (ehci,"iso urb late %p (%u+%u < %u)\n" , +else if (start + span - period < now2) { +ehci_dbg (ehci,"iso underrun %p (%u+%u < %u)\n" , urb, start + base, - span - period, next + base); - status = -EXDEV ; - goto fail; + span - period, now2 + base); } }
Greg Kroah-Hartman
maintainerPATCH 36/45 USB-Serial: Fix error handling of usb_wwan
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matt Burtch <[email protected]>
commit 6c1ee66a0b2bdbd64c078fba684d640cf2fd38a9 upstream.
This fixes an issue where the bulk-in urb used for incoming data transfer is not resubmitted if the packet recieved contains an error status. This results in the driver locking until the port is closed and re-opened.
Tested on a custom board with a Cinterion GSM module.
--- drivers/usb/serial/usb_wwan.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/usb/serial/usb_wwan.c +10 -10
@@ -291,18 +291,18 @@ static void usb_wwan_indat_callback(strutty_flip_buffer_push (&port->port); }else dev_dbg (dev,"%s: empty read urb received\n" , __func__); - -/* Resubmit urb so we continue receiving */ - err =usb_submit_urb (urb,GFP_ATOMIC ); -if (err) { -if (err != -EPERM ) { -dev_err (dev,"%s: resubmit read urb failed. (%d)\n" , __func__, err); -/* busy also in error unless we are killed */ -usb_mark_last_busy (port->serial->dev); - } - }else { + } +/* Resubmit urb so we continue receiving */ + err =usb_submit_urb (urb,GFP_ATOMIC ); +if (err) { +if (err != -EPERM ) { +dev_err (dev,"%s: resubmit read urb failed. (%d)\n" , + __func__, err); +/* busy also in error unless we are killed */ usb_mark_last_busy (port->serial->dev); } + }else { +usb_mark_last_busy (port->serial->dev); } }
Greg Kroah-Hartman
maintainerPATCH 37/45 PM / QoS: Fix workqueue deadlock when using pm_qos_update_request_timeout()
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Boyd <[email protected]>
commit 40fea92ffb5fa0ef26d10ae0fe5688bc8e61c791 upstream.
pm_qos_update_request_timeout() updates a qos and then schedules a delayed work item to bring the qos back down to the default after the timeout. When the work item runs, pm_qos_work_fn() will call pm_qos_update_request() and deadlock because it tries to cancel itself via cancel_delayed_work_sync(). Future callers of that qos will also hang waiting to cancel the work that is canceling itself. Let's extract the little bit of code that does the real work of pm_qos_update_request() and call it from the work function so that we don't deadlock.
Before ed1ac6e (PM: don't use [delayed_]work_pending()) this didn't happen because the work function wouldn't try to cancel itself.
[backport to 3.10 - gregkh]
--- kernel/power/qos.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
kernel/power/qos.c +12 -1
@@ -293,6 +293,15 @@ int pm_qos_request_active(struct pm_qos_ }EXPORT_SYMBOL_GPL (pm_qos_request_active); +static void __pm_qos_update_request (struct pm_qos_request *req, +s32 new_value) +{ +if (new_value != req->node.prio) +pm_qos_update_target ( + pm_qos_array[req->pm_qos_class]->constraints, + &req->node,PM_QOS_UPDATE_REQ , new_value); +} +/** * pm_qos_work_fn - the timeout handler of pm_qos_update_request_timeout * @work: work struct for the delayed work (timeout)
@@ -305,7 +314,7 @@ static void pm_qos_work_fn(struct work_s struct pm_qos_request, work); -pm_qos_update_request (req,PM_QOS_DEFAULT_VALUE ); +__pm_qos_update_request (req,PM_QOS_DEFAULT_VALUE ); }/**
@@ -365,6 +374,8 @@ void pm_qos_update_request(struct pm_qospm_qos_update_target ( pm_qos_array[req->pm_qos_class]->constraints, &req->node,PM_QOS_UPDATE_REQ , new_value); + +__pm_qos_update_request (req, new_value); }EXPORT_SYMBOL_GPL (pm_qos_update_request);
Greg Kroah-Hartman
maintainerPATCH 38/45 wusbcore: fix kernel panic when disconnecting a wireless USB->serial device
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Pugliese <[email protected]>
commit ec58fad1feb76c323ef47efff1d1e8660ed4644c upstream.
This patch fixes a kernel panic that can occur when disconnecting a wireless USB->serial device. When the serial device disconnects, the device cleanup procedure ends up calling usb_hcd_disable_endpoint on the serial device's endpoints. The wusbcore uses the ABORT_RPIPE command to abort all transfers on the given endpoint but it does not properly give back the URBs when the transfer results return from the HWA. This patch prevents the transfer result processing code from bailing out when it sees a WA_XFER_STATUS_ABORTED result code so that these urbs are flushed properly by usb_hcd_disable_endpoint. It also updates wa_urb_dequeue to handle the case where the endpoint has already been cleaned up when usb_kill_urb is called which is where the panic originally occurred.
--- drivers/usb/wusbcore/wa-xfer.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/usb/wusbcore/wa-xfer.c +7 -2
@@ -1110,6 +1110,12 @@ int wa_urb_dequeue(struct wahc *wa, stru }spin_lock_irqsave (&xfer->lock, flags); rpipe = xfer->ep->hcpriv; +if (rpipe ==NULL ) { +pr_debug ("%s: xfer id 0x%08X has no RPIPE. %s" , + __func__,wa_xfer_id (xfer), +"Probably already aborted.\n" ); + goto out_unlock; + }/* Check the delayed list -> if there, release and complete */ spin_lock_irqsave (&wa->xfer_list_lock, flags2);if (!list_empty (&xfer->list_node) && xfer->seg ==NULL )
@@ -1493,8 +1499,7 @@ static void wa_xfer_result_cb(struct urbbreak ; } usb_status = xfer_result->bTransferStatus &0x3f ; -if (usb_status ==WA_XFER_STATUS_ABORTED - || usb_status ==WA_XFER_STATUS_NOT_FOUND ) +if (usb_status ==WA_XFER_STATUS_NOT_FOUND )/* taken care of already */ break ; xfer_id = xfer_result->dwTransferID;
Greg Kroah-Hartman
maintainerPATCH 39/45 Fix TLB gather virtual address range invalidation corner cases
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
commit 2b047252d087be7f2ba088b4933cd904f92e6fce upstream.
Ben Tebulin reported:
"Since v3.7.2 on two independent machines a very specific Git
repository fails in 9/10 cases on git-fsck due to an SHA1/memory failures. This only occurs on a very specific repository and can be reproduced stably on two independent laptops. Git mailing list ran out of ideas and for me this looks like some very exotic kernel issue"
and bisected the failure to the backport of commit 53a59fc67f97 ("mm:
limit mmu_gather batching to fix soft lockups on !CONFIG_PREEMPT").
That commit itself is not actually buggy, but what it does is to make it much more likely to hit the partial TLB invalidation case, since it introduces a new case in tlb_next_batch() that previously only ever happened when running out of memory.
The real bug is that the TLB gather virtual memory range setup is subtly buggered. It was introduced in commit 597e1c3580b7 ("mm/mmu_gather:
enable tlb flush range in generic mmu_gather"), and the range handling was already fixed at least once in commit e6c495a96ce0 ("mm: fix the TLB range flushed when __tlb_remove_page() runs out of slots"), but that fix was not complete.
The problem with the TLB gather virtual address range is that it isn't set up by the initial tlb_gather_mmu() initialization (which didn't get the TLB range information), but it is set up ad-hoc later by the functions that actually flush the TLB. And so any such case that forgot to update the TLB range entries would potentially miss TLB invalidates.
Rather than try to figure out exactly which particular ad-hoc range setup was missing (I personally suspect it's the hugetlb case in zap_huge_pmd(), which didn't have the same logic as zap_pte_range() did), this patch just gets rid of the problem at the source: make the TLB range information available to tlb_gather_mmu(), and initialize it when initializing all the other tlb gather fields.
This makes the patch larger, but conceptually much simpler. And the end result is much more understandable; even if you want to play games with partial ranges when invalidating the TLB contents in chunks, now the range information is always there, and anybody who doesn't want to bother with it won't introduce subtle bugs.
Ben verified that this fixes his problem.
--- arch/arm/include/asm/tlb.h | 7 +++++-- arch/arm64/include/asm/tlb.h | 7 +++++-- arch/ia64/include/asm/tlb.h | 9 ++++++--- arch/s390/include/asm/tlb.h | 8 ++++++-- arch/sh/include/asm/tlb.h | 6 ++++-- arch/um/include/asm/tlb.h | 6 ++++-- fs/exec.c | 4 ++-- include/asm-generic/tlb.h | 2 +- mm/hugetlb.c | 2 +- mm/memory.c | 36 +++++++++++++++++++++--------------- mm/mmap.c | 4 ++-- 11 files changed, 57 insertions(+), 34 deletions(-)
arch/arm/include/asm/tlb.h +5 -2
@@ -43,6 +43,7 @@ struct mmu_gather {struct mm_struct *mm;unsigned int fullmm;struct vm_area_struct *vma; +unsigned long start, end;unsigned long range_start;unsigned long range_end;unsigned int nr;
@@ -107,10 +108,12 @@ static inline void tlb_flush_mmu(struct }static inline void -tlb_gather_mmu (struct mmu_gather *tlb,struct mm_struct *mm,unsigned int fullmm) +tlb_gather_mmu (struct mmu_gather *tlb,struct mm_struct *mm,unsigned long start,unsigned long end) { tlb->mm = mm; - tlb->fullmm = fullmm; + tlb->fullmm = !(start | (end+1 )); + tlb->start = start; + tlb->end = end; tlb->vma =NULL ; tlb->max =ARRAY_SIZE (tlb->local); tlb->pages = tlb->local;
arch/arm64/include/asm/tlb.h +5 -2
@@ -35,6 +35,7 @@ struct mmu_gather {struct mm_struct *mm;unsigned int fullmm;struct vm_area_struct *vma; +unsigned long start, end;unsigned long range_start;unsigned long range_end;unsigned int nr;
@@ -97,10 +98,12 @@ static inline void tlb_flush_mmu(struct }static inline void -tlb_gather_mmu (struct mmu_gather *tlb,struct mm_struct *mm,unsigned int fullmm) +tlb_gather_mmu (struct mmu_gather *tlb,struct mm_struct *mm,unsigned long start,unsigned long end) { tlb->mm = mm; - tlb->fullmm = fullmm; + tlb->fullmm = !(start | (end+1 )); + tlb->start = start; + tlb->end = end; tlb->vma =NULL ; tlb->max =ARRAY_SIZE (tlb->local); tlb->pages = tlb->local;
arch/ia64/include/asm/tlb.h +6 -3
@@ -22,7 +22,7 @@* unmapping a portion of the virtual address space, these hooks are called according to * the following template: * -* tlb <- tlb_gather_mmu(mm, full_mm_flush); // start unmap for address space MM +* tlb <- tlb_gather_mmu(mm, start, end); // start unmap for address space MM * { * for each vma that needs a shootdown do { * tlb_start_vma(tlb, vma);
@@ -58,6 +58,7 @@ struct mmu_gather {unsigned int max;unsigned char fullmm;/* non-zero means full mm flush */ unsigned char need_flush;/* really unmapped some PTEs? */ +unsigned long start, end;unsigned long start_addr;unsigned long end_addr;struct page **pages;
@@ -155,13 +156,15 @@ static inline void __tlb_alloc_page(strustatic inline void -tlb_gather_mmu (struct mmu_gather *tlb,struct mm_struct *mm,unsigned int full_mm_flush) +tlb_gather_mmu (struct mmu_gather *tlb,struct mm_struct *mm,unsigned long start,unsigned long end) { tlb->mm = mm; tlb->max =ARRAY_SIZE (tlb->local); tlb->pages = tlb->local; tlb->nr =0 ; - tlb->fullmm = full_mm_flush; + tlb->fullmm = !(start | (end+1 )); + tlb->start = start; + tlb->end = end; tlb->start_addr = ~0UL ; }
arch/s390/include/asm/tlb.h +6 -2
@@ -32,6 +32,7 @@ struct mmu_gather {struct mm_struct *mm;struct mmu_table_batch *batch;unsigned int fullmm; + unsigned long start, unsigned long end; };struct mmu_table_batch {
@@ -48,10 +49,13 @@ extern void tlb_remove_table(struct mmu_static inline void tlb_gather_mmu (struct mmu_gather *tlb,struct mm_struct *mm, -unsigned int full_mm_flush) +unsigned long start, +unsigned long end) { tlb->mm = mm; - tlb->fullmm = full_mm_flush; + tlb->start = start; + tlb->end = end; + tlb->fullmm = !(start | (end+1 )); tlb->batch =NULL ;if (tlb->fullmm)__tlb_flush_mm (mm);
arch/sh/include/asm/tlb.h +4 -2
@@ -36,10 +36,12 @@ static inline void init_tlb_gather(struc }static inline void -tlb_gather_mmu (struct mmu_gather *tlb,struct mm_struct *mm,unsigned int full_mm_flush) +tlb_gather_mmu (struct mmu_gather *tlb,struct mm_struct *mm,unsigned long start,unsigned long end) { tlb->mm = mm; - tlb->fullmm = full_mm_flush; + tlb->start = start; + tlb->end = end; + tlb->fullmm = !(start | (end+1 ));init_tlb_gather (tlb); }
arch/um/include/asm/tlb.h +4 -2
@@ -45,10 +45,12 @@ static inline void init_tlb_gather(struc }static inline void -tlb_gather_mmu (struct mmu_gather *tlb,struct mm_struct *mm,unsigned int full_mm_flush) +tlb_gather_mmu (struct mmu_gather *tlb,struct mm_struct *mm,unsigned long start,unsigned long end) { tlb->mm = mm; - tlb->fullmm = full_mm_flush; + tlb->start = start; + tlb->end = end; + tlb->fullmm = !(start | (end+1 ));init_tlb_gather (tlb); }
fs/exec.c +2 -2
@@ -607,7 +607,7 @@ static int shift_arg_pages(struct vm_arereturn -ENOMEM ;lru_add_drain (); -tlb_gather_mmu (&tlb, mm,0 ); +tlb_gather_mmu (&tlb, mm, old_start, old_end);if (new_end > old_start) {/* * when the old and new regions overlap clear from new_end.
@@ -624,7 +624,7 @@ static int shift_arg_pages(struct vm_arefree_pgd_range (&tlb, old_start, old_end, new_end, vma->vm_next ? vma->vm_next->vm_start :USER_PGTABLES_CEILING ); } -tlb_finish_mmu (&tlb, new_end, old_end); +tlb_finish_mmu (&tlb, old_start, old_end);/* * Shrink the vma to just the new range. Always succeeds.
include/asm-generic/tlb.h +1 -1
@@ -112,7 +112,7 @@ struct mmu_gather {#define HAVE_GENERIC_MMU_GATHER -void tlb_gather_mmu (struct mmu_gather *tlb,struct mm_struct *mm,bool fullmm); +void tlb_gather_mmu (struct mmu_gather *tlb,struct mm_struct *mm,unsigned long start,unsigned long end);void tlb_flush_mmu (struct mmu_gather *tlb);void tlb_finish_mmu (struct mmu_gather *tlb,unsigned long start,unsigned long end);
mm/hugetlb.c +1 -1
@@ -2490,7 +2490,7 @@ void unmap_hugepage_range(struct vm_area mm = vma->vm_mm; -tlb_gather_mmu (&tlb, mm,0 ); +tlb_gather_mmu (&tlb, mm, start, end);__unmap_hugepage_range (&tlb, vma, start, end, ref_page);tlb_finish_mmu (&tlb, start, end); }
mm/memory.c +21 -15
@@ -211,14 +211,15 @@ static int tlb_next_batch(struct mmu_gat* tear-down from @mm. The @fullmm argument is used when @mm is without * users and we're going to destroy the full address space (exit/execve). */ -void tlb_gather_mmu (struct mmu_gather *tlb,struct mm_struct *mm,bool fullmm) +void tlb_gather_mmu (struct mmu_gather *tlb,struct mm_struct *mm,unsigned long start,unsigned long end) { tlb->mm = mm; - tlb->fullmm = fullmm; +/* Is it from 0 to ~0? */ + tlb->fullmm = !(start | (end+1 )); tlb->need_flush_all =0 ; - tlb->start =-1UL ; - tlb->end =0 ; + tlb->start = start; + tlb->end = end; tlb->need_flush =0 ; tlb->local.next =NULL ; tlb->local.nr =0 ;
@@ -258,8 +259,6 @@ void tlb_finish_mmu(struct mmu_gather *t {struct mmu_gather_batch *batch, *next; - tlb->start = start; - tlb->end = end;tlb_flush_mmu (tlb);/* keep the page table cache within bounds */
@@ -1101,7 +1100,6 @@ static unsigned long zap_pte_range(strucspinlock_t *ptl;pte_t *start_pte;pte_t *pte; -unsigned long range_start = addr; again:init_rss_vec (rss);
@@ -1204,17 +1202,25 @@ again:* and page-free while holding it. */ if (force_flush) { +unsigned long old_end; + force_flush =0 ; -#ifdef HAVE_GENERIC_MMU_GATHER - tlb->start = range_start; +/* +* Flush the TLB just for the previous segment, +* then update the range to be the remaining +* TLB range. +*/ + old_end = tlb->end; tlb->end = addr; -#endif +tlb_flush_mmu (tlb); -if (addr != end) { - range_start = addr; + + tlb->start = addr; + tlb->end = old_end; + +if (addr != end) goto again; - } }return addr;
@@ -1399,7 +1405,7 @@ void zap_page_range(struct vm_area_strucunsigned long end = start + size;lru_add_drain (); -tlb_gather_mmu (&tlb, mm,0 ); +tlb_gather_mmu (&tlb, mm, start, end);update_hiwater_rss (mm);mmu_notifier_invalidate_range_start (mm, start, end);for ( ; vma && vma->vm_start < end; vma = vma->vm_next)
@@ -1425,7 +1431,7 @@ static void zap_page_range_single(structunsigned long end = address + size;lru_add_drain (); -tlb_gather_mmu (&tlb, mm,0 ); +tlb_gather_mmu (&tlb, mm, address, end);update_hiwater_rss (mm);mmu_notifier_invalidate_range_start (mm, address, end);unmap_single_vma (&tlb, vma, address, end, details);
mm/mmap.c +2 -2
@@ -2356,7 +2356,7 @@ static void unmap_region(struct mm_strucstruct mmu_gather tlb;lru_add_drain (); -tlb_gather_mmu (&tlb, mm,0 ); +tlb_gather_mmu (&tlb, mm, start, end);update_hiwater_rss (mm);unmap_vmas (&tlb, vma, start, end); free_pgtables(&tlb, vma, prev ? prev->vm_end : FIRST_USER_ADDRESS,
@@ -2735,7 +2735,7 @@ void exit_mmap(struct mm_struct *mm)lru_add_drain ();flush_cache_mm (mm); -tlb_gather_mmu (&tlb, mm,1 ); +tlb_gather_mmu (&tlb, mm,0 ,-1 );/* update_hiwater_rss(mm) here? but nobody should be looking */ /* Use -1 here to ensure all VMAs in the mm are unmapped */ unmap_vmas (&tlb, vma,0 ,-1 );
Greg Kroah-Hartman
maintainerPATCH 40/45 ARM: 7809/1: perf: fix event validation for software group leaders
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <[email protected]>
commit c95eb3184ea1a3a2551df57190c81da695e2144b upstream.
It is possible to construct an event group with a software event as a group leader and then subsequently add a hardware event to the group. This results in the event group being validated by adding all members of the group to a fake PMU and attempting to allocate each event on their respective PMU.
Unfortunately, for software events wthout a corresponding arm_pmu, this results in a kernel crash attempting to dereference the ->get_event_idx function pointer.
This patch fixes the problem by checking explicitly for software events and ignoring those in event validation (since they can always be scheduled). We will probably want to revisit this for 3.12, since the validation checks don't appear to work correctly when dealing with multiple hardware PMUs anyway.
--- arch/arm/kernel/perf_event.c | 3 +++ 1 file changed, 3 insertions(+)
arch/arm/kernel/perf_event.c +3 -0
@@ -258,6 +258,9 @@ validate_event(struct pmu_hw_events *hw_struct arm_pmu *armpmu =to_arm_pmu (event->pmu);struct pmu *leader_pmu = event->group_leader->pmu; +if (is_software_event (event)) +return 1 ; +if (event->pmu != leader_pmu || event->state <PERF_EVENT_STATE_OFF )return 1 ;
Greg Kroah-Hartman
maintainerPATCH 41/45 m68k: Truncate base in do_div()
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andreas Schwab <[email protected]>
commit ea077b1b96e073eac5c3c5590529e964767fc5f7 upstream.
Explicitly truncate the second operand of do_div() to 32 bits to guard against bogus code calling it with a 64-bit divisor.
[Thorsten]
After upgrading from 3.2 to 3.10, mounting a btrfs volume fails with:
btrfs: setting nodatacow, compression disabled
btrfs: enabling auto recovery
btrfs: disk space caching is enabled
--- arch/m68k/include/asm/div64.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
arch/m68k/include/asm/div64.h +5 -4
@@ -15,16 +15,17 @@unsigned long long n64; \ } __n; \unsigned long __rem, __upper; \ +unsigned long __base = (base); \ \ __n.n64 = (n); \if ((__upper = __n.n32[0 ])) { \ asm ("divul.l %2,%1:%0" \ - :"=d" (__n.n32[0 ]),"=d" (__upper) \ - :"d" (base),"0" (__n.n32[0 ])); \ + :"=d" (__n.n32[0 ]),"=d" (__upper) \ + :"d" (__base),"0" (__n.n32[0 ])); \ } \ asm ("divu.l %2,%1:%0" \ - :"=d" (__n.n32[1 ]),"=d" (__rem) \ - :"d" (base),"1" (__upper),"0" (__n.n32[1 ])); \ + :"=d" (__n.n32[1 ]),"=d" (__rem) \ + :"d" (__base),"1" (__upper),"0" (__n.n32[1 ])); \ (n) = __n.n64; \ __rem; \ })
Geert Uytterhoeven
maintainerRe: [ 41/45] m68k: Truncate base in do_div()
Quoted 11 lines · Greg Kroah-Hartman
3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andreas Schwab <[email protected]>
commit
ea077b1b96e073eac5c3c5590529e964767fc5f7upstream.Explicitly truncate the second operand of
do_div()to 32 bits to guard against bogus code calling it with a 64-bit divisor.
Quoted 7 lines
[Thorsten]
After upgrading from 3.2 to 3.10, mounting a btrfs volume fails with:
btrfs: setting nodatacow, compression disabled
btrfs: enabling auto recovery
btrfs: disk space caching is enabled
What happened to the rest of the commit message?
Quoted 2 lines
--- arch/m68k/include/asm/div64.h | 9 +++++----
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Greg Kroah-Hartman
maintainerRe: [ 41/45] m68k: Truncate base in do_div()
Quoted 15 lines · Geert Uytterhoeven
Quoted 13 lines · Greg Kroah-Hartman
3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andreas Schwab <[email protected]>
commit
ea077b1b96e073eac5c3c5590529e964767fc5f7upstream.Explicitly truncate the second operand of
do_div()to 32 bits to guard against bogus code calling it with a 64-bit divisor.[Thorsten]
Quoted 7 lines
Quoted 5 lines
After upgrading from 3.2 to 3.10, mounting a btrfs volume fails with:
btrfs: setting nodatacow, compression disabled
btrfs: enabling auto recovery
btrfs: disk space caching is enabledWhat happened to the rest of the commit message?
It looks like quilt will cut off the rest of the message after it sees
the "*** ZERO DIVIDE *** FORMAT=2" line.
I don't know why it does that, never noticed that before, I'll go fix this up, thanks.
greg k-h
Greg Kroah-Hartman
maintainerPATCH 42/45 m68k/atari: ARAnyM - Fix NatFeat module support
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
commit e8184e10f89736a23ea6eea8e24cd524c5c513d2 upstream.
As pointed out by Andreas Schwab, pointers passed to ARAnyM NatFeat calls should be physical addresses, not virtual addresses.
Fortunately on Atari, physical and virtual kernel addresses are the same, as long as normal kernel memory is concerned, so this usually worked fine without conversion.
But for modules, pointers to literal strings are located in vmalloc()ed memory. Depending on the version of ARAnyM, this causes the nf_get_id() call to just fail, or worse, crash ARAnyM itself with e.g.
Gotcha! Illegal memory access. Atari PC = $968c
This is a big issue for distro kernels, who want to have all drivers as loadable modules in an initrd.
Add a wrapper for nf_get_id() that copies the literal to the stack to work around this issue.
--- arch/m68k/emu/natfeat.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-)
arch/m68k/emu/natfeat.c +19 -4
@@ -18,9 +18,11 @@#include <asm/machdep.h> #include <asm/natfeat.h> +extern long nf_get_id2 (const char *feature_name); + asm("\n" -" .global nf_get_id,nf_call\n" -"nf_get_id:\n" +" .global nf_get_id2,nf_call\n" +"nf_get_id2:\n" " .short 0x7300\n" " rts\n" "nf_call:\n"
@@ -29,12 +31,25 @@ asm("\n""1: moveq.l #0,%d0\n" " rts\n" " .section __ex_table,\"a\"\n" -" .long nf_get_id,1b\n" +" .long nf_get_id2,1b\n" " .long nf_call,1b\n" " .previous"); -EXPORT_SYMBOL_GPL (nf_get_id);EXPORT_SYMBOL_GPL (nf_call); +long nf_get_id (const char *feature_name) +{ +/* feature_name may be in vmalloc()ed memory, so make a copy */ +char name_copy[32 ]; +size_t n; + + n =strlcpy (name_copy, feature_name,sizeof (name_copy)); +if (n >=sizeof (name_copy)) +return 0 ; + +return nf_get_id2 (name_copy); +} +EXPORT_SYMBOL_GPL (nf_get_id); +void nfprint (const char *fmt, ...) {static char buf[256 ];
Greg Kroah-Hartman
maintainerPATCH 43/45 s390: Fix broken build
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guenter Roeck <[email protected]>
commit 215b28a5308f3d332df2ee09ef11fda45d7e4a92 upstream.
Fix this build error:
In file included from fs/exec.c:61:0:
arch/s390/include/asm/tlb.h:35:23: error: expected identifier or '(' before 'unsigned' arch/s390/include/asm/tlb.h:36:1: warning: no semicolon at end of struct or union [enabled by default] arch/s390/include/asm/tlb.h: In function 'tlb_gather_mmu':
arch/s390/include/asm/tlb.h:57:5: error: 'struct mmu_gather' has no member named 'end'
Broken due to commit 2b047252d0 ("Fix TLB gather virtual address range invalidation corner cases").
--- arch/s390/include/asm/tlb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/include/asm/tlb.h +1 -1
@@ -32,7 +32,7 @@ struct mmu_gather {struct mm_struct *mm;struct mmu_table_batch *batch;unsigned int fullmm; - unsigned long start, unsigned long end; +unsigned long start, end; };struct mmu_table_batch {
Greg Kroah-Hartman
maintainerPATCH 44/45 jbd2: Fix use after free after error in jbd2_journal_dirty_metadata()
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <[email protected]>
commit 91aa11fae1cf8c2fd67be0609692ea9741cdcc43 upstream.
When jbd2_journal_dirty_metadata() returns error, __ext4_handle_dirty_metadata() stops the handle. However callers of this function do not count with that fact and still happily used now freed handle. This use after free can result in various issues but very likely we oops soon.
The motivation of adding __ext4_journal_stop() into __ext4_handle_dirty_metadata() in commit 9ea7a0df seems to be only to improve error reporting. So replace __ext4_journal_stop() with ext4_journal_abort_handle() which was there before that commit and add WARN_ON_ONCE() to dump stack to provide useful information.
--- fs/ext4/ext4_jbd2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
fs/ext4/ext4_jbd2.c +4 -4
@@ -219,10 +219,10 @@ int __ext4_handle_dirty_metadata(const cset_buffer_prio (bh);if (ext4_handle_valid (handle)) { err =jbd2_journal_dirty_metadata (handle, bh); -if (err) { -/* Errors can only happen if there is a bug */ - handle->h_err = err; -__ext4_journal_stop (where, line, handle); +/* Errors can only happen if there is a bug */ +if (WARN_ON_ONCE (err)) { +ext4_journal_abort_handle (where, line, __func__, bh, + handle, err); } }else {if (inode)
Greg Kroah-Hartman
maintainerPATCH 45/45 cpuset: fix the return value of cpuset_write_u64()
In reply to Greg Kroah-Hartman3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li Zefan <[email protected]>
commit a903f0865a190f8778c73df1a810ea6e25e5d7cf upstream.
Writing to this file always returns -ENODEV:
# echo 1 > cpuset.memory_pressure_enabled -bash: echo: write error: No such device
--- kernel/cpuset.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
kernel/cpuset.c +4 -2
@@ -1502,11 +1502,13 @@ static int cpuset_write_u64(struct cgrou {struct cpuset *cs =cgroup_cs (cgrp);cpuset_filetype_t type = cft->private; -int retval = -ENODEV ; +int retval =0 ;mutex_lock (&cpuset_mutex); -if (!is_cpuset_online (cs)) +if (!is_cpuset_online (cs)) { + retval = -ENODEV ; goto out_unlock; + }switch (type) {case FILE_CPU_EXCLUSIVE :
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.10.8 release. There are 45 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 7 lines
Responses should be made by Tue Aug 20 20:36:09 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.10.8-rc1.gzand the diffstat can be found below.
Cross build results:
Total builds: 76 Total build errors: 0
Previous release:
Total builds: 69 Total build errors: 0
qemu:
mips, ppc, x86, x86_64 pass (boot to login prompt) arm: fail (known problem, see https://lkml.org/lkml/2013/8/11/41)
More builds, still no failures.
Thanks,
Guenter
Greg Kroah-Hartman
maintainerQuoted 19 lines · Guenter Roeck
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.10.8 release. There are 45 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 7 lines
Responses should be made by Tue Aug 20 20:36:09 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.10.8-rc1.gzand the diffstat can be found below.
Cross build results:
Total builds: 76 Total build errors: 0
Previous release:
Total builds: 69 Total build errors: 0
Quoted 5 lines
qemu:
mips, ppc, x86, x86_64 pass (boot to login prompt) arm: fail (known problem, see https://lkml.org/lkml/2013/8/11/41)More builds, still no failures.
Thanks for testing all 3 of these releases and letting me know all is well.
greg k-h
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.10.8 release. There are 45 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 Tue Aug 20 20:36:09 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.10.8-rc1.gzand the diffstat can be found below.
thanks,
greg k-h
3.10.8-rc1 applied cleanly to 3.10.7.
Compiled and booted on the following systems:
Samsung Series 9 900X4C Intel Corei5
HP ProBook 6475b AMD A10-4600M APU with Radeon(tm) HD Graphics
dmesgs look good. No regressions compared to the previous dmesgs for each of this release. dmesg emerg, crit, alert, err are clean. No regressions in warn.
Cross-compile testing: HP Compaq dc7700 SFF desktop: x86-64 Intel Core-i2:
Cross-compile tests results:
alpha: defconfig passed
arm: defconfig passed
arm64: defconfig passed
blackfin: defconfig passed
c6x: defconfig passed
mips: defconfig passed
mipsel: defconfig passed
powerpc: wii_defconfig passed
sh: defconfig passed
sparc: defconfig passed
tile: tilegx_defconfig passed
-- Shuah
Signature · 4 lines
Shuah Khan Senior Linux Kernel Developer - Open Source Group Samsung Research America(Silicon Valley) [email protected] | (970) 672-0658
Greg Kroah-Hartman
maintainerQuoted 20 lines · Shuah Khan
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.10.8 release. There are 45 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 Tue Aug 20 20:36:09 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.10.8-rc1.gzand the diffstat can be found below.
thanks,
greg k-h
3.10.8-rc1 applied cleanly to 3.10.7.
Quoted 8 lines
Compiled and booted on the following systems:
Samsung Series 9 900X4C Intel Corei5
HP ProBook 6475b AMD A10-4600M APU with Radeon(tm) HD Graphicsdmesgs look good. No regressions compared to the previous dmesgs for each of this release. dmesg emerg, crit, alert, err are clean. No regressions in warn.
Thanks for testing and letting me know.
greg k-h