3.8.9-stable review
Subsystems (38)
Greg Kroah-Hartman
maintainercover 3.8.9-stable review
This is the start of the stable review cycle for the 3.8.9 release. There are 42 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 Thu Apr 25 21:50:11 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.8.9-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 3.8.9-rc1
Ralf Baechle <[email protected]>
Revert "MIPS: page.h: Provide more readable definition for PAGE_MASK."
Linus Torvalds <[email protected]>
s390: move dummy io_remap_pfn_range() to asm/pgtable.h
Josef Bacik <[email protected]>
Btrfs: make sure nbytes are right after log replay
Linus Torvalds <[email protected]>
vm: convert mtdchar mmap to vm_iomap_memory() helper
Linus Torvalds <[email protected]>
vm: convert HPET mmap to vm_iomap_memory() helper
Linus Torvalds <[email protected]>
vm: convert fb_mmap to vm_iomap_memory() helper
Linus Torvalds <[email protected]>
vm: convert snd_pcm_lib_mmap_iomem() to vm_iomap_memory() helper
Linus Torvalds <[email protected]>
vm: add vm_iomap_memory() helper function
Andy Lutomirski <[email protected]>
userns: Changing any namespace id mappings should require privileges
Andy Lutomirski <[email protected]>
userns: Check uid_map's opener's fsuid, not the current fsuid
Eric W. Biederman <[email protected]>
userns: Don't let unprivileged users trick privileged users into setting the id_map
Stephane Eranian <[email protected]>
perf/x86: Fix offcore_rsp valid mask for SNB/IVB
Tommi Rantala <[email protected]>
perf: Treat attr.config as u64 in perf_swevent_init()
Mathias Krause <[email protected]>
crypto: algif - suppress sending source address information in recvmsg
Rafał Miłecki <[email protected]>
ssb: implement spurious tone avoidance
Johannes Berg <[email protected]>
mac80211: fix cfg80211 interaction on auth/assoc request
Felix Fietkau <[email protected]>
ath9k_hw: change AR9580 initvals to fix a stability issue
Felix Fietkau <[email protected]>
ath9k_htc: accept 1.x firmware newer than 1.3
Will Deacon <[email protected]>
ARM: 7698/1: perf: fix group validation when using enable_on_exec
Illia Ragozin <[email protected]>
ARM: 7696/1: Fix kexec by setting outer_cache.inv_all for Feroceon
libin <[email protected]>
sched/debug: Fix sd->*_idx limit range avoiding overflow
Tejun Heo <[email protected]>
sched: Convert BUG_ON()s in try_to_wake_up_local() to WARN_ON_ONCE()s
Matt Carlson <[email protected]>
tg3: Add 57766 device support.
Markus Pargmann <[email protected]>
ARM: clk-imx35: Bugfix iomux clock
Sascha Hauer <[email protected]>
ARM: i.MX35: enable MAX clock
Andrew Honig <[email protected]>
KVM: Allow cross page reads and writes from cached translations.
Andy Honig <[email protected]>
KVM: Fix bounds checking in ioapic indirect register reads (CVE-2013-1798)
Andy Honig <[email protected]>
KVM: x86: Convert MSR_KVM_SYSTEM_TIME to use gfn_to_hva_cache functions (CVE-2013-1797)
Andy Honig <[email protected]>
KVM: x86: fix for buffer overflow in handling of MSR_KVM_SYSTEM_TIME (CVE-2013-1796)
Joe Lawrence <[email protected]>
md: raid1,10: Handle REQ_WRITE_SAME flag in write bios
Vyacheslav Dubeyko <[email protected]>
hfsplus: fix potential overflow in hfsplus_file_truncate()
Emese Revfy <[email protected]>
kernel/signal.c: stop info leak via the tkill and the tgkill syscalls
Naoya Horiguchi <[email protected]>
fs/binfmt_elf.c: fix hugetlb memory check in vma_dump_size()
Naoya Horiguchi <[email protected]>
hugetlbfs: add swap entry check in follow_hugetlb_page()
Naoya Horiguchi <[email protected]>
hugetlbfs: stop setting VM_DONTDUMP in initializing vma(VM_HUGETLB)
Christoph Fritz <[email protected]>
can: sja1000: fix handling on dt properties on little endian systems
Marc Kleine-Budde <[email protected]>
can: mcp251x: add missing IRQF_ONESHOT to request_threaded_irq
Michael Bohan <[email protected]>
hrtimer: Don't reinitialize a cpu_base lock on CPU_UP
Thomas Gleixner <[email protected]>
kthread: Prevent unpark race which puts threads on the wrong cpu
Russell King <[email protected]>
ARM: Do 15e0d9e37c (ARM: pm: let platforms select cpu_suspend support) properly
Scott Wood <[email protected]>
kvm/powerpc/e500mc: fix tlb invalidation on cpu migration
Kevin Hao <[email protected]>
powerpc: add a missing label in resume_kernel
-------------
Diffstat:
Makefile | 4 +- arch/arm/kernel/perf_event.c | 5 ++- arch/arm/mach-imx/clk-imx35.c | 2 + arch/arm/mm/cache-feroceon-l2.c | 1 + arch/arm/mm/proc-arm920.S | 2 +- arch/arm/mm/proc-arm926.S | 2 +- arch/arm/mm/proc-mohawk.S | 2 +- arch/arm/mm/proc-sa1100.S | 2 +- arch/arm/mm/proc-v6.S | 2 +- arch/arm/mm/proc-xsc3.S | 2 +- arch/arm/mm/proc-xscale.S | 2 +- arch/mips/include/asm/page.h | 2 +- arch/powerpc/kernel/entry_64.S | 2 +- arch/powerpc/kvm/e500mc.c | 7 ++- arch/s390/include/asm/io.h | 4 -- arch/s390/include/asm/pgtable.h | 4 ++ arch/x86/include/asm/kvm_host.h | 4 +- arch/x86/kernel/cpu/perf_event_intel.c | 20 +++++++-- arch/x86/kvm/lapic.c | 2 +- arch/x86/kvm/x86.c | 51 ++++++++++----------- crypto/algif_hash.c | 2 + crypto/algif_skcipher.c | 1 + drivers/char/hpet.c | 14 +----- drivers/md/raid1.c | 7 ++- drivers/md/raid10.c | 9 +++- drivers/mtd/mtdchar.c | 32 +------------ drivers/net/can/mcp251x.c | 10 ++++- drivers/net/can/sja1000/sja1000_of_platform.c | 31 +++++++------ drivers/net/ethernet/broadcom/tg3.c | 18 +++++++- drivers/net/ethernet/broadcom/tg3.h | 2 + .../net/wireless/ath/ath9k/ar9580_1p0_initvals.h | 2 +- drivers/net/wireless/ath/ath9k/htc_drv_init.c | 2 +- drivers/net/wireless/b43/phy_n.c | 3 +- drivers/ssb/driver_chipcommon_pmu.c | 29 ++++++++++++ drivers/video/fbmem.c | 39 ++++++---------- fs/binfmt_elf.c | 1 + fs/btrfs/tree-log.c | 48 +++++++++++++++++--- fs/hfsplus/extents.c | 2 +- fs/hugetlbfs/inode.c | 2 +- fs/proc/array.c | 1 + include/linux/kvm_host.h | 2 +- include/linux/kvm_types.h | 1 + include/linux/mm.h | 2 + include/linux/sched.h | 5 ++- include/linux/ssb/ssb_driver_chipcommon.h | 2 + include/trace/events/sched.h | 2 +- kernel/events/core.c | 2 +- kernel/hrtimer.c | 3 +- kernel/kthread.c | 52 ++++++++++++---------- kernel/sched/core.c | 8 ++-- kernel/signal.c | 2 +- kernel/user_namespace.c | 22 +++++---- mm/hugetlb.c | 12 ++++- mm/memory.c | 47 +++++++++++++++++++ net/mac80211/mlme.c | 24 ++++++++-- sound/core/pcm_native.c | 12 +---- virt/kvm/ioapic.c | 7 ++- virt/kvm/kvm_main.c | 47 ++++++++++++++----- 58 files changed, 406 insertions(+), 223 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/42 powerpc: add a missing label in resume_kernel
3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kevin Hao <[email protected]>
commit d8b92292408831d86ff7b781e66bf79301934b99 upstream.
A label 0 was missed in the patch a9c4e541 (powerpc/kprobe: Complete kprobe and migrate exception frame). This will cause the kernel branch to an undetermined address if there really has a conflict when updating the thread flags.
--- arch/powerpc/kernel/entry_64.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kernel/entry_64.S +1 -1
@@ -634,7 +634,7 @@ resume_kernel: /* Clear _TIF_EMULATE_STACK_STORE flag */ lis r11,_TIF_EMULATE_STACK_STORE@h addi r5,r9,TI_FLAGS - ldarx r4,0,r5 +0: ldarx r4,0,r5 andc r4,r4,r11 stdcx. r4,0,r5 bne- 0b
Greg Kroah-Hartman
maintainerPATCH 2/42 kvm/powerpc/e500mc: fix tlb invalidation on cpu migration
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Scott Wood <[email protected]>
commit c5e6cb051c5f7d56f05bd6a4af22cb300a4ced79 upstream.
The existing check handles the case where we've migrated to a different core than we last ran on, but it doesn't handle the case where we're still on the same cpu we last ran on, but some other vcpu has run on this cpu in the meantime.
Without this, guest segfaults (and other misbehavior) have been seen in smp guests.
--- arch/powerpc/kvm/e500mc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
arch/powerpc/kvm/e500mc.c +6 -1
@@ -108,6 +108,8 @@ void kvmppc_mmu_msr_notify(struct kvm_vc { } +static DEFINE_PER_CPU(struct kvm_vcpu *, last_vcpu_on_cpu); +void kvmppc_core_vcpu_load (struct kvm_vcpu *vcpu,int cpu) {struct kvmppc_vcpu_e500 *vcpu_e500 =to_e500 (vcpu);
@@ -136,8 +138,11 @@ void kvmppc_core_vcpu_load(struct kvm_vcmtspr (SPRN_GDEAR , vcpu->arch.shared->dar);mtspr (SPRN_GESR , vcpu->arch.shared->esr); -if (vcpu->arch.oldpir !=mfspr (SPRN_PIR )) +if (vcpu->arch.oldpir !=mfspr (SPRN_PIR ) || +__get_cpu_var (last_vcpu_on_cpu) != vcpu) {kvmppc_e500_tlbil_all (vcpu_e500); +__get_cpu_var (last_vcpu_on_cpu) = vcpu; + }kvmppc_load_guest_fp (vcpu); }
Greg Kroah-Hartman
maintainerPATCH 3/42 ARM: Do 15e0d9e37c (ARM: pm: let platforms select cpu_suspend support) properly
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Russell King <[email protected]>
commit b6c7aabd923a17af993c5a5d5d7995f0b27c000a upstream.
Let's do the changes properly and fix the same problem everywhere, not just for one case.
--- arch/arm/mm/proc-arm920.S | 2 +- arch/arm/mm/proc-arm926.S | 2 +- arch/arm/mm/proc-mohawk.S | 2 +- arch/arm/mm/proc-sa1100.S | 2 +- arch/arm/mm/proc-v6.S | 2 +- arch/arm/mm/proc-xsc3.S | 2 +- arch/arm/mm/proc-xscale.S | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-)
arch/arm/mm/proc-arm920.S +1 -1
@@ -387,7 +387,7 @@ ENTRY(cpu_arm920_set_pte_ext) /* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */ .globl cpu_arm920_suspend_size .equ cpu_arm920_suspend_size, 4 * 3 -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_ARM_CPU_SUSPEND ENTRY(cpu_arm920_do_suspend) stmfd sp!, {r4 - r6, lr} mrc p15, 0, r4, c13, c0, 0 @ PID
arch/arm/mm/proc-arm926.S +1 -1
@@ -402,7 +402,7 @@ ENTRY(cpu_arm926_set_pte_ext) /* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */ .globl cpu_arm926_suspend_size .equ cpu_arm926_suspend_size, 4 * 3 -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_ARM_CPU_SUSPEND ENTRY(cpu_arm926_do_suspend) stmfd sp!, {r4 - r6, lr} mrc p15, 0, r4, c13, c0, 0 @ PID
arch/arm/mm/proc-mohawk.S +1 -1
@@ -350,7 +350,7 @@ ENTRY(cpu_mohawk_set_pte_ext) .globl cpu_mohawk_suspend_size .equ cpu_mohawk_suspend_size, 4 * 6 -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_ARM_CPU_SUSPEND ENTRY(cpu_mohawk_do_suspend) stmfd sp!, {r4 - r9, lr} mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode
arch/arm/mm/proc-sa1100.S +1 -1
@@ -172,7 +172,7 @@ ENTRY(cpu_sa1100_set_pte_ext) .globl cpu_sa1100_suspend_size .equ cpu_sa1100_suspend_size, 4 * 3 -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_ARM_CPU_SUSPEND ENTRY(cpu_sa1100_do_suspend) stmfd sp!, {r4 - r6, lr} mrc p15, 0, r4, c3, c0, 0 @ domain ID
arch/arm/mm/proc-v6.S +1 -1
@@ -138,7 +138,7 @@ ENTRY(cpu_v6_set_pte_ext) /* Suspend/resume support: taken from arch/arm/mach-s3c64xx/sleep.S */ .globl cpu_v6_suspend_size .equ cpu_v6_suspend_size, 4 * 6 -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_ARM_CPU_SUSPEND ENTRY(cpu_v6_do_suspend) stmfd sp!, {r4 - r9, lr} mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID
arch/arm/mm/proc-xsc3.S +1 -1
@@ -413,7 +413,7 @@ ENTRY(cpu_xsc3_set_pte_ext) .globl cpu_xsc3_suspend_size .equ cpu_xsc3_suspend_size, 4 * 6 -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_ARM_CPU_SUSPEND ENTRY(cpu_xsc3_do_suspend) stmfd sp!, {r4 - r9, lr} mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode
arch/arm/mm/proc-xscale.S +1 -1
@@ -528,7 +528,7 @@ ENTRY(cpu_xscale_set_pte_ext) .globl cpu_xscale_suspend_size .equ cpu_xscale_suspend_size, 4 * 6 -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_ARM_CPU_SUSPEND ENTRY(cpu_xscale_do_suspend) stmfd sp!, {r4 - r9, lr} mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode
Greg Kroah-Hartman
maintainerPATCH 4/42 kthread: Prevent unpark race which puts threads on the wrong cpu
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <[email protected]>
commit f2530dc71cf0822f90bb63ea4600caaef33a66bb upstream.
The smpboot threads rely on the park/unpark mechanism which binds per cpu threads on a particular core. Though the functionality is racy:
CPU0 CPU1 CPU2
unpark(T) wake_up_process(T)
clear(SHOULD_PARK) T runs
leave parkme() due to !SHOULD_PARK
bind_to(CPU2) BUG_ON(wrong CPU)
We cannot let the tasks move themself to the target CPU as one of those tasks is actually the migration thread itself, which requires that it starts running on the target cpu right away.
The solution to this problem is to prevent wakeups in park mode which are not from unpark(). That way we can guarantee that the association of the task to the target cpu is working correctly.
Add a new task state (TASK_PARKED) which prevents other wakeups and use this state explicitly for the unpark wakeup.
Peter noticed: Also, since the task state is visible to userspace and all the parked tasks are still in the PID space, its a good hint in ps and friends that these tasks aren't really there for the moment.
The migration thread has another related issue.
CPU0 CPU1
Bring up CPU2create_thread(T)
park(T)
wait_for_completion()
parkme()
complete()sched_set_stop_task()
schedule(TASK_PARKED)
The sched_set_stop_task() call is issued while the task is on the runqueue of CPU1 and that confuses the hell out of the stop_task class on that cpu. So we need the same synchronizaion before sched_set_stop_task().
--- fs/proc/array.c | 1 include/linux/sched.h | 5 ++-- include/trace/events/sched.h | 2 - kernel/kthread.c | 52 +++++++++++++++++++++++-------------------- 4 files changed, 33 insertions(+), 27 deletions(-)
fs/proc/array.c +1 -0
@@ -143,6 +143,7 @@ static const char * const task_state_arr"x (dead)" ,/* 64 */ "K (wakekill)" ,/* 128 */ "W (waking)" ,/* 256 */ + "P (parked)", /* 512 */ };static inline const char *get_task_state (struct task_struct *tsk)
include/linux/sched.h +3 -2
@@ -163,9 +163,10 @@ print_cfs_rq(struct seq_file *m, int cpu#define TASK_DEAD 64#define TASK_WAKEKILL 128#define TASK_WAKING 256 -#define TASK_STATE_MAX 512 +#define TASK_PARKED 512 +#define TASK_STATE_MAX 1024 -#define TASK_STATE_TO_CHAR_STR "RSDTtZXxKW" +#define TASK_STATE_TO_CHAR_STR "RSDTtZXxKWP"extern char ___assert_task_state[1 -2 *!!(sizeof (TASK_STATE_TO_CHAR_STR )-1 !=ilog2 (TASK_STATE_MAX )+1 )];
include/trace/events/sched.h +1 -1
@@ -147,7 +147,7 @@ TRACE_EVENT(sched_switch,__print_flags (__entry->prev_state & (TASK_STATE_MAX -1 ),"|" , { 1, "S"} , { 2, "D" }, { 4, "T" }, { 8, "t" }, { 16, "Z" }, { 32, "X" }, { 64, "x" }, - { 128, "W" }) : "R", + { 128, "K" }, { 256, "W" }, { 512, "P" }) : "R", __entry->prev_state &TASK_STATE_MAX ?"+" :"" , __entry->next_comm, __entry->next_pid, __entry->next_prio) );
kernel/kthread.c +28 -24
93 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 5/42 hrtimer: Dont reinitialize a cpu_base lock on CPU_UP
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Bohan <[email protected]>
commit 84cc8fd2fe65866e49d70b38b3fdf7219dd92fe0 upstream.
The current code makes the assumption that a cpu_base lock won't be held if the CPU corresponding to that cpu_base is offline, which isn't always true.
If a hrtimer is not queued, then it will not be migrated by migrate_hrtimers() when a CPU is offlined. Therefore, the hrtimer's cpu_base may still point to a CPU which has subsequently gone offline if the timer wasn't enqueued at the time the CPU went down.
Normally this wouldn't be a problem, but a cpu_base's lock is blindly reinitialized each time a CPU is brought up. If a CPU is brought online during the period that another thread is performing a hrtimer operation on a stale hrtimer, then the lock will be reinitialized under its feet, and a SPIN_BUG() like the following will be observed:
<0>[ 28.082085] BUG: spinlock already unlocked on CPU#0, swapper/0/0 <0>[ 28.087078] lock: 0xc4780b40, value 0x0 .magic: dead4ead, .owner: <none>/-1, .owner_cpu: -1 <4>[ 42.451150] [<c0014398>] (unwind_backtrace+0x0/0x120) from [<c0269220>] (do_raw_spin_unlock+0x44/0xdc) <4>[ 42.460430] [<c0269220>] (do_raw_spin_unlock+0x44/0xdc) from [<c071b5bc>] (_raw_spin_unlock+0x8/0x30) <4>[ 42.469632] [<c071b5bc>] (_raw_spin_unlock+0x8/0x30) from [<c00a9ce0>] (__hrtimer_start_range_ns+0x1e4/0x4f8) <4>[ 42.479521] [<c00a9ce0>] (__hrtimer_start_range_ns+0x1e4/0x4f8) from [<c00aa014>] (hrtimer_start+0x20/0x28) <4>[ 42.489247] [<c00aa014>] (hrtimer_start+0x20/0x28) from [<c00e6190>] (rcu_idle_enter_common+0x1ac/0x320) <4>[ 42.498709] [<c00e6190>] (rcu_idle_enter_common+0x1ac/0x320) from [<c00e6440>] (rcu_idle_enter+0xa0/0xb8) <4>[ 42.508259] [<c00e6440>] (rcu_idle_enter+0xa0/0xb8) from [<c000f268>] (cpu_idle+0x24/0xf0) <4>[ 42.516503] [<c000f268>] (cpu_idle+0x24/0xf0) from [<c06ed3c0>] (rest_init+0x88/0xa0) <4>[ 42.524319] [<c06ed3c0>] (rest_init+0x88/0xa0) from [<c0c00978>] (start_kernel+0x3d0/0x434)
As an example, this particular crash occurred when hrtimer_start() was executed on CPU #0. The code locked the hrtimer's current cpu_base corresponding to CPU #1. CPU #0 then tried to switch the hrtimer's cpu_base to an optimal CPU which was online. In this case, it selected the cpu_base corresponding to CPU #3.
Before it could proceed, CPU #1 came online and reinitialized the spinlock corresponding to its cpu_base. Thus now CPU #0 held a lock which was reinitialized. When CPU #0 finally ended up unlocking the old cpu_base corresponding to CPU #1 so that it could switch to CPU #3, we hit this SPIN_BUG() above while in switch_hrtimer_base().
CPU #0 CPU #1 ---- ---- ... <offline> hrtimer_start() lock_hrtimer_base(base #1) ... init_hrtimers_cpu() switch_hrtimer_base() ... ... raw_spin_lock_init(&cpu_base->lock) raw_spin_unlock(&cpu_base->lock) ...
<spin_bug>
Solve this by statically initializing the lock.
--- kernel/hrtimer.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
kernel/hrtimer.c +1 -2
@@ -61,6 +61,7 @@ DEFINE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases) = { + .lock =__RAW_SPIN_LOCK_UNLOCKED (hrtimer_bases.lock), .clock_base = { {
@@ -1640,8 +1641,6 @@ static void __cpuinit init_hrtimers_cpu(struct hrtimer_cpu_base *cpu_base = &per_cpu (hrtimer_bases, cpu);int i; -raw_spin_lock_init (&cpu_base->lock); -for (i =0 ; i <HRTIMER_MAX_CLOCK_BASES ; i++) { cpu_base->clock_base[i].cpu_base = cpu_base;timerqueue_init_head (&cpu_base->clock_base[i].active);
Greg Kroah-Hartman
maintainerPATCH 6/42 can: mcp251x: add missing IRQF_ONESHOT to request_threaded_irq
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Kleine-Budde <[email protected]>
commit db388d6460ffa53b3b38429da6f70a913f89b048 upstream.
Since commit:
1c6c695 genirq: Reject bogus threaded irq requests
threaded irqs must provide a primary handler or set the IRQF_ONESHOT flag. Since the mcp251x driver doesn't make use of a primary handler set the IRQF_ONESHOT flag.
--- drivers/net/can/mcp251x.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/net/can/mcp251x.c +8 -2
@@ -922,6 +922,7 @@ static int mcp251x_open(struct net_devicstruct mcp251x_priv *priv =netdev_priv (net);struct spi_device *spi = priv->spi;struct mcp251x_platform_data *pdata = spi->dev.platform_data; +unsigned long flags;int ret; ret =open_candev (net);
@@ -938,9 +939,14 @@ static int mcp251x_open(struct net_devic priv->tx_skb =NULL ; priv->tx_len =0 ; + flags =IRQF_ONESHOT ; +if (pdata->irq_flags) + flags |= pdata->irq_flags; +else + flags |=IRQF_TRIGGER_FALLING ; + ret =request_threaded_irq (spi->irq,NULL , mcp251x_can_ist, - pdata->irq_flags ? pdata->irq_flags :IRQF_TRIGGER_FALLING , -DEVICE_NAME , priv); + flags,DEVICE_NAME , priv);if (ret) {dev_err (&spi->dev,"failed to acquire irq %d\n" , spi->irq);if (pdata->transceiver_enable)
Greg Kroah-Hartman
maintainerPATCH 7/42 can: sja1000: fix handling on dt properties on little endian systems
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christoph Fritz <[email protected]>
commit 0443de5fbf224abf41f688d8487b0c307dc5a4b4 upstream.
To get correct endianes on little endian cpus (like arm) while reading device tree properties, this patch replaces of_get_property() with of_property_read_u32(). While there use of_property_read_bool() for the handling of the boolean "nxp,no-comparator-bypass" property.
--- drivers/net/can/sja1000/sja1000_of_platform.c | 31 ++++++++++++-------------- 1 file changed, 15 insertions(+), 16 deletions(-)
drivers/net/can/sja1000/sja1000_of_platform.c +15 -16
@@ -96,8 +96,8 @@ static int sja1000_ofp_probe(struct platstruct net_device *dev;struct sja1000_priv *priv;struct resource res; -const u32 *prop; -int err, irq, res_size, prop_size; +u32 prop; +int err, irq, res_size;void __iomem *base; err =of_address_to_resource (np,0 , &res);
@@ -138,27 +138,27 @@ static int sja1000_ofp_probe(struct plat priv->read_reg = sja1000_ofp_read_reg; priv->write_reg = sja1000_ofp_write_reg; - prop =of_get_property (np,"nxp,external-clock-frequency" , &prop_size); -if (prop && (prop_size ==sizeof (u32))) - priv->can.clock.freq = *prop /2 ; + err =of_property_read_u32 (np,"nxp,external-clock-frequency" , &prop); +if (!err) + priv->can.clock.freq = prop /2 ;else priv->can.clock.freq =SJA1000_OFP_CAN_CLOCK ;/* default */ - prop =of_get_property (np,"nxp,tx-output-mode" , &prop_size); -if (prop && (prop_size ==sizeof (u32))) - priv->ocr |= *prop &OCR_MODE_MASK ; + err =of_property_read_u32 (np,"nxp,tx-output-mode" , &prop); +if (!err) + priv->ocr |= prop &OCR_MODE_MASK ;else priv->ocr |=OCR_MODE_NORMAL ;/* default */ - prop =of_get_property (np,"nxp,tx-output-config" , &prop_size); -if (prop && (prop_size ==sizeof (u32))) - priv->ocr |= (*prop <<OCR_TX_SHIFT ) &OCR_TX_MASK ; + err =of_property_read_u32 (np,"nxp,tx-output-config" , &prop); +if (!err) + priv->ocr |= (prop <<OCR_TX_SHIFT ) &OCR_TX_MASK ;else priv->ocr |=OCR_TX0_PULLDOWN ;/* default */ - prop =of_get_property (np,"nxp,clock-out-frequency" , &prop_size); -if (prop && (prop_size ==sizeof (u32)) && *prop) { -u32 divider = priv->can.clock.freq *2 / *prop; + err =of_property_read_u32 (np,"nxp,clock-out-frequency" , &prop); +if (!err && prop) { +u32 divider = priv->can.clock.freq *2 / prop;if (divider >1 ) priv->cdr |= divider /2 -1 ;
@@ -168,8 +168,7 @@ static int sja1000_ofp_probe(struct plat priv->cdr |=CDR_CLK_OFF ;/* default */ } - prop =of_get_property (np,"nxp,no-comparator-bypass" ,NULL ); -if (!prop) +if (!of_property_read_bool (np,"nxp,no-comparator-bypass" )) priv->cdr |=CDR_CBP ;/* default */ priv->irq_flags =IRQF_SHARED ;
Greg Kroah-Hartman
maintainerPATCH 8/42 hugetlbfs: stop setting VM_DONTDUMP in initializing vma(VM_HUGETLB)
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Naoya Horiguchi <[email protected]>
commit a2fce9143057f4eb7675a21cca1b6beabe585c8b upstream.
Currently we fail to include any data on hugepages into coredump, because VM_DONTDUMP is set on hugetlbfs's vma. This behavior was recently introduced by commit 314e51b9851b ("mm: kill vma flag VM_RESERVED and mm->reserved_vm counter").
This looks to me a serious regression, so let's fix it.
--- fs/hugetlbfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/hugetlbfs/inode.c +1 -1
@@ -110,7 +110,7 @@ static int hugetlbfs_file_mmap(struct fi* way when do_mmap_pgoff unwinds (may be important on powerpc * and ia64). */ - vma->vm_flags |=VM_HUGETLB |VM_DONTEXPAND |VM_DONTDUMP ; + vma->vm_flags |=VM_HUGETLB |VM_DONTEXPAND ; vma->vm_ops = &hugetlb_vm_ops;if (vma->vm_pgoff & (~huge_page_mask (h) >>PAGE_SHIFT ))
Greg Kroah-Hartman
maintainerPATCH 9/42 hugetlbfs: add swap entry check in follow_hugetlb_page()
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Naoya Horiguchi <[email protected]>
commit 9cc3a5bd40067b9a0fbd49199d0780463fc2140f upstream.
With applying the previous patch "hugetlbfs: stop setting VM_DONTDUMP in initializing vma(VM_HUGETLB)" to reenable hugepage coredump, if a memory error happens on a hugepage and the affected processes try to access the error hugepage, we hit VM_BUG_ON(atomic_read(&page->_count) <= 0) in get_page().
The reason for this bug is that coredump-related code doesn't recognise "hugepage hwpoison entry" with which a pmd entry is replaced when a memory error occurs on a hugepage.
In other words, physical address information is stored in different bit layout between hugepage hwpoison entry and pmd entry, so follow_hugetlb_page() which is called in get_dump_page() returns a wrong page from a given address.
The expected behavior is like this:
absent is_swap_pte FOLL_DUMP Expected behavior
-------------------------------------------------------------------
true false false hugetlb_fault false true false hugetlb_fault false false false return page true false true skip page (to avoid allocation) false true true hugetlb_fault false false true return page
With this patch, we can call hugetlb_fault() and take proper actions (we wait for migration entries, fail with VM_FAULT_HWPOISON_LARGE for hwpoisoned entries,) and as the result we can dump all hugepages except for hwpoisoned ones.
--- mm/hugetlb.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
mm/hugetlb.c +11 -1
@@ -2965,7 +2965,17 @@ int follow_hugetlb_page(struct mm_structbreak ; } -if (absent || +/* +* We need call hugetlb_fault for both hugepages under migration +* (in which case hugetlb_fault waits for the migration,) and +* hwpoisoned hugepages (in which case we need to prevent the +* caller from accessing to them.) In order to do this, we use +* here is_swap_pte instead of is_hugetlb_entry_migration and +* is_hugetlb_entry_hwpoisoned. This is because it simply covers +* both cases, and because we can't follow correct pages +* directly from any kind of swap entries. +*/ +if (absent ||is_swap_pte (huge_ptep_get (pte)) || ((flags &FOLL_WRITE ) && !pte_write (huge_ptep_get (pte)))) {int ret;
Greg Kroah-Hartman
maintainerPATCH 10/42 fs/binfmt_elf.c: fix hugetlb memory check in vma_dump_size()
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Naoya Horiguchi <[email protected]>
commit 23d9e482136e31c9d287633a6e473daa172767c4 upstream.
Documentation/filesystems/proc.txt says about coredump_filter bitmask,
Note bit 0-4 doesn't effect any hugetlb memory. hugetlb memory are only effected by bit 5-6.
However current code can go into the subsequent flag checks of bit 0-4 for vma(VM_HUGETLB). So this patch inserts 'return' and makes it work as written in the document.
--- fs/binfmt_elf.c | 1 + 1 file changed, 1 insertion(+)
fs/binfmt_elf.c +1 -0
@@ -1132,6 +1132,7 @@ static unsigned long vma_dump_size(struc goto whole;if (!(vma->vm_flags &VM_SHARED ) &&FILTER (HUGETLB_PRIVATE )) goto whole; +return 0 ; }/* Do not dump I/O mapped devices or special mappings */
Greg Kroah-Hartman
maintainerPATCH 11/42 kernel/signal.c: stop info leak via the tkill and the tgkill syscalls
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Emese Revfy <[email protected]>
commit b9e146d8eb3b9ecae5086d373b50fa0c1f3e7f0f upstream.
This fixes a kernel memory contents leak via the tkill and tgkill syscalls for compat processes.
This is visible in the siginfo_t->_sifields._rt.si_sigval.sival_ptr field when handling signals delivered from tkill.
The place of the infoleak:
int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from)
{
...
put_user_ex(ptr_to_compat(from->si_ptr), &to->si_ptr);
...
}--- kernel/signal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/signal.c +1 -1
@@ -2880,7 +2880,7 @@ do_send_specific(pid_t tgid, pid_t pid,static int do_tkill (pid_t tgid,pid_t pid,int sig) { -struct siginfo info; +struct siginfo info = {}; info.si_signo = sig; info.si_errno =0 ;
Greg Kroah-Hartman
maintainerPATCH 12/42 hfsplus: fix potential overflow in hfsplus_file_truncate()
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vyacheslav Dubeyko <[email protected]>
commit 12f267a20aecf8b84a2a9069b9011f1661c779b4 upstream.
Change a u32 to loff_t hfsplus_file_truncate().
--- fs/hfsplus/extents.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/hfsplus/extents.c +1 -1
@@ -533,7 +533,7 @@ void hfsplus_file_truncate(struct inodestruct address_space *mapping = inode->i_mapping;struct page *page;void *fsdata; -u32 size = inode->i_size; +loff_t size = inode->i_size; res = pagecache_write_begin(NULL, mapping, size, 0, AOP_FLAG_UNINTERRUPTIBLE,
Greg Kroah-Hartman
maintainerPATCH 13/42 md: raid1,10: Handle REQ_WRITE_SAME flag in write bios
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joe Lawrence <[email protected]>
commit c8dc9c654794a765ca61baed07f84ed8aaa7ca8c upstream.
Set mddev queue's max_write_same_sectors to its chunk_sector value (before disk_stack_limits merges the underlying disk limits.) With that in place, be sure to handle writes coming down from the block layer that have the REQ_WRITE_SAME flag set. That flag needs to be copied into any newly cloned write bio.
--- drivers/md/raid1.c | 7 ++++++- drivers/md/raid10.c | 9 +++++++-- 2 files changed, 13 insertions(+), 3 deletions(-)
drivers/md/raid1.c +6 -1
@@ -1001,6 +1001,7 @@ static void make_request(struct mddev *mconst unsigned long do_flush_fua = (bio->bi_rw & (REQ_FLUSH |REQ_FUA ));const unsigned long do_discard = (bio->bi_rw & (REQ_DISCARD |REQ_SECURE )); +const unsigned long do_same = (bio->bi_rw &REQ_WRITE_SAME );struct md_rdev *blocked_rdev;struct blk_plug_cb *cb;struct raid1_plug_cb *plug =NULL ;
@@ -1302,7 +1303,8 @@ read_again: conf->mirrors[i].rdev->data_offset); mbio->bi_bdev = conf->mirrors[i].rdev->bdev; mbio->bi_end_io = raid1_end_write_request; - mbio->bi_rw =WRITE | do_flush_fua | do_sync | do_discard; + mbio->bi_rw = +WRITE | do_flush_fua | do_sync | do_discard | do_same; mbio->bi_private = r1_bio;atomic_inc (&r1_bio->remaining);
@@ -2819,6 +2821,9 @@ static int run(struct mddev *mddev)if (IS_ERR (conf))return PTR_ERR (conf); +if (mddev->queue) +blk_queue_max_write_same_sectors (mddev->queue, + mddev->chunk_sectors);rdev_for_each (rdev, mddev) {if (!mddev->gendisk)continue ;
drivers/md/raid10.c +7 -2
@@ -1106,6 +1106,7 @@ static void make_request(struct mddev *mconst unsigned long do_fua = (bio->bi_rw &REQ_FUA );const unsigned long do_discard = (bio->bi_rw & (REQ_DISCARD |REQ_SECURE )); +const unsigned long do_same = (bio->bi_rw &REQ_WRITE_SAME );unsigned long flags;struct md_rdev *blocked_rdev;struct blk_plug_cb *cb;
@@ -1461,7 +1462,8 @@ retry_write: rdev)); mbio->bi_bdev = rdev->bdev; mbio->bi_end_io = raid10_end_write_request; - mbio->bi_rw =WRITE | do_sync | do_fua | do_discard; + mbio->bi_rw = +WRITE | do_sync | do_fua | do_discard | do_same; mbio->bi_private = r10_bio;atomic_inc (&r10_bio->remaining);
@@ -1503,7 +1505,8 @@ retry_write: r10_bio, rdev)); mbio->bi_bdev = rdev->bdev; mbio->bi_end_io = raid10_end_write_request; - mbio->bi_rw =WRITE | do_sync | do_fua | do_discard; + mbio->bi_rw = +WRITE | do_sync | do_fua | do_discard | do_same; mbio->bi_private = r10_bio;atomic_inc (&r10_bio->remaining);
@@ -3570,6 +3573,8 @@ static int run(struct mddev *mddev)if (mddev->queue) {blk_queue_max_discard_sectors (mddev->queue, mddev->chunk_sectors); +blk_queue_max_write_same_sectors (mddev->queue, + mddev->chunk_sectors);blk_queue_io_min (mddev->queue, chunk_size);if (conf->geo.raid_disks % conf->geo.near_copies)blk_queue_io_opt (mddev->queue, chunk_size * conf->geo.raid_disks);
Greg Kroah-Hartman
maintainerPATCH 14/42 KVM: x86: fix for buffer overflow in handling of MSR_KVM_SYSTEM_TIME (CVE-2013-1796)
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Honig <[email protected]>
commit c300aa64ddf57d9c5d9c898a64b36877345dd4a9 upstream.
If the guest sets the GPA of the time_page so that the request to update the time straddles a page then KVM will write onto an incorrect page. The write is done byusing kmap atomic to get a pointer to the page for the time structure and then performing a memcpy to that page starting at an offset that the guest controls. Well behaved guests always provide a 32-byte aligned address, however a malicious guest could use this to corrupt host kernel memory.
Tested: Tested against kvmclock unit test.
--- arch/x86/kvm/x86.c | 5 +++++ 1 file changed, 5 insertions(+)
arch/x86/kvm/x86.c +5 -0
@@ -1960,6 +1960,11 @@ int kvm_set_msr_common(struct kvm_vcpu */* ...but clean it before doing the actual write */ vcpu->arch.time_offset = data & ~(PAGE_MASK |1 ); +/* Check that the address is 32-byte aligned. */ +if (vcpu->arch.time_offset & + (sizeof (struct pvclock_vcpu_time_info ) -1 )) +break ; + vcpu->arch.time_page =gfn_to_page (vcpu->kvm, data >>PAGE_SHIFT );
Greg Kroah-Hartman
maintainerPATCH 15/42 KVM: x86: Convert MSR_KVM_SYSTEM_TIME to use gfn_to_hva_cache functions (CVE-2013-1797)
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Honig <[email protected]>
commit 0b79459b482e85cb7426aa7da683a9f2c97aeae1 upstream.
There is a potential use after free issue with the handling of MSR_KVM_SYSTEM_TIME. If the guest specifies a GPA in a movable or removable memory such as frame buffers then KVM might continue to write to that address even after it's removed via KVM_SET_USER_MEMORY_REGION. KVM pins the page in memory so it's unlikely to cause an issue, but if the user space component re-purposes the memory previously used for the guest, then the guest will be able to corrupt that memory.
Tested: Tested against kvmclock unit test
--- arch/x86/include/asm/kvm_host.h | 4 +-- arch/x86/kvm/x86.c | 47 +++++++++++++++++----------------------- 2 files changed, 22 insertions(+), 29 deletions(-)
arch/x86/include/asm/kvm_host.h +2 -2
@@ -419,8 +419,8 @@ struct kvm_vcpu_arch {gpa_t time;struct pvclock_vcpu_time_info hv_clock;unsigned int hw_tsc_khz; -unsigned int time_offset; -struct page *time_page; +struct gfn_to_hva_cache pv_time; +bool pv_time_enabled;/* set guest stopped flag in pvclock flags field */ bool pvclock_set_guest_stopped_request;
arch/x86/kvm/x86.c +20 -27
109 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 16/42 KVM: Fix bounds checking in ioapic indirect register reads (CVE-2013-1798)
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Honig <[email protected]>
commit a2c118bfab8bc6b8bb213abfc35201e441693d55 upstream.
If the guest specifies a IOAPIC_REG_SELECT with an invalid value and follows that with a read of the IOAPIC_REG_WINDOW KVM does not properly validate that request. ioapic_read_indirect contains an ASSERT(redir_index < IOAPIC_NUM_PINS), but the ASSERT has no effect in non-debug builds. In recent kernels this allows a guest to cause a kernel oops by reading invalid memory. In older kernels (pre-3.3) this allows a guest to read from large ranges of host memory.
Tested: tested against apic unit tests.
--- virt/kvm/ioapic.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
virt/kvm/ioapic.c +5 -2
@@ -73,9 +73,12 @@ static unsigned long ioapic_read_indirecu32 redir_index = (ioapic->ioregsel -0x10 ) >>1 ;u64 redir_content; -ASSERT (redir_index <IOAPIC_NUM_PINS ); +if (redir_index <IOAPIC_NUM_PINS ) + redir_content = + ioapic->redirtbl[redir_index].bits; +else + redir_content = ~0ULL ; - redir_content = ioapic->redirtbl[redir_index].bits; result = (ioapic->ioregsel &0x1 ) ? (redir_content >>32 ) &0xffffffff : redir_content &0xffffffff ;
Greg Kroah-Hartman
maintainerPATCH 17/42 KVM: Allow cross page reads and writes from cached translations.
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrew Honig <[email protected]>
commit 8f964525a121f2ff2df948dac908dcc65be21b5b upstream.
This patch adds support for kvm_gfn_to_hva_cache_init functions for reads and writes that will cross a page. If the range falls within the same memslot, then this will be a fast operation. If the range is split between two memslots, then the slower kvm_read_guest and kvm_write_guest are used.
Tested: Test against kvm_clock unit tests.
--- arch/x86/kvm/lapic.c | 2 - arch/x86/kvm/x86.c | 13 +++++------- include/linux/kvm_host.h | 2 - include/linux/kvm_types.h | 1 virt/kvm/kvm_main.c | 47 ++++++++++++++++++++++++++++++++++++---------- 5 files changed, 46 insertions(+), 19 deletions(-)
arch/x86/kvm/lapic.c +1 -1
@@ -1781,7 +1781,7 @@ int kvm_lapic_enable_pv_eoi(struct kvm_vif (!pv_eoi_enabled (vcpu))return 0 ;return kvm_gfn_to_hva_cache_init (vcpu->kvm, &vcpu->arch.pv_eoi.data, - addr); + addr,sizeof (u8)); }void kvm_lapic_init (void )
arch/x86/kvm/x86.c +6 -7
@@ -1825,7 +1825,8 @@ static int kvm_pv_enable_async_pf(structreturn 0 ; } -if (kvm_gfn_to_hva_cache_init (vcpu->kvm, &vcpu->arch.apf.data, gpa)) +if (kvm_gfn_to_hva_cache_init (vcpu->kvm, &vcpu->arch.apf.data, gpa, +sizeof (u32)))return 1 ; vcpu->arch.apf.send_user_only = !(data &KVM_ASYNC_PF_SEND_ALWAYS );
@@ -1953,12 +1954,9 @@ int kvm_set_msr_common(struct kvm_vcpu * gpa_offset = data & ~(PAGE_MASK |1 ); -/* Check that the address is 32-byte aligned. */ -if (gpa_offset & (sizeof (struct pvclock_vcpu_time_info ) -1 )) -break ; -if (kvm_gfn_to_hva_cache_init (vcpu->kvm, - &vcpu->arch.pv_time, data & ~1ULL )) + &vcpu->arch.pv_time, data & ~1ULL , +sizeof (struct pvclock_vcpu_time_info ))) vcpu->arch.pv_time_enabled = false;else vcpu->arch.pv_time_enabled = true;
@@ -1978,7 +1976,8 @@ int kvm_set_msr_common(struct kvm_vcpu *return 1 ;if (kvm_gfn_to_hva_cache_init (vcpu->kvm, &vcpu->arch.st.stime, - data &KVM_STEAL_VALID_BITS )) + data &KVM_STEAL_VALID_BITS , +sizeof (struct kvm_steal_time )))return 1 ; vcpu->arch.st.msr_val = data;
include/linux/kvm_host.h +1 -1
@@ -511,7 +511,7 @@ int kvm_write_guest(struct kvm *kvm, gpaint kvm_write_guest_cached (struct kvm *kvm,struct gfn_to_hva_cache *ghc,void *data,unsigned long len);int kvm_gfn_to_hva_cache_init (struct kvm *kvm,struct gfn_to_hva_cache *ghc, -gpa_t gpa); +gpa_t gpa,unsigned long len);int kvm_clear_guest_page (struct kvm *kvm,gfn_t gfn,int offset,int len);int kvm_clear_guest (struct kvm *kvm,gpa_t gpa,unsigned long len);struct kvm_memory_slot *gfn_to_memslot (struct kvm *kvm,gfn_t gfn);
include/linux/kvm_types.h +1 -0
@@ -71,6 +71,7 @@ struct gfn_to_hva_cache {u64 generation;gpa_t gpa;unsigned long hva; +unsigned long len;struct kvm_memory_slot *memslot; };
virt/kvm/kvm_main.c +37 -10
74 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 18/42 ARM: i.MX35: enable MAX clock
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sascha Hauer <[email protected]>
commit 5dc2eb7da1e387e31ce54f54af580c6a6f512ca6 upstream.
The i.MX35 has two bits per clock gate which are decoded as follows:
0b00 -> clock off
0b01 -> clock is on in run mode, off in wait/doze
0b10 -> clock is on in run/wait mode, off in doze
0b11 -> clock is always onThe reset value for the MAX clock is 0b10.
The MAX clock is needed by the SoC, yet unused in the Kernel, so the common clock framework will disable it during late init time. It will only disable clocks though which it detects as being turned on. This detection is made depending on the lower bit of the gate. If the reset value has been altered by the bootloader to 0b11 the clock framework will detect the clock as turned on, yet unused, hence it will turn it off and the system locks up.
This patch turns the MAX clock on unconditionally making the Kernel independent of the bootloader.
--- arch/arm/mach-imx/clk-imx35.c | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-imx/clk-imx35.c +1 -0
@@ -265,6 +265,7 @@ int __init mx35_clocks_init()clk_prepare_enable (clk[gpio3_gate]);clk_prepare_enable (clk[iim_gate]);clk_prepare_enable (clk[emi_gate]); +clk_prepare_enable (clk[max_gate]);/* * SCC is needed to boot via mmc after a watchdog reset. The clock code
Greg Kroah-Hartman
maintainerPATCH 19/42 ARM: clk-imx35: Bugfix iomux clock
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Markus Pargmann <[email protected]>
commit cab1e0a36c9dd0b0671fb84197ed294513f5adc1 upstream.
This patch enables iomuxc_gate clock. It is necessary to be able to reconfigure iomux pads. Without this clock enabled, the clk_disable_unused function will disable this clock and the iomux pads are not configurable anymore. This happens at every boot. After a reboot (watchdog system reset) the clock is not enabled again, so all iomux pad reconfigurations in boot code are without effect.
The iomux pads should be always configurable, so this patch always enables it.
--- arch/arm/mach-imx/clk-imx35.c | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-imx/clk-imx35.c +1 -0
@@ -266,6 +266,7 @@ int __init mx35_clocks_init()clk_prepare_enable (clk[iim_gate]);clk_prepare_enable (clk[emi_gate]);clk_prepare_enable (clk[max_gate]); +clk_prepare_enable (clk[iomuxc_gate]);/* * SCC is needed to boot via mmc after a watchdog reset. The clock code
Greg Kroah-Hartman
maintainerPATCH 20/42 tg3: Add 57766 device support.
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matt Carlson <[email protected]>
commit d3f677afb8076d09d090ff0a5d1229c9dd9f136e upstream.
The patch also adds a couple of fixes
- For the 57766 and non Ax versions of 57765, bootcode needs to setup the PCIE Fast Training Sequence (FTS) value to prevent transmit hangs. Unfortunately, it does not have enough room in the selfboot case (i.e. devices with no NVRAM). The driver needs to implement this.
- For performance reasons, the 2k DMA engine mode on the 57766 should be enabled and dma size limited to 2k for standard sized packets.
--- drivers/net/ethernet/broadcom/tg3.c | 18 +++++++++++++++++- drivers/net/ethernet/broadcom/tg3.h | 2 ++ 2 files changed, 19 insertions(+), 1 deletion(-)
drivers/net/ethernet/broadcom/tg3.c +17 -1
@@ -330,6 +330,7 @@ static DEFINE_PCI_DEVICE_TABLE(tg3_pci_t {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5719)}, {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5720)}, {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57762)}, + {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57766)}, {PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9DXX)}, {PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9MXX)}, {PCI_DEVICE(PCI_VENDOR_ID_ALTIMA, PCI_DEVICE_ID_ALTIMA_AC1000)},
@@ -9103,7 +9104,14 @@ static int tg3_reset_hw(struct tg3 *tp, }if (GET_CHIP_REV (tp->pci_chip_rev_id) !=CHIPREV_57765_AX ) { -u32 grc_mode =tr32 (GRC_MODE ); +u32 grc_mode; + +/* Fix transmit hangs */ + val =tr32 (TG3_CPMU_PADRNG_CTL ); + val |=TG3_CPMU_PADRNG_CTL_RDIV2 ; +tw32 (TG3_CPMU_PADRNG_CTL , val); + + grc_mode =tr32 (GRC_MODE );/* Access the lower 1K of DL PCIE block registers. */ val = grc_mode & ~GRC_MODE_PCIE_PORT_MASK ;
@@ -9413,6 +9421,14 @@ static int tg3_reset_hw(struct tg3 *tp,if (tg3_flag (tp,PCI_EXPRESS )) rdmac_mode |=RDMAC_MODE_FIFO_LONG_BURST ; +if (GET_ASIC_REV (tp->pci_chip_rev_id) ==ASIC_REV_57766 ) { + tp->dma_limit =0 ; +if (tp->dev->mtu <=ETH_DATA_LEN ) { + rdmac_mode |=RDMAC_MODE_JMB_2K_MMRR ; + tp->dma_limit =TG3_TX_BD_DMA_MAX_2K ; + } + } +if (tg3_flag (tp,HW_TSO_1 ) ||tg3_flag (tp,HW_TSO_2 ) ||tg3_flag (tp,HW_TSO_3 ))
drivers/net/ethernet/broadcom/tg3.h +2 -0
@@ -1159,6 +1159,8 @@#define CPMU_MUTEX_GNT_DRIVER 0x00001000#define TG3_CPMU_PHY_STRAP 0x00003664#define TG3_CPMU_PHY_STRAP_IS_SERDES 0x00000020 +#define TG3_CPMU_PADRNG_CTL 0x00003668 +#define TG3_CPMU_PADRNG_CTL_RDIV2 0x00040000/* 0x3664 --> 0x36b0 unused */ #define TG3_CPMU_EEE_MODE 0x000036b0
Greg Kroah-Hartman
maintainerPATCH 21/42 sched: Convert BUG_ON()s in try_to_wake_up_local() to WARN_ON_ONCE()s
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <[email protected]>
commit 383efcd00053ec40023010ce5034bd702e7ab373 upstream.
try_to_wake_up_local() should only be invoked to wake up another task in the same runqueue and BUG_ON()s are used to enforce the rule. Missing try_to_wake_up_local() can stall workqueue execution but such stalls are likely to be finite either by another work item being queued or the one blocked getting unblocked. There's no reason to trigger BUG while holding rq lock crashing the whole system.
Convert BUG_ON()s in try_to_wake_up_local() to WARN_ON_ONCE()s.
--- kernel/sched/core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
kernel/sched/core.c +4 -2
@@ -1488,8 +1488,10 @@ static void try_to_wake_up_local(struct {struct rq *rq =task_rq (p); -BUG_ON (rq !=this_rq ()); -BUG_ON (p == current); +if (WARN_ON_ONCE (rq !=this_rq ()) || +WARN_ON_ONCE (p == current)) +return ; +lockdep_assert_held (&rq->lock);if (!raw_spin_trylock (&p->pi_lock)) {
Greg Kroah-Hartman
maintainerPATCH 22/42 sched/debug: Fix sd->*_idx limit range avoiding overflow
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: libin <[email protected]>
commit fd9b86d37a600488dbd80fe60cca46b822bff1cd upstream.
Commit 201c373e8e ("sched/debug: Limit sd->*_idx range on sysctl") was an incomplete bug fix.
This patch fixes sd->*_idx limit range to [0 ~ CPU_LOAD_IDX_MAX-1] avoiding array overflow caused by setting sd->*_idx to CPU_LOAD_IDX_MAX on sysctl.
--- kernel/sched/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/core.c +1 -1
@@ -4950,7 +4950,7 @@ static void sd_free_ctl_entry(struct ctl }static int min_load_idx =0 ; -static int max_load_idx =CPU_LOAD_IDX_MAX ; +static int max_load_idx =CPU_LOAD_IDX_MAX -1 ; static void set_table_entry(struct ctl_table *entry,
Greg Kroah-Hartman
maintainerPATCH 23/42 ARM: 7696/1: Fix kexec by setting outer_cache.inv_all for Feroceon
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Illia Ragozin <[email protected]>
commit cd272d1ea71583170e95dde02c76166c7f9017e6 upstream.
On Feroceon the L2 cache becomes non-coherent with the CPU when the L1 caches are disabled. Thus the L2 needs to be invalidated after both L1 caches are disabled.
On kexec before the starting the code for relocation the kernel, the L1 caches are disabled in cpu_froc_fin (cpu_v7_proc_fin for Feroceon), but after L2 cache is never invalidated, because inv_all is not set in cache-feroceon-l2.c.
So kernel relocation and decompression may has (and usually has) errors. Setting the function enables L2 invalidation and fixes the issue.
--- arch/arm/mm/cache-feroceon-l2.c | 1 + 1 file changed, 1 insertion(+)
arch/arm/mm/cache-feroceon-l2.c +1 -0
@@ -343,6 +343,7 @@ void __init feroceon_l2_init(int __l2_wt outer_cache.inv_range = feroceon_l2_inv_range; outer_cache.clean_range = feroceon_l2_clean_range; outer_cache.flush_range = feroceon_l2_flush_range; + outer_cache.inv_all = l2_inv_all;enable_l2 ();
Greg Kroah-Hartman
maintainerPATCH 24/42 ARM: 7698/1: perf: fix group validation when using enable_on_exec
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <[email protected]>
commit cb2d8b342aa084d1f3ac29966245dec9163677fb upstream.
Events may be created with attr->disabled == 1 and attr->enable_on_exec == 1, which confuses the group validation code because events with the PERF_EVENT_STATE_OFF are not considered candidates for scheduling, which may lead to failure at group scheduling time.
This patch fixes the validation check for ARM, so that events in the OFF state are still considered when enable_on_exec is true.
--- arch/arm/kernel/perf_event.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
arch/arm/kernel/perf_event.c +4 -1
@@ -261,7 +261,10 @@ 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 (event->pmu != leader_pmu || event->state <=PERF_EVENT_STATE_OFF ) +if (event->pmu != leader_pmu || event->state <PERF_EVENT_STATE_OFF ) +return 1 ; + +if (event->state ==PERF_EVENT_STATE_OFF && !event->attr.enable_on_exec)return 1 ;return armpmu->get_event_idx (hw_events, event) >=0 ;
Greg Kroah-Hartman
maintainerPATCH 25/42 ath9k_htc: accept 1.x firmware newer than 1.3
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <[email protected]>
commit 319e7bd96aca64a478f3aad40711c928405b8b77 upstream.
Since the firmware has been open sourced, the minor version has been bumped to 1.4 and the API/ABI will stay compatible across further 1.x releases.
--- drivers/net/wireless/ath/ath9k/htc_drv_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/htc_drv_init.c +1 -1
@@ -796,7 +796,7 @@ static int ath9k_init_firmware_version(s* required version. */ if (priv->fw_version_major !=MAJOR_VERSION_REQ || - priv->fw_version_minor !=MINOR_VERSION_REQ ) { + priv->fw_version_minor <MINOR_VERSION_REQ ) {dev_err (priv->dev,"ath9k_htc: Please upgrade to FW version %d.%d\n" ,MAJOR_VERSION_REQ ,MINOR_VERSION_REQ );return -EINVAL ;
Greg Kroah-Hartman
maintainerPATCH 26/42 ath9k_hw: change AR9580 initvals to fix a stability issue
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <[email protected]>
commit f09a878511997c25a76bf111a32f6b8345a701a5 upstream.
The hardware parsing of Control Wrapper Frames needs to be disabled, as it has been causing spurious decryption error reports. The initvals for other chips have been updated to disable it, but AR9580 was left out for some reason.
--- drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h +1 -1
@@ -519,7 +519,7 @@ static const u32 ar9580_1p0_mac_core[][2 {0x00008258, 0x00000000}, {0x0000825c, 0x40000000}, {0x00008260, 0x00080922}, - {0x00008264, 0x9bc00010}, + {0x00008264, 0x9d400010}, {0x00008268, 0xffffffff}, {0x0000826c, 0x0000ffff}, {0x00008270, 0x00000000},
Greg Kroah-Hartman
maintainerPATCH 27/42 mac80211: fix cfg80211 interaction on auth/assoc request
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
commit 7b119dc06d871405fc7c3e9a73a6c987409ba639 upstream.
If authentication (or association with FT) is requested by userspace, mac80211 currently doesn't tell cfg80211 that it disconnected from the AP. That leaves inconsistent state:
cfg80211 thinks it's connected while mac80211 thinks it's not. Typically this won't last long, as soon as mac80211 reports the new association to cfg80211 the old one goes away. If, however, the new authentication or association doesn't succeed, then cfg80211 will forever think the old one still exists and will refuse attempts to authenticate or associate with the AP it thinks it's connected to.
Anders reported that this leads to it taking a very long time to reconnect to a network, or never even succeeding. I tested this with an AP hacked to never respond to auth frames, and one that works, and with just those two the system never recovers because one won't work and cfg80211 thinks it's connected to the other so refuses connections to it.
To fix this, simply make mac80211 tell cfg80211 when it is no longer connected to the old AP, while authenticating or associating to a new one.
--- net/mac80211/mlme.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-)
net/mac80211/mlme.c +20 -4
@@ -3723,8 +3723,16 @@ int ieee80211_mgd_auth(struct ieee80211_/* prep auth_data so we don't go into idle on disassoc */ ifmgd->auth_data = auth_data; -if (ifmgd->associated) -ieee80211_set_disassoc (sdata,0 ,0 , false,NULL ); +if (ifmgd->associated) { +u8 frame_buf[IEEE80211_DEAUTH_FRAME_LEN ]; + +ieee80211_set_disassoc (sdata,IEEE80211_STYPE_DEAUTH , +WLAN_REASON_UNSPECIFIED , + false, frame_buf); + +__cfg80211_send_deauth (sdata->dev, frame_buf, +sizeof (frame_buf)); + }sdata_info (sdata,"authenticate with %pM\n" , req->bss->bssid);
@@ -3783,8 +3791,16 @@ int ieee80211_mgd_assoc(struct ieee80211mutex_lock (&ifmgd->mtx); -if (ifmgd->associated) -ieee80211_set_disassoc (sdata,0 ,0 , false,NULL ); +if (ifmgd->associated) { +u8 frame_buf[IEEE80211_DEAUTH_FRAME_LEN ]; + +ieee80211_set_disassoc (sdata,IEEE80211_STYPE_DEAUTH , +WLAN_REASON_UNSPECIFIED , + false, frame_buf); + +__cfg80211_send_deauth (sdata->dev, frame_buf, +sizeof (frame_buf)); + }if (ifmgd->auth_data && !ifmgd->auth_data->done) { err = -EBUSY ;
Greg Kroah-Hartman
maintainerPATCH 28/42 ssb: implement spurious tone avoidance
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafał Miłecki <[email protected]>
commit 46fc4c909339f5a84d1679045297d9d2fb596987 upstream.
And make use of it in b43. This fixes a regression introduced with 49d55cef5b1925a5c1efb6aaddaa40fc7c693335
b43: N-PHY: implement spurious tone avoidance
This commit made BCM4322 use only MCS 0 on channel 13, which of course resulted in performance drop (down to 0.7Mb/s).
--- drivers/net/wireless/b43/phy_n.c | 3 ++- drivers/ssb/driver_chipcommon_pmu.c | 29 +++++++++++++++++++++++++++++ include/linux/ssb/ssb_driver_chipcommon.h | 2 ++ 3 files changed, 33 insertions(+), 1 deletion(-)
drivers/net/wireless/b43/phy_n.c +2 -1
@@ -5165,7 +5165,8 @@ static void b43_nphy_pmu_spur_avoid(stru#endif #ifdef CONFIG_B43_SSB case B43_BUS_SSB : -/* FIXME */ +ssb_pmu_spuravoid_pllupdate (&dev->dev->sdev->bus->chipco, + avoid);break ;#endif }
drivers/ssb/driver_chipcommon_pmu.c +29 -0
@@ -675,3 +675,32 @@ u32 ssb_pmu_get_controlclock(struct ssb_return 0 ; } } + +void ssb_pmu_spuravoid_pllupdate (struct ssb_chipcommon *cc,int spuravoid) +{ +u32 pmu_ctl =0 ; + +switch (cc->dev->bus->chip_id) { +case 0x4322 : +ssb_chipco_pll_write (cc,SSB_PMU1_PLLCTL0 ,0x11100070 ); +ssb_chipco_pll_write (cc,SSB_PMU1_PLLCTL1 ,0x1014140a ); +ssb_chipco_pll_write (cc,SSB_PMU1_PLLCTL5 ,0x88888854 ); +if (spuravoid ==1 ) +ssb_chipco_pll_write (cc,SSB_PMU1_PLLCTL2 ,0x05201828 ); +else +ssb_chipco_pll_write (cc,SSB_PMU1_PLLCTL2 ,0x05001828 ); + pmu_ctl =SSB_CHIPCO_PMU_CTL_PLL_UPD ; +break ; +case 43222 : +/* TODO: BCM43222 requires updating PLLs too */ +return ; +default : + ssb_printk(KERN_ERR PFX +"Unknown spuravoidance settings for chip 0x%04X, not changing PLL\n" , + cc->dev->bus->chip_id); +return ; + } + +chipco_set32 (cc,SSB_CHIPCO_PMU_CTL , pmu_ctl); +} +EXPORT_SYMBOL_GPL (ssb_pmu_spuravoid_pllupdate);
include/linux/ssb/ssb_driver_chipcommon.h +2 -0
@@ -219,6 +219,7 @@#define SSB_CHIPCO_PMU_CTL 0x0600/* PMU control */ #define SSB_CHIPCO_PMU_CTL_ILP_DIV 0xFFFF0000/* ILP div mask */ #define SSB_CHIPCO_PMU_CTL_ILP_DIV_SHIFT 16 +#define SSB_CHIPCO_PMU_CTL_PLL_UPD 0x00000400#define SSB_CHIPCO_PMU_CTL_NOILPONW 0x00000200/* No ILP on wait */ #define SSB_CHIPCO_PMU_CTL_HTREQEN 0x00000100/* HT req enable */ #define SSB_CHIPCO_PMU_CTL_ALPREQEN 0x00000080/* ALP req enable */
@@ -667,5 +668,6 @@ enum ssb_pmu_ldo_volt_id {void ssb_pmu_set_ldo_voltage (struct ssb_chipcommon *cc,enum ssb_pmu_ldo_volt_id id,u32 voltage);void ssb_pmu_set_ldo_paref (struct ssb_chipcommon *cc,bool on); +void ssb_pmu_spuravoid_pllupdate (struct ssb_chipcommon *cc,int spuravoid);#endif /* LINUX_SSB_CHIPCO_H_ */
Greg Kroah-Hartman
maintainerPATCH 29/42 crypto: algif - suppress sending source address information in recvmsg
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathias Krause <[email protected]>
commit 72a763d805a48ac8c0bf48fdb510e84c12de51fe upstream.
The current code does not set the msg_namelen member to 0 and therefore makes net/socket.c leak the local sockaddr_storage variable to userland -- 128 bytes of kernel stack memory. Fix that.
--- crypto/algif_hash.c | 2 ++ crypto/algif_skcipher.c | 1 + 2 files changed, 3 insertions(+)
crypto/algif_hash.c +2 -0
@@ -161,6 +161,8 @@ static int hash_recvmsg(struct kiocb *unelse if (len < ds) msg->msg_flags |=MSG_TRUNC ; + msg->msg_namelen =0 ; +lock_sock (sk);if (ctx->more) { ctx->more =0 ;
crypto/algif_skcipher.c +1 -0
@@ -432,6 +432,7 @@ static int skcipher_recvmsg(struct kiocblong copied =0 ;lock_sock (sk); + msg->msg_namelen =0 ;for (iov = msg->msg_iov, iovlen = msg->msg_iovlen; iovlen >0 ; iovlen--, iov++) {unsigned long seglen = iov->iov_len;
Greg Kroah-Hartman
maintainerPATCH 30/42 perf: Treat attr.config as u64 in perf_swevent_init()
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tommi Rantala <[email protected]>
commit 8176cced706b5e5d15887584150764894e94e02f upstream.
Trinity discovered that we fail to check all 64 bits of attr.config passed by user space, resulting to out-of-bounds access of the perf_swevent_enabled array in sw_perf_event_destroy().
Introduced in commit b0a873ebb ("perf: Register PMU implementations").
--- kernel/events/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/events/core.c +1 -1
@@ -5328,7 +5328,7 @@ static void sw_perf_event_destroy(structstatic int perf_swevent_init (struct perf_event *event) { -int event_id = event->attr.config; +u64 event_id = event->attr.config;if (event->attr.type !=PERF_TYPE_SOFTWARE )return -ENOENT ;
Greg Kroah-Hartman
maintainerPATCH 31/42 perf/x86: Fix offcore_rsp valid mask for SNB/IVB
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephane Eranian <[email protected]>
commit f1923820c447e986a9da0fc6bf60c1dccdf0408e upstream.
The valid mask for both offcore_response_0 andoffcore_response_1 was wrong for SNB/SNB-EP,
IVB/IVB-EP. It was possible to write to
reserved bit and cause a GP fault crashing
the kernel.
This patch fixes the problem by correctly marking the reserved bits in the valid mask for all the processors mentioned above.
A distinction between desktop and server parts is introduced because bits 24-30 are only available on the server parts.
This version of the patch is just a rebase to perf/urgent tree and should apply to older kernels as well.
--- arch/x86/kernel/cpu/perf_event_intel.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)
arch/x86/kernel/cpu/perf_event_intel.c +16 -4
@@ -128,8 +128,14 @@ static struct event_constraint intel_gen };static struct extra_reg intel_snb_extra_regs[]__read_mostly = { -INTEL_EVENT_EXTRA_REG (0xb7 ,MSR_OFFCORE_RSP_0 ,0x3fffffffffull ,RSP_0 ), -INTEL_EVENT_EXTRA_REG (0xbb ,MSR_OFFCORE_RSP_1 ,0x3fffffffffull ,RSP_1 ), +INTEL_EVENT_EXTRA_REG (0xb7 ,MSR_OFFCORE_RSP_0 ,0x3f807f8fffull ,RSP_0 ), +INTEL_EVENT_EXTRA_REG (0xbb ,MSR_OFFCORE_RSP_1 ,0x3f807f8fffull ,RSP_1 ), +EVENT_EXTRA_END +}; + +static struct extra_reg intel_snbep_extra_regs[]__read_mostly = { +INTEL_EVENT_EXTRA_REG (0xb7 ,MSR_OFFCORE_RSP_0 ,0x3fffff8fffull ,RSP_0 ), +INTEL_EVENT_EXTRA_REG (0xbb ,MSR_OFFCORE_RSP_1 ,0x3fffff8fffull ,RSP_1 ),EVENT_EXTRA_END };
@@ -2072,7 +2078,10 @@ __init int intel_pmu_init(void) x86_pmu.event_constraints = intel_snb_event_constraints; x86_pmu.pebs_constraints = intel_snb_pebs_event_constraints; x86_pmu.pebs_aliases = intel_pebs_aliases_snb; - x86_pmu.extra_regs = intel_snb_extra_regs; +if (boot_cpu_data.x86_model ==45 ) + x86_pmu.extra_regs = intel_snbep_extra_regs; +else + x86_pmu.extra_regs = intel_snb_extra_regs;/* all extra regs are per-cpu when HT is on */ x86_pmu.er_flags |=ERF_HAS_RSP_1 ; x86_pmu.er_flags |=ERF_NO_HT_SHARING ;
@@ -2098,7 +2107,10 @@ __init int intel_pmu_init(void) x86_pmu.event_constraints = intel_snb_event_constraints; x86_pmu.pebs_constraints = intel_ivb_pebs_event_constraints; x86_pmu.pebs_aliases = intel_pebs_aliases_snb; - x86_pmu.extra_regs = intel_snb_extra_regs; +if (boot_cpu_data.x86_model ==62 ) + x86_pmu.extra_regs = intel_snbep_extra_regs; +else + x86_pmu.extra_regs = intel_snb_extra_regs;/* all extra regs are per-cpu when HT is on */ x86_pmu.er_flags |=ERF_HAS_RSP_1 ; x86_pmu.er_flags |=ERF_NO_HT_SHARING ;
Greg Kroah-Hartman
maintainerPATCH 32/42 userns: Dont let unprivileged users trick privileged users into setting the id_map
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Eric W. Biederman" <[email protected]>
commit 6708075f104c3c9b04b23336bb0366ca30c3931b upstream.
When we require privilege for setting /proc/<pid>/uid_map or /proc/<pid>/gid_map no longer allow an unprivileged user to open the file and pass it to a privileged program to write to the file.
Instead when privilege is required require both the opener and the writer to have the necessary capabilities.
I have tested this code and verified that setting /proc/<pid>/uid_map fails when an unprivileged user opens the file and a privielged user attempts to set the mapping, that unprivileged users can still map their own id, and that a privileged users can still setup an arbitrary mapping.
--- kernel/user_namespace.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
kernel/user_namespace.c +8 -4
@@ -25,7 +25,8 @@static struct kmem_cache *user_ns_cachep__read_mostly ; -static bool new_idmap_permitted (struct user_namespace *ns,int cap_setid, +static bool new_idmap_permitted (const struct file *file, +struct user_namespace *ns,int cap_setid,struct uid_gid_map *map);static void set_cred_user_ns (struct cred *cred,struct user_namespace *user_ns)
@@ -666,7 +667,7 @@ static ssize_t map_write(struct file *fi ret = -EPERM ;/* Validate the user is allowed to use user id's mapped to. */ -if (!new_idmap_permitted (ns, cap_setid, &new_map)) +if (!new_idmap_permitted (file, ns, cap_setid, &new_map)) goto out;/* Map the lower ids from the parent user namespace to the
@@ -753,7 +754,8 @@ ssize_t proc_projid_map_write(struct fil &ns->projid_map, &ns->parent->projid_map); } -static bool new_idmap_permitted (struct user_namespace *ns,int cap_setid, +static bool new_idmap_permitted (const struct file *file, +struct user_namespace *ns,int cap_setid,struct uid_gid_map *new_map) {/* Allow mapping to your own filesystem ids */
@@ -777,8 +779,10 @@ static bool new_idmap_permitted(struct u/* Allow the specified ids if we have the appropriate capability * (CAP_SETUID or CAP_SETGID) over the parent user namespace. +* And the opener of the id file also had the approprpiate capability. */ -if (ns_capable (ns->parent, cap_setid)) +if (ns_capable (ns->parent, cap_setid) && +file_ns_capable (file, ns->parent, cap_setid))return true;return false;
Greg Kroah-Hartman
maintainerPATCH 33/42 userns: Check uid_maps openers fsuid, not the current fsuid
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Lutomirski <[email protected]>
commit e3211c120a85b792978bcb4be7b2886df18d27f0 upstream.
--- kernel/user_namespace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/user_namespace.c +2 -2
@@ -763,12 +763,12 @@ static bool new_idmap_permitted(const stu32 id = new_map->extent[0 ].lower_first;if (cap_setid ==CAP_SETUID ) {kuid_t uid =make_kuid (ns->parent, id); -if (uid_eq (uid,current_fsuid ())) +if (uid_eq (uid, file->f_cred->fsuid))return true; }else if (cap_setid ==CAP_SETGID ) {kgid_t gid =make_kgid (ns->parent, id); -if (gid_eq (gid,current_fsgid ())) +if (gid_eq (gid, file->f_cred->fsgid))return true; } }
Greg Kroah-Hartman
maintainerPATCH 34/42 userns: Changing any namespace id mappings should require privileges
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Lutomirski <[email protected]>
commit 41c21e351e79004dbb4efa4bc14a53a7e0af38c5 upstream.
Changing uid/gid/projid mappings doesn't change your id within the namespace; it reconfigures the namespace. Unprivileged programs should *not* be able to write these files. (We're also checking the privileges on the wrong task.)
Given the write-once nature of these files and the other security checks, this is likely impossible to usefully exploit.
--- kernel/user_namespace.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
kernel/user_namespace.c +3 -3
@@ -576,10 +576,10 @@ static ssize_t map_write(struct file *fiif (map->nr_extents !=0 ) goto out; -/* Require the appropriate privilege CAP_SETUID or CAP_SETGID -* over the user namespace in order to set the id mapping. +/* +* Adjusting namespace settings requires capabilities on the target. */ -if (cap_valid (cap_setid) && !ns_capable (ns, cap_setid)) +if (cap_valid (cap_setid) && !file_ns_capable (file, ns,CAP_SYS_ADMIN )) goto out;/* Get a buffer */
Greg Kroah-Hartman
maintainerPATCH 35/42 vm: add vm_iomap_memory() helper function
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
commit b4cbb197c7e7a68dbad0d491242e3ca67420c13e upstream.
Various drivers end up replicating the code to mmap() their memory buffers into user space, and our core memory remapping function may be very flexible but it is unnecessarily complicated for the common cases to use.
Our internal VM uses pfn's ("page frame numbers") which simplifies things for the VM, and allows us to pass physical addresses around in a denser and more efficient format than passing a "phys_addr_t" around, and having to shift it up and down by the page size. But it just means that drivers end up doing that shifting instead at the interface level.
It also means that drivers end up mucking around with internal VM things like the vma details (vm_pgoff, vm_start/end) way more than they really need to.
So this just exports a function to map a certain physical memory range into user space (using a phys_addr_t based interface that is much more natural for a driver) and hides all the complexity from the driver. Some drivers will still end up tweaking the vm_page_prot details for things like prefetching or cacheability etc, but that's actually relevant to the driver, rather than caring about what the page offset of the mapping is into the particular IO memory region.
--- include/linux/mm.h | 2 ++ mm/memory.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+)
include/linux/mm.h +2 -0
@@ -1623,6 +1623,8 @@ int vm_insert_pfn(struct vm_area_struct unsigned long pfn);int vm_insert_mixed (struct vm_area_struct *vma,unsigned long addr,unsigned long pfn); +int vm_iomap_memory (struct vm_area_struct *vma,phys_addr_t start,unsigned long len); +struct page *follow_page (struct vm_area_struct *,unsigned long address,unsigned int foll_flags);
mm/memory.c +47 -0
53 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 36/42 vm: convert snd_pcm_lib_mmap_iomem() to vm_iomap_memory() helper
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
commit 0fe09a45c4848b5b5607b968d959fdc1821c161d upstream.
This is my example conversion of a few existing mmap users. The pcm mmap case is one of the more straightforward ones.
--- sound/core/pcm_native.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
sound/core/pcm_native.c +2 -10
@@ -3222,18 +3222,10 @@ EXPORT_SYMBOL_GPL(snd_pcm_lib_default_mmint snd_pcm_lib_mmap_iomem (struct snd_pcm_substream *substream,struct vm_area_struct *area) { -long size; -unsigned long offset; +struct snd_pcm_runtime *runtime = substream->runtime;; area->vm_page_prot =pgprot_noncached (area->vm_page_prot); - area->vm_flags |=VM_IO ; - size = area->vm_end - area->vm_start; - offset = area->vm_pgoff <<PAGE_SHIFT ; -if (io_remap_pfn_range (area, area->vm_start, - (substream->runtime->dma_addr + offset) >>PAGE_SHIFT , - size, area->vm_page_prot)) -return -EAGAIN ; -return 0 ; +return vm_iomap_memory (area, runtime->dma_addr, runtime->dma_bytes); }EXPORT_SYMBOL (snd_pcm_lib_mmap_iomem);
Greg Kroah-Hartman
maintainerPATCH 37/42 vm: convert fb_mmap to vm_iomap_memory() helper
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
commit fc9bbca8f650e5f738af8806317c0a041a48ae4a upstream.
This is my example conversion of a few existing mmap users. The fb_mmap() case is a good example because it is a bit more complicated than some: fb_mmap() mmaps one of two different memory areas depending on the page offset of the mmap (but happily there is never any mixing of the two, so the helper function still works).
--- drivers/video/fbmem.c | 39 ++++++++++++++------------------------- 1 file changed, 14 insertions(+), 25 deletions(-)
drivers/video/fbmem.c +14 -25
@@ -1373,15 +1373,12 @@ fb_mmap(struct file *file, struct vm_are {struct fb_info *info =file_fb_info (file);struct fb_ops *fb; -unsigned long off; +unsigned long mmio_pgoff;unsigned long start;u32 len;if (!info)return -ENODEV ; -if (vma->vm_pgoff > (~0UL >>PAGE_SHIFT )) -return -EINVAL ; - off = vma->vm_pgoff <<PAGE_SHIFT ; fb = info->fbops;if (!fb)return -ENODEV ;
@@ -1393,32 +1390,24 @@ fb_mmap(struct file *file, struct vm_arereturn res; } -/* frame buffer memory */ +/* +* Ugh. This can be either the frame buffer mapping, or +* if pgoff points past it, the mmio mapping. +*/ start = info->fix.smem_start; - len =PAGE_ALIGN ((start & ~PAGE_MASK ) + info->fix.smem_len); -if (off >= len) { -/* memory mapped io */ - off -= len; -if (info->var.accel_flags) { -mutex_unlock (&info->mm_lock); -return -EINVAL ; - } + len = info->fix.smem_len; + mmio_pgoff =PAGE_ALIGN ((start & ~PAGE_MASK ) + len) >>PAGE_SHIFT ; +if (vma->vm_pgoff >= mmio_pgoff) { + vma->vm_pgoff -= mmio_pgoff; start = info->fix.mmio_start; - len =PAGE_ALIGN ((start & ~PAGE_MASK ) + info->fix.mmio_len); + len = info->fix.mmio_len; }mutex_unlock (&info->mm_lock); - start &=PAGE_MASK ; -if ((vma->vm_end - vma->vm_start + off) > len) -return -EINVAL ; - off += start; - vma->vm_pgoff = off >>PAGE_SHIFT ; -/* VM_IO | VM_DONTEXPAND | VM_DONTDUMP are set by io_remap_pfn_range()*/ + vma->vm_page_prot =vm_get_page_prot (vma->vm_flags); -fb_pgprotect (file, vma, off); -if (io_remap_pfn_range (vma, vma->vm_start, off >>PAGE_SHIFT , - vma->vm_end - vma->vm_start, vma->vm_page_prot)) -return -EAGAIN ; -return 0 ; +fb_pgprotect (file, vma, start); + +return vm_iomap_memory (vma, start, len); } static int
Greg Kroah-Hartman
maintainerPATCH 38/42 vm: convert HPET mmap to vm_iomap_memory() helper
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
commit 2323036dfec8ce3ce6e1c86a49a31b039f3300d1 upstream.
This is my example conversion of a few existing mmap users. The HPET case is simple, widely available, and easy to test (Clemens Ladisch sent a trivial test-program for it).
--- drivers/char/hpet.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-)
drivers/char/hpet.c +1 -13
@@ -373,26 +373,14 @@ static int hpet_mmap(struct file *file,struct hpet_dev *devp;unsigned long addr; -if (((vma->vm_end - vma->vm_start) !=PAGE_SIZE ) || vma->vm_pgoff) -return -EINVAL ; - devp = file->private_data; addr = devp->hd_hpets->hp_hpet_phys;if (addr & (PAGE_SIZE -1 ))return -ENOSYS ; - vma->vm_flags |=VM_IO ; vma->vm_page_prot =pgprot_noncached (vma->vm_page_prot); - -if (io_remap_pfn_range (vma, vma->vm_start, addr >>PAGE_SHIFT , -PAGE_SIZE , vma->vm_page_prot)) { -printk (KERN_ERR "%s: io_remap_pfn_range failed\n" , - __func__); -return -EAGAIN ; - } - -return 0 ; +return vm_iomap_memory (vma, addr,PAGE_SIZE );#else return -ENOSYS ;#endif
Greg Kroah-Hartman
maintainerPATCH 39/42 vm: convert mtdchar mmap to vm_iomap_memory() helper
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
commit 8558e4a26b00225efeb085725bc319f91201b239 upstream.
This is my example conversion of a few existing mmap users. The mtdchar case is actually disabled right now (and stays disabled), but I did it because it showed up on my "git grep", and I was familiar with the code due to fixing an overflow problem in the code in commit 9c603e53d380 ("mtdchar: fix offset overflow detection").
--- drivers/mtd/mtdchar.c | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-)
drivers/mtd/mtdchar.c +2 -30
@@ -1159,45 +1159,17 @@ static int mtdchar_mmap(struct file *filstruct mtd_file_info *mfi = file->private_data;struct mtd_info *mtd = mfi->mtd;struct map_info *map = mtd->priv; -resource_size_t start, off; -unsigned long len, vma_len;/* This is broken because it assumes the MTD device is map-based and that mtd->priv is a valid struct map_info. It should be replaced with something that uses the mtd_get_unmapped_area() operation properly. */ if (0 /*mtd->type == MTD_RAM || mtd->type == MTD_ROM*/ ) { - off =get_vm_offset (vma); - start = map->phys; - len =PAGE_ALIGN ((start & ~PAGE_MASK ) + map->size); - start &=PAGE_MASK ; - vma_len =get_vm_size (vma); - -/* Overflow in off+len? */ -if (vma_len + off < off) -return -EINVAL ; -/* Does it fit in the mapping? */ -if (vma_len + off > len) -return -EINVAL ; - - off += start; -/* Did that overflow? */ -if (off < start) -return -EINVAL ; -if (set_vm_offset (vma, off) <0 ) -return -EINVAL ; - vma->vm_flags |=VM_IO |VM_DONTEXPAND |VM_DONTDUMP ; -#ifdef pgprot_noncached -if (file->f_flags &O_DSYNC || off >=__pa (high_memory)) +if (file->f_flags &O_DSYNC || map->phys >=__pa (high_memory)) vma->vm_page_prot =pgprot_noncached (vma->vm_page_prot);#endif -if (io_remap_pfn_range (vma, vma->vm_start, off >>PAGE_SHIFT , - vma->vm_end - vma->vm_start, - vma->vm_page_prot)) -return -EAGAIN ; - -return 0 ; +return vm_iomap_memory (vma, map->phys, map->size); }return -ENOSYS ;#else
Greg Kroah-Hartman
maintainerPATCH 40/42 Btrfs: make sure nbytes are right after log replay
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <[email protected]>
commit 4bc4bee4595662d8bff92180d5c32e3313a704b0 upstream.
While trying to track down a tree log replay bug I noticed that fsck was always complaining about nbytes not being right for our fsynced file. That is because the new fsync stuff doesn't wait for ordered extents to complete, so the inodes nbytes are not necessarily updated properly when we log it. So to fix this we need to set nbytes to whatever it is on the inode that is on disk, so when we replay the extents we can just add the bytes that are being added as we replay the extent. This makes it work for the case that we have the wrong nbytes or the case that we logged everything and nbytes is actually correct. With this I'm no longer getting nbytes errors out of btrfsck.
--- fs/btrfs/tree-log.c | 48 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 6 deletions(-)
fs/btrfs/tree-log.c +42 -6
@@ -318,6 +318,7 @@ static noinline int overwrite_item(strucunsigned long src_ptr;unsigned long dst_ptr;int overwrite_root =0 ; +bool inode_item = key->type ==BTRFS_INODE_ITEM_KEY ;if (root->root_key.objectid !=BTRFS_TREE_LOG_OBJECTID ) overwrite_root =1 ;
@@ -327,6 +328,9 @@ static noinline int overwrite_item(struc/* look for the key in the destination tree */ ret =btrfs_search_slot (NULL , root, key, path,0 ,0 ); +if (ret <0 ) +return ret; +if (ret ==0 ) {char *src_copy;char *dst_copy;
@@ -368,6 +372,30 @@ static noinline int overwrite_item(strucreturn 0 ; } +/* +* We need to load the old nbytes into the inode so when we +* replay the extents we've logged we get the right nbytes. +*/ +if (inode_item) { +struct btrfs_inode_item *item; +u64 nbytes; + + item =btrfs_item_ptr (path->nodes[0 ], path->slots[0 ], + struct btrfs_inode_item); + nbytes =btrfs_inode_nbytes (path->nodes[0 ], item); + item =btrfs_item_ptr (eb, slot, + struct btrfs_inode_item); +btrfs_set_inode_nbytes (eb, item, nbytes); + } + }else if (inode_item) { +struct btrfs_inode_item *item; + +/* +* New inode, set nbytes to 0 so that the nbytes comes out +* properly when we replay the extents. +*/ + item = btrfs_item_ptr(eb, slot, struct btrfs_inode_item); +btrfs_set_inode_nbytes (eb, item,0 ); } insert:btrfs_release_path (path);
@@ -488,7 +516,7 @@ static noinline int replay_one_extent(stu64 mask = root->sectorsize -1 ;u64 extent_end;u64 start = key->offset; -u64 saved_nbytes; +u64 nbytes =0 ;struct btrfs_file_extent_item *item;struct inode *inode =NULL ;unsigned long size;
@@ -498,10 +526,19 @@ static noinline int replay_one_extent(st found_type =btrfs_file_extent_type (eb, item);if (found_type ==BTRFS_FILE_EXTENT_REG || - found_type ==BTRFS_FILE_EXTENT_PREALLOC ) - extent_end = start +btrfs_file_extent_num_bytes (eb, item); -else if (found_type ==BTRFS_FILE_EXTENT_INLINE ) { + found_type ==BTRFS_FILE_EXTENT_PREALLOC ) { + nbytes =btrfs_file_extent_num_bytes (eb, item); + extent_end = start + nbytes; + +/* +* We don't add to the inodes nbytes if we are prealloc or a +* hole. +*/ +if (btrfs_file_extent_disk_bytenr (eb, item) ==0 ) + nbytes =0 ; + }else if (found_type ==BTRFS_FILE_EXTENT_INLINE ) { size =btrfs_file_extent_inline_len (eb, item); + nbytes =btrfs_file_extent_ram_bytes (eb, item); extent_end = (start + size + mask) & ~mask; }else { ret =0 ;
@@ -550,7 +587,6 @@ static noinline int replay_one_extent(st }btrfs_release_path (path); - saved_nbytes =inode_get_bytes (inode);/* drop any overlapping extents */ ret =btrfs_drop_extents (trans, root, inode, start, extent_end,1 );BUG_ON (ret);
@@ -637,7 +673,7 @@ static noinline int replay_one_extent(stBUG_ON (ret); } -inode_set_bytes (inode, saved_nbytes); +inode_add_bytes (inode, nbytes); ret =btrfs_update_inode (trans, root, inode); out:if (inode)
Greg Kroah-Hartman
maintainerPATCH 41/42 s390: move dummy io_remap_pfn_range() to asm/pgtable.h
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
commit 4f2e29031e6c67802e7370292dd050fd62f337ee upstream.
Commit b4cbb197c7e7 ("vm: add vm_iomap_memory() helper function") added a helper function wrapper around io_remap_pfn_range(), and every other architecture defined it in <asm/pgtable.h>.
The s390 choice of <asm/io.h> may make sense, but is not very convenient for this case, and gratuitous differences like that cause unexpected errors like this:
mm/memory.c: In function 'vm_iomap_memory':
mm/memory.c:2439:2: error: implicit declaration of function 'io_remap_pfn_range' [-Werror=implicit-function-declaration]
Glory be the kbuild test robot who noticed this, bisected it, and reported it to the guilty parties (ie me).
--- arch/s390/include/asm/io.h | 4 ---- arch/s390/include/asm/pgtable.h | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-)
arch/s390/include/asm/io.h +0 -4
@@ -50,10 +50,6 @@ void unxlate_dev_mem_ptr(unsigned long p#define ioremap_nocache (addr, size) ioremap(addr, size)#define ioremap_wc ioremap_nocache -/* TODO: s390 cannot support io_remap_pfn_range... */ -#define io_remap_pfn_range (vma, vaddr, pfn, size, prot) \ - remap_pfn_range(vma, vaddr, pfn, size, prot) -static inline void __iomem *ioremap (unsigned long offset,unsigned long size) {return (void __iomem *) offset;
arch/s390/include/asm/pgtable.h +4 -0
@@ -56,6 +56,10 @@ extern unsigned long zero_page_mask; (((unsigned long)(vaddr)) &zero_page_mask))))#define __HAVE_COLOR_ZERO_PAGE +/* TODO: s390 cannot support io_remap_pfn_range... */ +#define io_remap_pfn_range (vma, vaddr, pfn, size, prot) \ + remap_pfn_range(vma, vaddr, pfn, size, prot) +#endif /* !__ASSEMBLY__ */ /*
Greg Kroah-Hartman
maintainerPATCH 42/42 Revert "MIPS: page.h: Provide more readable definition for PAGE_MASK."
In reply to Greg Kroah-Hartman3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ralf Baechle <[email protected]>
commit 3b5e50edaf500f392f4a372296afc0b99ffa7e70 upstream.
This reverts commit c17a6554782ad531f4713b33fd6339ba67ef6391.
Manuel Lauss writes:
lmo commit c17a6554 (MIPS: page.h: Provide more readable definition for PAGE_MASK) apparently breaks ioremap of 36-bit addresses on my Alchemy systems (PCI and PCMCIA) The reason is that in arch/mips/mm/ioremap.c line 157 (phys_addr &= PAGE_MASK) bits 32-35 are cut off. Seems the new PAGE_MASK is explicitly 32bit, or one could make it signed instead of unsigned long.
From: Ralf Baechle <[email protected]>
--- arch/mips/include/asm/page.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/include/asm/page.h +1 -1
@@ -31,7 +31,7 @@#define PAGE_SHIFT 16#endif #define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT) -#define PAGE_MASK (~(PAGE_SIZE - 1)) +#define PAGE_MASK (~((1 << PAGE_SHIFT) - 1))#ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT #define HPAGE_SHIFT (PAGE_SHIFT + PAGE_SHIFT - 3)
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.8.9 release. There are 42 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 Thu Apr 25 21:50:11 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.8.9-rc1.gzand the diffstat can be found below.
thanks,
greg k-h
Patches applied cleanly to 3.0.74, 3.4.41, and 3.8.8
Reviewing patches - will let you know anything odd.
Compiled and booted on the following systems:
Samsung Series 9 Intel Corei5
HP ProBook 6475b AMD A10-4600M APU with Radeon(tm) HD Graphics
dmesgs for all releases look good. No regressions compared to the previous dmesgs for each of these releases.
Cross-compile tests results:
alpha: defconfig passed on all
arm: defconfig passed on all
arm64: not applicable to 3.0.y, 3.4.y. defconfig passed on 3.8.y
c6x: not applicable to 3.0.y, defconfig passed on 3.4.y, and 3.8.y.
mips: defconfig passed on all
mipsel: defconfig passed on all
powerpc: wii_defconfig passed on all
sh: defconfig passed on all
sparc: defconfig passed on all
tile: tilegx_defconfig passed on all
Samsung Series 9 Intel Corei5:
Note: Screaming fast system with ssd!! There are some vga issues on 3.0.74 and 3.0.75-rc1 on this system and I am going to investigate those and see what's going on. No problems with 3.4 and 3.8. My current guess is that 3.5 is the minimum for this system.
thanks,
-- Shuah
Greg Kroah-Hartman
maintainerQuoted 15 lines · Shuah Khan
Quoted 14 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.8.9 release. There are 42 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 Thu Apr 25 21:50:11 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.8.9-rc1.gzand the diffstat can be found below.
thanks,
Quoted 8 lines
Quoted 2 lines
greg k-h
Patches applied cleanly to 3.0.74, 3.4.41, and 3.8.8
Reviewing patches - will let you know anything odd.
Compiled and booted on the following systems:
Thanks for testing and letting us know.
greg k-h
At Tue, 23 Apr 2013 14:51:58 -0700,
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.8.9 release. There are 42 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 Thu Apr 25 21:50:11 UTC 2013. Anything received after that time might be too late.
This kernel can be built and boot without any problem. Building a kernel with this kernel also works fine.
- Build Machine: debian wheezy x86_64
CPU: Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz x 4
memory: 8GB
- Test machine: debian wheezy x86_64(KVM guest on the Build Machine)
vCPU: x2
memory: 2GB
Thanks,
Satoru
Quoted 211 lines
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.8.9-rc1.gzand the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:Greg Kroah-Hartman <[email protected]>
Linux 3.8.9-rc1Ralf Baechle <[email protected]>
Revert "MIPS:page.h: Provide more readable definition forPAGE_MASK."Linus Torvalds <[email protected]>
s390: move dummyio_remap_pfn_range()toasm/pgtable.hJosef Bacik <[email protected]>
Btrfs: make sure nbytes are right after log replayLinus Torvalds <[email protected]>
vm: convert mtdchar mmap tovm_iomap_memory()helperLinus Torvalds <[email protected]>
vm: convert HPET mmap tovm_iomap_memory()helperLinus Torvalds <[email protected]>
vm: convertfb_mmaptovm_iomap_memory()helperLinus Torvalds <[email protected]>
vm: convertsnd_pcm_lib_mmap_iomem()tovm_iomap_memory()helperLinus Torvalds <[email protected]>
vm: addvm_iomap_memory()helper functionAndy Lutomirski <[email protected]>
userns: Changing any namespace id mappings should require privilegesAndy Lutomirski <[email protected]>
userns: Check uid_map's opener's fsuid, not the current fsuidEric W. Biederman <[email protected]>
userns: Don't let unprivileged users trick privileged users into setting theid_mapStephane Eranian <[email protected]>
perf/x86: Fixoffcore_rspvalid mask for SNB/IVBTommi Rantala <[email protected]>
perf: Treat attr.config as u64 inperf_swevent_init()Mathias Krause <[email protected]>
crypto: algif - suppress sending source address information in recvmsgRafał Miłecki <[email protected]>
ssb: implement spurious tone avoidanceJohannes Berg <[email protected]>
mac80211: fix cfg80211 interaction on auth/assoc requestFelix Fietkau <[email protected]>
ath9k_hw: change AR9580 initvals to fix a stability issueFelix Fietkau <[email protected]>
ath9k_htc: accept 1.x firmware newer than 1.3Will Deacon <[email protected]>
ARM: 7698/1: perf: fix group validation when usingenable_on_execIllia Ragozin <[email protected]>
ARM: 7696/1: Fix kexec by setting outer_cache.inv_all for Feroceonlibin <[email protected]>
sched/debug: Fix sd->*_idx limit range avoiding overflowTejun Heo <[email protected]>
sched: Convert BUG_ON()s intry_to_wake_up_local()to WARN_ON_ONCE()sMatt Carlson <[email protected]>
tg3: Add 57766 device support.Markus Pargmann <[email protected]>
ARM: clk-imx35: Bugfix iomux clockSascha Hauer <[email protected]>
ARM: i.MX35: enable MAX clockAndrew Honig <[email protected]>
KVM: Allow cross page reads and writes from cached translations.Andy Honig <[email protected]>
KVM: Fix bounds checking in ioapic indirect register reads (CVE-2013-1798)Andy Honig <[email protected]>
KVM: x86: Convert MSR_KVM_SYSTEM_TIME to use gfn_to_hva_cache functions (CVE-2013-1797)Andy Honig <[email protected]>
KVM: x86: fix for buffer overflow in handling ofMSR_KVM_SYSTEM_TIME(CVE-2013-1796)Joe Lawrence <[email protected]>
md: raid1,10: HandleREQ_WRITE_SAMEflag in write biosVyacheslav Dubeyko <[email protected]>
hfsplus: fix potential overflow inhfsplus_file_truncate()Emese Revfy <[email protected]>
kernel/signal.c: stop info leak via the tkill and the tgkill syscallsNaoya Horiguchi <[email protected]>
fs/binfmt_elf.c: fix hugetlb memory check invma_dump_size()Naoya Horiguchi <[email protected]>
hugetlbfs: add swap entry check infollow_hugetlb_page()Naoya Horiguchi <[email protected]>
hugetlbfs: stop settingVM_DONTDUMPin initializingvma(VM_HUGETLB)Christoph Fritz <[email protected]>
can: sja1000: fix handling on dt properties on little endian systemsMarc Kleine-Budde <[email protected]>
can: mcp251x: add missingIRQF_ONESHOTtorequest_threaded_irqMichael Bohan <[email protected]>
hrtimer: Don't reinitialize acpu_baselock onCPU_UPThomas Gleixner <[email protected]>
kthread: Prevent unpark race which puts threads on the wrong cpuRussell King <[email protected]>
ARM: Do15e0d9e37c(ARM: pm: let platforms selectcpu_suspendsupport) properlyScott Wood <[email protected]>
kvm/powerpc/e500mc: fix tlb invalidation on cpu migrationKevin Hao <[email protected]>
powerpc: add a missing label inresume_kernel-------------
Diffstat:
Makefile | 4 +- arch/arm/kernel/perf_event.c | 5 ++- arch/arm/mach-imx/clk-imx35.c | 2 + arch/arm/mm/cache-feroceon-l2.c | 1 + arch/arm/mm/proc-arm920.S | 2 +- arch/arm/mm/proc-arm926.S | 2 +- arch/arm/mm/proc-mohawk.S | 2 +- arch/arm/mm/proc-sa1100.S | 2 +- arch/arm/mm/proc-v6.S | 2 +- arch/arm/mm/proc-xsc3.S | 2 +- arch/arm/mm/proc-xscale.S | 2 +- arch/mips/include/asm/page.h | 2 +- arch/powerpc/kernel/entry_64.S | 2 +- arch/powerpc/kvm/e500mc.c | 7 ++- arch/s390/include/asm/io.h | 4 -- arch/s390/include/asm/pgtable.h | 4 ++ arch/x86/include/asm/kvm_host.h | 4 +- arch/x86/kernel/cpu/perf_event_intel.c | 20 +++++++-- arch/x86/kvm/lapic.c | 2 +- arch/x86/kvm/x86.c | 51 ++++++++++----------- crypto/algif_hash.c | 2 + crypto/algif_skcipher.c | 1 + drivers/char/hpet.c | 14 +----- drivers/md/raid1.c | 7 ++- drivers/md/raid10.c | 9 +++- drivers/mtd/mtdchar.c | 32 +------------ drivers/net/can/mcp251x.c | 10 ++++- drivers/net/can/sja1000/sja1000_of_platform.c | 31 +++++++------ drivers/net/ethernet/broadcom/tg3.c | 18 +++++++- drivers/net/ethernet/broadcom/tg3.h | 2 + .../net/wireless/ath/ath9k/ar9580_1p0_initvals.h | 2 +- drivers/net/wireless/ath/ath9k/htc_drv_init.c | 2 +- drivers/net/wireless/b43/phy_n.c | 3 +- drivers/ssb/driver_chipcommon_pmu.c | 29 ++++++++++++ drivers/video/fbmem.c | 39 ++++++---------- fs/binfmt_elf.c | 1 + fs/btrfs/tree-log.c | 48 +++++++++++++++++--- fs/hfsplus/extents.c | 2 +- fs/hugetlbfs/inode.c | 2 +- fs/proc/array.c | 1 + include/linux/kvm_host.h | 2 +- include/linux/kvm_types.h | 1 + include/linux/mm.h | 2 + include/linux/sched.h | 5 ++- include/linux/ssb/ssb_driver_chipcommon.h | 2 + include/trace/events/sched.h | 2 +- kernel/events/core.c | 2 +- kernel/hrtimer.c | 3 +- kernel/kthread.c | 52 ++++++++++++---------- kernel/sched/core.c | 8 ++-- kernel/signal.c | 2 +- kernel/user_namespace.c | 22 +++++---- mm/hugetlb.c | 12 ++++- mm/memory.c | 47 +++++++++++++++++++ net/mac80211/mlme.c | 24 ++++++++-- sound/core/pcm_native.c | 12 +---- virt/kvm/ioapic.c | 7 ++- virt/kvm/kvm_main.c | 47 ++++++++++++++----- 58 files changed, 406 insertions(+), 223 deletions(-)--
To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Greg Kroah-Hartman
maintainerQuoted 14 lines · Satoru Takeuchi
At Tue, 23 Apr 2013 14:51:58 -0700,
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.8.9 release. There are 42 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 Thu Apr 25 21:50:11 UTC 2013. Anything received after that time might be too late.
This kernel can be built and boot without any problem. Building a kernel with this kernel also works fine.
Quoted 7 lines
- Build Machine: debian wheezy
x86_64
CPU: Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz x 4
memory: 8GB- Test machine: debian wheezy
x86_64(KVM guest on the Build Machine)
vCPU: x2
memory: 2GB
Thanks for testing these kernels and letting us know.
greg k-h
Re: [ 22/42] sched/debug: Fix sd->*_idx limit range avoiding overflow
In reply to Greg Kroah-HartmanQuoted 10 lines · Greg Kroah-Hartman
3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: libin <[email protected]>
commit
fd9b86d37a600488dbd80fe60cca46b822bff1cdupstream.Commit
201c373e8e("sched/debug: Limit sd->*_idx range on sysctl") was an incomplete bug fix.
[...]
It seems like both these commits ought to be applied to earlier stable branches. Or was the lack of range checking a regression after 3.4?
Ben.
Signature · 2 lines
Ben Hutchings For every action, there is an equal and opposite criticism. - Harrison
Re: [ 22/42] sched/debug: Fix sd->*_idx limit range avoiding overflow
Quoted 7 lines · Ben Hutchings
Quoted 6 lines · Greg Kroah-Hartman
3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: libin <[email protected]>
Quoted 8 lines
Quoted 4 lines
commit
fd9b86d37a600488dbd80fe60cca46b822bff1cdupstream.Commit
201c373e8e("sched/debug: Limit sd->*_idx range on sysctl") was an incomplete bug fix.[...]
It seems like both these commits ought to be applied to earlier stable branches. Or was the lack of range checking a regression after 3.4?
Both should be applied indeed.
They are not a huge problem as all these facilities are for debugging and are root-only, but the two fixes should be applied together or not at all.
Thanks,
Ingo
Re: [ 22/42] sched/debug: Fix sd->*_idx limit range avoiding overflow
Quoted 15 lines · Ingo Molnar
Quoted 13 lines · Ben Hutchings
Quoted 10 lines · Greg Kroah-Hartman
3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: libin <[email protected]>
commit
fd9b86d37a600488dbd80fe60cca46b822bff1cdupstream.Commit
201c373e8e("sched/debug: Limit sd->*_idx range on sysctl") was an incomplete bug fix.[...]
Quoted 7 lines
Quoted 2 lines
It seems like both these commits ought to be applied to earlier stable branches. Or was the lack of range checking a regression after 3.4?
Both should be applied indeed.
They are not a huge problem as all these facilities are for debugging and are root-only, but the two fixes should be applied together or not at all.
I've queued up both of these for 3.2.
Ben.
Signature · 2 lines
Ben Hutchings If at first you don't succeed, you're doing about average.