Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1612843 > unrolled thread
| Started by | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| First post | 2017-03-30 12:10 +0200 |
| Last post | 2017-03-31 09:50 +0200 |
| Articles | 17 — 4 participants |
Back to article view | Back to linux.kernel
[PATCH 4.10 00/17] 4.10.8-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-30 12:10 +0200
[PATCH 4.10 08/17] c6x/ptrace: Remove useless PTRACE_SETREGSET implementation Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-30 12:10 +0200
[PATCH 4.10 05/17] KVM: x86: cleanup the page tracking SRCU instance Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-30 12:10 +0200
[PATCH 4.10 10/17] mips/ptrace: Preserve previous registers for short regset write Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-30 12:20 +0200
[PATCH 4.10 09/17] h8300/ptrace: Fix incorrect register transfer count Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-30 12:20 +0200
[PATCH 4.10 07/17] pinctrl: qcom: Dont clear status bit on irq_unmask Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-30 12:20 +0200
[PATCH 4.10 16/17] sched/rt: Add a missing rescheduling point Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-30 12:20 +0200
[PATCH 4.10 12/17] metag/ptrace: Preserve previous registers for short regset write Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-30 12:20 +0200
[PATCH 4.10 13/17] metag/ptrace: Provide default TXSTATUS for short NT_PRSTATUS Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-30 12:20 +0200
[PATCH 4.10 14/17] metag/ptrace: Reject partial NT_METAG_RPIPE writes Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-30 12:20 +0200
[PATCH 4.10 15/17] qla2xxx: Allow vref count to timeout on vport delete. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-30 12:20 +0200
Re: [PATCH 4.10 15/17] qla2xxx: Allow vref count to timeout on vport delete. "Nicholas A. Bellinger" <nab@linux-iscsi.org> - 2017-03-31 10:00 +0200
[PATCH 4.10 11/17] sparc/ptrace: Preserve previous registers for short regset write Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-30 12:20 +0200
Re: [PATCH 4.10 00/17] 4.10.8-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2017-03-30 21:00 +0200
Re: [PATCH 4.10 00/17] 4.10.8-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-31 09:50 +0200
Re: [PATCH 4.10 00/17] 4.10.8-stable review Guenter Roeck <linux@roeck-us.net> - 2017-03-31 05:50 +0200
Re: [PATCH 4.10 00/17] 4.10.8-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-31 09:50 +0200
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2017-03-30 12:10 +0200 |
| Subject | [PATCH 4.10 00/17] 4.10.8-stable review |
| Message-ID | <tqFbH-4Hn-15@gated-at.bofh.it> |
This is the start of the stable review cycle for the 4.10.8 release.
There are 17 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 Sat Apr 1 09:59:07 UTC 2017.
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/v4.x/stable-review/patch-4.10.8-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.10.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Linux 4.10.8-rc1
Bin Liu <b-liu@ti.com>
usb: musb: fix possible spinlock deadlock
Sebastian Andrzej Siewior <bigeasy@linutronix.de>
sched/rt: Add a missing rescheduling point
Joe Carnuccio <joe.carnuccio@cavium.com>
qla2xxx: Allow vref count to timeout on vport delete.
Dave Martin <Dave.Martin@arm.com>
metag/ptrace: Reject partial NT_METAG_RPIPE writes
Dave Martin <Dave.Martin@arm.com>
metag/ptrace: Provide default TXSTATUS for short NT_PRSTATUS
Dave Martin <Dave.Martin@arm.com>
metag/ptrace: Preserve previous registers for short regset write
Dave Martin <Dave.Martin@arm.com>
sparc/ptrace: Preserve previous registers for short regset write
Dave Martin <Dave.Martin@arm.com>
mips/ptrace: Preserve previous registers for short regset write
Dave Martin <Dave.Martin@arm.com>
h8300/ptrace: Fix incorrect register transfer count
Dave Martin <Dave.Martin@arm.com>
c6x/ptrace: Remove useless PTRACE_SETREGSET implementation
Bjorn Andersson <bjorn.andersson@linaro.org>
pinctrl: qcom: Don't clear status bit on irq_unmask
Ladi Prosek <lprosek@redhat.com>
virtio_balloon: init 1st buffer in stats vq
Paolo Bonzini <pbonzini@redhat.com>
KVM: x86: cleanup the page tracking SRCU instance
Wanpeng Li <wanpeng.li@hotmail.com>
KVM: nVMX: Fix nested VPID vmx exec control
Andy Whitcroft <apw@canonical.com>
xfrm_user: validate XFRM_MSG_NEWAE incoming ESN size harder
Andy Whitcroft <apw@canonical.com>
xfrm_user: validate XFRM_MSG_NEWAE XFRMA_REPLAY_ESN_VAL replay_window
Florian Westphal <fw@strlen.de>
xfrm: policy: init locks early
-------------
Diffstat:
Makefile | 4 ++--
arch/c6x/kernel/ptrace.c | 41 -----------------------------------
arch/h8300/kernel/ptrace.c | 8 ++++---
arch/metag/kernel/ptrace.c | 19 ++++++++++++----
arch/mips/kernel/ptrace.c | 3 ++-
arch/sparc/kernel/ptrace_64.c | 2 +-
arch/x86/include/asm/kvm_page_track.h | 1 +
arch/x86/kvm/page_track.c | 8 +++++++
arch/x86/kvm/vmx.c | 7 +++---
arch/x86/kvm/x86.c | 1 +
drivers/pinctrl/qcom/pinctrl-msm.c | 4 ----
drivers/scsi/qla2xxx/qla_attr.c | 4 +---
drivers/scsi/qla2xxx/qla_def.h | 6 ++++-
drivers/scsi/qla2xxx/qla_init.c | 1 +
drivers/scsi/qla2xxx/qla_mid.c | 14 +++++++-----
drivers/scsi/qla2xxx/qla_os.c | 1 +
drivers/usb/musb/musb_core.c | 2 +-
drivers/virtio/virtio_balloon.c | 2 ++
kernel/sched/deadline.c | 3 +--
kernel/sched/rt.c | 3 +--
net/xfrm/xfrm_policy.c | 10 ++++-----
net/xfrm/xfrm_user.c | 9 +++++++-
22 files changed, 73 insertions(+), 80 deletions(-)
[toc] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2017-03-30 12:10 +0200 |
| Subject | [PATCH 4.10 08/17] c6x/ptrace: Remove useless PTRACE_SETREGSET implementation |
| Message-ID | <tqFbJ-4Hn-53@gated-at.bofh.it> |
| In reply to | #1612843 |
4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Martin <Dave.Martin@arm.com>
commit fb411b837b587a32046dc4f369acb93a10b1def8 upstream.
gpr_set won't work correctly and can never have been tested, and the
correct behaviour is not clear due to the endianness-dependent task
layout.
So, just remove it. The core code will now return -EOPNOTSUPPORT when
trying to set NT_PRSTATUS on this architecture until/unless a correct
implementation is supplied.
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/c6x/kernel/ptrace.c | 41 -----------------------------------------
1 file changed, 41 deletions(-)
--- a/arch/c6x/kernel/ptrace.c
+++ b/arch/c6x/kernel/ptrace.c
@@ -69,46 +69,6 @@ static int gpr_get(struct task_struct *t
0, sizeof(*regs));
}
-static int gpr_set(struct task_struct *target,
- const struct user_regset *regset,
- unsigned int pos, unsigned int count,
- const void *kbuf, const void __user *ubuf)
-{
- int ret;
- struct pt_regs *regs = task_pt_regs(target);
-
- /* Don't copyin TSR or CSR */
- ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
- ®s,
- 0, PT_TSR * sizeof(long));
- if (ret)
- return ret;
-
- ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
- PT_TSR * sizeof(long),
- (PT_TSR + 1) * sizeof(long));
- if (ret)
- return ret;
-
- ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
- ®s,
- (PT_TSR + 1) * sizeof(long),
- PT_CSR * sizeof(long));
- if (ret)
- return ret;
-
- ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
- PT_CSR * sizeof(long),
- (PT_CSR + 1) * sizeof(long));
- if (ret)
- return ret;
-
- ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
- ®s,
- (PT_CSR + 1) * sizeof(long), -1);
- return ret;
-}
-
enum c6x_regset {
REGSET_GPR,
};
@@ -120,7 +80,6 @@ static const struct user_regset c6x_regs
.size = sizeof(u32),
.align = sizeof(u32),
.get = gpr_get,
- .set = gpr_set
},
};
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2017-03-30 12:10 +0200 |
| Subject | [PATCH 4.10 05/17] KVM: x86: cleanup the page tracking SRCU instance |
| Message-ID | <tqFbJ-4Hn-69@gated-at.bofh.it> |
| In reply to | #1612843 |
4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paolo Bonzini <pbonzini@redhat.com>
commit 2beb6dad2e8f95d710159d5befb390e4f62ab5cf upstream.
SRCU uses a delayed work item. Skip cleaning it up, and
the result is use-after-free in the work item callbacks.
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Suggested-by: Dmitry Vyukov <dvyukov@google.com>
Fixes: 0eb05bf290cfe8610d9680b49abef37febd1c38a
Reviewed-by: Xiao Guangrong <xiaoguangrong.eric@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/include/asm/kvm_page_track.h | 1 +
arch/x86/kvm/page_track.c | 8 ++++++++
arch/x86/kvm/x86.c | 1 +
3 files changed, 10 insertions(+)
--- a/arch/x86/include/asm/kvm_page_track.h
+++ b/arch/x86/include/asm/kvm_page_track.h
@@ -46,6 +46,7 @@ struct kvm_page_track_notifier_node {
};
void kvm_page_track_init(struct kvm *kvm);
+void kvm_page_track_cleanup(struct kvm *kvm);
void kvm_page_track_free_memslot(struct kvm_memory_slot *free,
struct kvm_memory_slot *dont);
--- a/arch/x86/kvm/page_track.c
+++ b/arch/x86/kvm/page_track.c
@@ -158,6 +158,14 @@ bool kvm_page_track_is_active(struct kvm
return !!ACCESS_ONCE(slot->arch.gfn_track[mode][index]);
}
+void kvm_page_track_cleanup(struct kvm *kvm)
+{
+ struct kvm_page_track_notifier_head *head;
+
+ head = &kvm->arch.track_notifier_head;
+ cleanup_srcu_struct(&head->track_srcu);
+}
+
void kvm_page_track_init(struct kvm *kvm)
{
struct kvm_page_track_notifier_head *head;
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -8052,6 +8052,7 @@ void kvm_arch_destroy_vm(struct kvm *kvm
kvm_free_vcpus(kvm);
kvfree(rcu_dereference_check(kvm->arch.apic_map, 1));
kvm_mmu_uninit_vm(kvm);
+ kvm_page_track_cleanup(kvm);
}
void kvm_arch_free_memslot(struct kvm *kvm, struct kvm_memory_slot *free,
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2017-03-30 12:20 +0200 |
| Subject | [PATCH 4.10 10/17] mips/ptrace: Preserve previous registers for short regset write |
| Message-ID | <tqFlo-4ME-11@gated-at.bofh.it> |
| In reply to | #1612843 |
4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Martin <Dave.Martin@arm.com>
commit d614fd58a2834cfe4efa472c33c8f3ce2338b09b upstream.
Ensure that if userspace supplies insufficient data to PTRACE_SETREGSET
to fill all the registers, the thread's old registers are preserved.
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/mips/kernel/ptrace.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/arch/mips/kernel/ptrace.c
+++ b/arch/mips/kernel/ptrace.c
@@ -485,7 +485,8 @@ static int fpr_set(struct task_struct *t
&target->thread.fpu,
0, sizeof(elf_fpregset_t));
- for (i = 0; i < NUM_FPU_REGS; i++) {
+ BUILD_BUG_ON(sizeof(fpr_val) != sizeof(elf_fpreg_t));
+ for (i = 0; i < NUM_FPU_REGS && count >= sizeof(elf_fpreg_t); i++) {
err = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
&fpr_val, i * sizeof(elf_fpreg_t),
(i + 1) * sizeof(elf_fpreg_t));
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2017-03-30 12:20 +0200 |
| Subject | [PATCH 4.10 09/17] h8300/ptrace: Fix incorrect register transfer count |
| Message-ID | <tqFlo-4ME-25@gated-at.bofh.it> |
| In reply to | #1612843 |
4.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dave Martin <Dave.Martin@arm.com> commit 502585c7555083d4a949c08350306b9ec196779e upstream. regs_set() and regs_get() are vulnerable to an off-by-1 buffer overrun if CONFIG_CPU_H8S is set, since this adds an extra entry to register_offset[] but not to user_regs_struct. So, iterate over user_regs_struct based on its actual size, not based on the length of register_offset[]. Signed-off-by: Dave Martin <Dave.Martin@arm.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- arch/h8300/kernel/ptrace.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) --- a/arch/h8300/kernel/ptrace.c +++ b/arch/h8300/kernel/ptrace.c @@ -95,7 +95,8 @@ static int regs_get(struct task_struct * long *reg = (long *)®s; /* build user regs in buffer */ - for (r = 0; r < ARRAY_SIZE(register_offset); r++) + BUILD_BUG_ON(sizeof(regs) % sizeof(long) != 0); + for (r = 0; r < sizeof(regs) / sizeof(long); r++) *reg++ = h8300_get_reg(target, r); return user_regset_copyout(&pos, &count, &kbuf, &ubuf, @@ -113,7 +114,8 @@ static int regs_set(struct task_struct * long *reg; /* build user regs in buffer */ - for (reg = (long *)®s, r = 0; r < ARRAY_SIZE(register_offset); r++) + BUILD_BUG_ON(sizeof(regs) % sizeof(long) != 0); + for (reg = (long *)®s, r = 0; r < sizeof(regs) / sizeof(long); r++) *reg++ = h8300_get_reg(target, r); ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, @@ -122,7 +124,7 @@ static int regs_set(struct task_struct * return ret; /* write back to pt_regs */ - for (reg = (long *)®s, r = 0; r < ARRAY_SIZE(register_offset); r++) + for (reg = (long *)®s, r = 0; r < sizeof(regs) / sizeof(long); r++) h8300_put_reg(target, r, *reg++); return 0; }
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2017-03-30 12:20 +0200 |
| Subject | [PATCH 4.10 07/17] pinctrl: qcom: Dont clear status bit on irq_unmask |
| Message-ID | <tqFlp-4ME-39@gated-at.bofh.it> |
| In reply to | #1612843 |
4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bjorn Andersson <bjorn.andersson@linaro.org>
commit a6566710adaa4a7dd5e0d99820ff9c9c30ee5951 upstream.
Clearing the status bit on irq_unmask will discard any pending interrupt
that did arrive after the irq_ack, i.e. while the IRQ handler function
was executing.
Fixes: f365be092572 ("pinctrl: Add Qualcomm TLMM driver")
Cc: Stephen Boyd <sboyd@codeaurora.org>
Reported-by: Timur Tabi <timur@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/pinctrl/qcom/pinctrl-msm.c | 4 ----
1 file changed, 4 deletions(-)
--- a/drivers/pinctrl/qcom/pinctrl-msm.c
+++ b/drivers/pinctrl/qcom/pinctrl-msm.c
@@ -594,10 +594,6 @@ static void msm_gpio_irq_unmask(struct i
spin_lock_irqsave(&pctrl->lock, flags);
- val = readl(pctrl->regs + g->intr_status_reg);
- val &= ~BIT(g->intr_status_bit);
- writel(val, pctrl->regs + g->intr_status_reg);
-
val = readl(pctrl->regs + g->intr_cfg_reg);
val |= BIT(g->intr_enable_bit);
writel(val, pctrl->regs + g->intr_cfg_reg);
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2017-03-30 12:20 +0200 |
| Subject | [PATCH 4.10 16/17] sched/rt: Add a missing rescheduling point |
| Message-ID | <tqFlp-4ME-53@gated-at.bofh.it> |
| In reply to | #1612843 |
4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
commit 619bd4a71874a8fd78eb6ccf9f272c5e98bcc7b7 upstream.
Since the change in commit:
fd7a4bed1835 ("sched, rt: Convert switched_{from, to}_rt() / prio_changed_rt() to balance callbacks")
... we don't reschedule a task under certain circumstances:
Lets say task-A, SCHED_OTHER, is running on CPU0 (and it may run only on
CPU0) and holds a PI lock. This task is removed from the CPU because it
used up its time slice and another SCHED_OTHER task is running. Task-B on
CPU1 runs at RT priority and asks for the lock owned by task-A. This
results in a priority boost for task-A. Task-B goes to sleep until the
lock has been made available. Task-A is already runnable (but not active),
so it receives no wake up.
The reality now is that task-A gets on the CPU once the scheduler decides
to remove the current task despite the fact that a high priority task is
enqueued and waiting. This may take a long time.
The desired behaviour is that CPU0 immediately reschedules after the
priority boost which made task-A the task with the lowest priority.
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: fd7a4bed1835 ("sched, rt: Convert switched_{from, to}_rt() prio_changed_rt() to balance callbacks")
Link: http://lkml.kernel.org/r/20170124144006.29821-1-bigeasy@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/sched/deadline.c | 3 +--
kernel/sched/rt.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -1729,12 +1729,11 @@ static void switched_to_dl(struct rq *rq
#ifdef CONFIG_SMP
if (tsk_nr_cpus_allowed(p) > 1 && rq->dl.overloaded)
queue_push_tasks(rq);
-#else
+#endif
if (dl_task(rq->curr))
check_preempt_curr_dl(rq, p, 0);
else
resched_curr(rq);
-#endif
}
}
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -2198,10 +2198,9 @@ static void switched_to_rt(struct rq *rq
#ifdef CONFIG_SMP
if (tsk_nr_cpus_allowed(p) > 1 && rq->rt.overloaded)
queue_push_tasks(rq);
-#else
+#endif /* CONFIG_SMP */
if (p->prio < rq->curr->prio)
resched_curr(rq);
-#endif /* CONFIG_SMP */
}
}
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2017-03-30 12:20 +0200 |
| Subject | [PATCH 4.10 12/17] metag/ptrace: Preserve previous registers for short regset write |
| Message-ID | <tqFlp-4ME-45@gated-at.bofh.it> |
| In reply to | #1612843 |
4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Martin <Dave.Martin@arm.com>
commit a78ce80d2c9178351b34d78fec805140c29c193e upstream.
Ensure that if userspace supplies insufficient data to PTRACE_SETREGSET
to fill all the registers, the thread's old registers are preserved.
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Acked-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/metag/kernel/ptrace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/metag/kernel/ptrace.c
+++ b/arch/metag/kernel/ptrace.c
@@ -303,7 +303,7 @@ static int metag_tls_set(struct task_str
const void *kbuf, const void __user *ubuf)
{
int ret;
- void __user *tls;
+ void __user *tls = target->thread.tls_ptr;
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &tls, 0, -1);
if (ret)
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2017-03-30 12:20 +0200 |
| Subject | [PATCH 4.10 13/17] metag/ptrace: Provide default TXSTATUS for short NT_PRSTATUS |
| Message-ID | <tqFlq-4ME-61@gated-at.bofh.it> |
| In reply to | #1612843 |
4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Martin <Dave.Martin@arm.com>
commit 5fe81fe98123ce41265c65e95d34418d30d005d1 upstream.
Ensure that if userspace supplies insufficient data to PTRACE_SETREGSET
to fill TXSTATUS, a well-defined default value is used, based on the
task's current value.
Suggested-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/metag/kernel/ptrace.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
--- a/arch/metag/kernel/ptrace.c
+++ b/arch/metag/kernel/ptrace.c
@@ -24,6 +24,16 @@
* user_regset definitions.
*/
+static unsigned long user_txstatus(const struct pt_regs *regs)
+{
+ unsigned long data = (unsigned long)regs->ctx.Flags;
+
+ if (regs->ctx.SaveMask & TBICTX_CBUF_BIT)
+ data |= USER_GP_REGS_STATUS_CATCH_BIT;
+
+ return data;
+}
+
int metag_gp_regs_copyout(const struct pt_regs *regs,
unsigned int pos, unsigned int count,
void *kbuf, void __user *ubuf)
@@ -62,9 +72,7 @@ int metag_gp_regs_copyout(const struct p
if (ret)
goto out;
/* TXSTATUS */
- data = (unsigned long)regs->ctx.Flags;
- if (regs->ctx.SaveMask & TBICTX_CBUF_BIT)
- data |= USER_GP_REGS_STATUS_CATCH_BIT;
+ data = user_txstatus(regs);
ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
&data, 4*25, 4*26);
if (ret)
@@ -119,6 +127,7 @@ int metag_gp_regs_copyin(struct pt_regs
if (ret)
goto out;
/* TXSTATUS */
+ data = user_txstatus(regs);
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
&data, 4*25, 4*26);
if (ret)
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2017-03-30 12:20 +0200 |
| Subject | [PATCH 4.10 14/17] metag/ptrace: Reject partial NT_METAG_RPIPE writes |
| Message-ID | <tqFlq-4ME-63@gated-at.bofh.it> |
| In reply to | #1612843 |
4.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dave Martin <Dave.Martin@arm.com> commit 7195ee3120d878259e8d94a5d9f808116f34d5ea upstream. It's not clear what behaviour is sensible when doing partial write of NT_METAG_RPIPE, so just don't bother. This patch assumes that userspace will never rely on a partial SETREGSET in this case, since it's not clear what should happen anyway. Signed-off-by: Dave Martin <Dave.Martin@arm.com> Acked-by: James Hogan <james.hogan@imgtec.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- arch/metag/kernel/ptrace.c | 2 ++ 1 file changed, 2 insertions(+) --- a/arch/metag/kernel/ptrace.c +++ b/arch/metag/kernel/ptrace.c @@ -253,6 +253,8 @@ int metag_rp_state_copyin(struct pt_regs unsigned long long *ptr; int ret, i; + if (count < 4*13) + return -EINVAL; /* Read the entire pipeline before making any changes */ ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &rp, 0, 4*13);
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2017-03-30 12:20 +0200 |
| Subject | [PATCH 4.10 15/17] qla2xxx: Allow vref count to timeout on vport delete. |
| Message-ID | <tqFlq-4ME-73@gated-at.bofh.it> |
| In reply to | #1612843 |
4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joe Carnuccio <joe.carnuccio@cavium.com>
commit c4a9b538ab2a109c5f9798bea1f8f4bf93aadfb9 upstream.
Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/scsi/qla2xxx/qla_attr.c | 4 +---
drivers/scsi/qla2xxx/qla_def.h | 6 +++++-
drivers/scsi/qla2xxx/qla_init.c | 1 +
drivers/scsi/qla2xxx/qla_mid.c | 14 ++++++++------
drivers/scsi/qla2xxx/qla_os.c | 1 +
5 files changed, 16 insertions(+), 10 deletions(-)
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -2154,8 +2154,6 @@ qla24xx_vport_delete(struct fc_vport *fc
"Timer for the VP[%d] has stopped\n", vha->vp_idx);
}
- BUG_ON(atomic_read(&vha->vref_count));
-
qla2x00_free_fcports(vha);
mutex_lock(&ha->vport_lock);
@@ -2163,7 +2161,7 @@ qla24xx_vport_delete(struct fc_vport *fc
clear_bit(vha->vp_idx, ha->vp_idx_map);
mutex_unlock(&ha->vport_lock);
- if (vha->qpair->vp_idx == vha->vp_idx) {
+ if (vha->qpair && vha->qpair->vp_idx == vha->vp_idx) {
if (qla2xxx_delete_qpair(vha, vha->qpair) != QLA_SUCCESS)
ql_log(ql_log_warn, vha, 0x7087,
"Queue Pair delete failed.\n");
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -3788,6 +3788,7 @@ typedef struct scsi_qla_host {
struct qla8044_reset_template reset_tmplt;
struct qla_tgt_counters tgt_counters;
uint16_t bbcr;
+ wait_queue_head_t vref_waitq;
} scsi_qla_host_t;
struct qla27xx_image_status {
@@ -3843,14 +3844,17 @@ struct qla2_sgx {
mb(); \
if (__vha->flags.delete_progress) { \
atomic_dec(&__vha->vref_count); \
+ wake_up(&__vha->vref_waitq); \
__bail = 1; \
} else { \
__bail = 0; \
} \
} while (0)
-#define QLA_VHA_MARK_NOT_BUSY(__vha) \
+#define QLA_VHA_MARK_NOT_BUSY(__vha) do { \
atomic_dec(&__vha->vref_count); \
+ wake_up(&__vha->vref_waitq); \
+} while (0) \
#define QLA_QPAIR_MARK_BUSY(__qpair, __bail) do { \
atomic_inc(&__qpair->ref_count); \
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -4352,6 +4352,7 @@ qla2x00_update_fcports(scsi_qla_host_t *
}
}
atomic_dec(&vha->vref_count);
+ wake_up(&vha->vref_waitq);
}
spin_unlock_irqrestore(&ha->vport_slock, flags);
}
--- a/drivers/scsi/qla2xxx/qla_mid.c
+++ b/drivers/scsi/qla2xxx/qla_mid.c
@@ -74,13 +74,14 @@ qla24xx_deallocate_vp_id(scsi_qla_host_t
* ensures no active vp_list traversal while the vport is removed
* from the queue)
*/
- spin_lock_irqsave(&ha->vport_slock, flags);
- while (atomic_read(&vha->vref_count)) {
- spin_unlock_irqrestore(&ha->vport_slock, flags);
-
- msleep(500);
+ wait_event_timeout(vha->vref_waitq, atomic_read(&vha->vref_count),
+ 10*HZ);
- spin_lock_irqsave(&ha->vport_slock, flags);
+ spin_lock_irqsave(&ha->vport_slock, flags);
+ if (atomic_read(&vha->vref_count)) {
+ ql_dbg(ql_dbg_vport, vha, 0xfffa,
+ "vha->vref_count=%u timeout\n", vha->vref_count.counter);
+ vha->vref_count = (atomic_t)ATOMIC_INIT(0);
}
list_del(&vha->list);
qlt_update_vp_map(vha, RESET_VP_IDX);
@@ -269,6 +270,7 @@ qla2x00_alert_all_vps(struct rsp_que *rs
spin_lock_irqsave(&ha->vport_slock, flags);
atomic_dec(&vha->vref_count);
+ wake_up(&vha->vref_waitq);
}
i++;
}
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -4215,6 +4215,7 @@ struct scsi_qla_host *qla2x00_create_hos
spin_lock_init(&vha->work_lock);
spin_lock_init(&vha->cmd_list_lock);
+ init_waitqueue_head(&vha->vref_waitq);
sprintf(vha->host_str, "%s_%ld", QLA2XXX_DRIVER_NAME, vha->host_no);
ql_dbg(ql_dbg_init, vha, 0x0041,
[toc] | [prev] | [next] | [standalone]
| From | "Nicholas A. Bellinger" <nab@linux-iscsi.org> |
|---|---|
| Date | 2017-03-31 10:00 +0200 |
| Subject | Re: [PATCH 4.10 15/17] qla2xxx: Allow vref count to timeout on vport delete. |
| Message-ID | <tqZDr-1Hf-1@gated-at.bofh.it> |
| In reply to | #1612885 |
Hi Joe + Himanshu,
Thanks for backporting this patch to apply to v4.10.y.
I haven't seen it queued to v4.9.y yet though, would you be so kind to
send out a v4.9.y backport as well to Greg-KH + stable team so it can be
picked up for earlier stable versions too..?
Thank you,
On Thu, 2017-03-30 at 12:00 +0200, Greg Kroah-Hartman wrote:
> 4.10-stable review patch. If anyone has any objections, please let me know.
>
> ------------------
>
> From: Joe Carnuccio <joe.carnuccio@cavium.com>
>
> commit c4a9b538ab2a109c5f9798bea1f8f4bf93aadfb9 upstream.
>
> Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com>
> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> ---
> drivers/scsi/qla2xxx/qla_attr.c | 4 +---
> drivers/scsi/qla2xxx/qla_def.h | 6 +++++-
> drivers/scsi/qla2xxx/qla_init.c | 1 +
> drivers/scsi/qla2xxx/qla_mid.c | 14 ++++++++------
> drivers/scsi/qla2xxx/qla_os.c | 1 +
> 5 files changed, 16 insertions(+), 10 deletions(-)
>
> --- a/drivers/scsi/qla2xxx/qla_attr.c
> +++ b/drivers/scsi/qla2xxx/qla_attr.c
> @@ -2154,8 +2154,6 @@ qla24xx_vport_delete(struct fc_vport *fc
> "Timer for the VP[%d] has stopped\n", vha->vp_idx);
> }
>
> - BUG_ON(atomic_read(&vha->vref_count));
> -
> qla2x00_free_fcports(vha);
>
> mutex_lock(&ha->vport_lock);
> @@ -2163,7 +2161,7 @@ qla24xx_vport_delete(struct fc_vport *fc
> clear_bit(vha->vp_idx, ha->vp_idx_map);
> mutex_unlock(&ha->vport_lock);
>
> - if (vha->qpair->vp_idx == vha->vp_idx) {
> + if (vha->qpair && vha->qpair->vp_idx == vha->vp_idx) {
> if (qla2xxx_delete_qpair(vha, vha->qpair) != QLA_SUCCESS)
> ql_log(ql_log_warn, vha, 0x7087,
> "Queue Pair delete failed.\n");
> --- a/drivers/scsi/qla2xxx/qla_def.h
> +++ b/drivers/scsi/qla2xxx/qla_def.h
> @@ -3788,6 +3788,7 @@ typedef struct scsi_qla_host {
> struct qla8044_reset_template reset_tmplt;
> struct qla_tgt_counters tgt_counters;
> uint16_t bbcr;
> + wait_queue_head_t vref_waitq;
> } scsi_qla_host_t;
>
> struct qla27xx_image_status {
> @@ -3843,14 +3844,17 @@ struct qla2_sgx {
> mb(); \
> if (__vha->flags.delete_progress) { \
> atomic_dec(&__vha->vref_count); \
> + wake_up(&__vha->vref_waitq); \
> __bail = 1; \
> } else { \
> __bail = 0; \
> } \
> } while (0)
>
> -#define QLA_VHA_MARK_NOT_BUSY(__vha) \
> +#define QLA_VHA_MARK_NOT_BUSY(__vha) do { \
> atomic_dec(&__vha->vref_count); \
> + wake_up(&__vha->vref_waitq); \
> +} while (0) \
>
> #define QLA_QPAIR_MARK_BUSY(__qpair, __bail) do { \
> atomic_inc(&__qpair->ref_count); \
> --- a/drivers/scsi/qla2xxx/qla_init.c
> +++ b/drivers/scsi/qla2xxx/qla_init.c
> @@ -4352,6 +4352,7 @@ qla2x00_update_fcports(scsi_qla_host_t *
> }
> }
> atomic_dec(&vha->vref_count);
> + wake_up(&vha->vref_waitq);
> }
> spin_unlock_irqrestore(&ha->vport_slock, flags);
> }
> --- a/drivers/scsi/qla2xxx/qla_mid.c
> +++ b/drivers/scsi/qla2xxx/qla_mid.c
> @@ -74,13 +74,14 @@ qla24xx_deallocate_vp_id(scsi_qla_host_t
> * ensures no active vp_list traversal while the vport is removed
> * from the queue)
> */
> - spin_lock_irqsave(&ha->vport_slock, flags);
> - while (atomic_read(&vha->vref_count)) {
> - spin_unlock_irqrestore(&ha->vport_slock, flags);
> -
> - msleep(500);
> + wait_event_timeout(vha->vref_waitq, atomic_read(&vha->vref_count),
> + 10*HZ);
>
> - spin_lock_irqsave(&ha->vport_slock, flags);
> + spin_lock_irqsave(&ha->vport_slock, flags);
> + if (atomic_read(&vha->vref_count)) {
> + ql_dbg(ql_dbg_vport, vha, 0xfffa,
> + "vha->vref_count=%u timeout\n", vha->vref_count.counter);
> + vha->vref_count = (atomic_t)ATOMIC_INIT(0);
> }
> list_del(&vha->list);
> qlt_update_vp_map(vha, RESET_VP_IDX);
> @@ -269,6 +270,7 @@ qla2x00_alert_all_vps(struct rsp_que *rs
>
> spin_lock_irqsave(&ha->vport_slock, flags);
> atomic_dec(&vha->vref_count);
> + wake_up(&vha->vref_waitq);
> }
> i++;
> }
> --- a/drivers/scsi/qla2xxx/qla_os.c
> +++ b/drivers/scsi/qla2xxx/qla_os.c
> @@ -4215,6 +4215,7 @@ struct scsi_qla_host *qla2x00_create_hos
>
> spin_lock_init(&vha->work_lock);
> spin_lock_init(&vha->cmd_list_lock);
> + init_waitqueue_head(&vha->vref_waitq);
>
> sprintf(vha->host_str, "%s_%ld", QLA2XXX_DRIVER_NAME, vha->host_no);
> ql_dbg(ql_dbg_init, vha, 0x0041,
>
>
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2017-03-30 12:20 +0200 |
| Subject | [PATCH 4.10 11/17] sparc/ptrace: Preserve previous registers for short regset write |
| Message-ID | <tqFlq-4ME-69@gated-at.bofh.it> |
| In reply to | #1612843 |
4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Martin <Dave.Martin@arm.com>
commit d3805c546b275c8cc7d40f759d029ae92c7175f2 upstream.
Ensure that if userspace supplies insufficient data to PTRACE_SETREGSET
to fill all the registers, the thread's old registers are preserved.
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/sparc/kernel/ptrace_64.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/sparc/kernel/ptrace_64.c
+++ b/arch/sparc/kernel/ptrace_64.c
@@ -350,7 +350,7 @@ static int genregs64_set(struct task_str
}
if (!ret) {
- unsigned long y;
+ unsigned long y = regs->y;
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
&y,
[toc] | [prev] | [next] | [standalone]
| From | Shuah Khan <shuahkh@osg.samsung.com> |
|---|---|
| Date | 2017-03-30 21:00 +0200 |
| Message-ID | <tqNsC-2b6-15@gated-at.bofh.it> |
| In reply to | #1612843 |
On 03/30/2017 04:00 AM, Greg Kroah-Hartman wrote: > This is the start of the stable review cycle for the 4.10.8 release. > There are 17 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 Sat Apr 1 09:59:07 UTC 2017. > 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/v4.x/stable-review/patch-4.10.8-rc1.gz > or in the git tree and branch at: > git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.10.y > and the diffstat can be found below. > > thanks, > > greg k-h > Compiled and booted on my test system. No dmesg regressions. thanks, -- Shuah
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2017-03-31 09:50 +0200 |
| Message-ID | <tqZtM-1Du-15@gated-at.bofh.it> |
| In reply to | #1613375 |
On Thu, Mar 30, 2017 at 12:54:54PM -0600, Shuah Khan wrote: > On 03/30/2017 04:00 AM, Greg Kroah-Hartman wrote: > > This is the start of the stable review cycle for the 4.10.8 release. > > There are 17 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 Sat Apr 1 09:59:07 UTC 2017. > > 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/v4.x/stable-review/patch-4.10.8-rc1.gz > > or in the git tree and branch at: > > git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.10.y > > and the diffstat can be found below. > > > > thanks, > > > > greg k-h > > > > Compiled and booted on my test system. No dmesg regressions. Thanks for testing all of these and letting me know. greg k-h
[toc] | [prev] | [next] | [standalone]
| From | Guenter Roeck <linux@roeck-us.net> |
|---|---|
| Date | 2017-03-31 05:50 +0200 |
| Message-ID | <tqVJv-7zL-5@gated-at.bofh.it> |
| In reply to | #1612843 |
On 03/30/2017 03:00 AM, Greg Kroah-Hartman wrote: > This is the start of the stable review cycle for the 4.10.8 release. > There are 17 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 Sat Apr 1 09:59:07 UTC 2017. > Anything received after that time might be too late. > Build results: total: 149 pass: 149 fail: 0 Qemu test results: total: 122 pass: 122 fail: 0 Details are available at http://kerneltests.org/builders. Guenter
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2017-03-31 09:50 +0200 |
| Message-ID | <tqZtM-1Du-29@gated-at.bofh.it> |
| In reply to | #1613605 |
On Thu, Mar 30, 2017 at 08:46:15PM -0700, Guenter Roeck wrote: > On 03/30/2017 03:00 AM, Greg Kroah-Hartman wrote: > > This is the start of the stable review cycle for the 4.10.8 release. > > There are 17 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 Sat Apr 1 09:59:07 UTC 2017. > > Anything received after that time might be too late. > > > > Build results: > total: 149 pass: 149 fail: 0 > Qemu test results: > total: 122 pass: 122 fail: 0 > > Details are available at http://kerneltests.org/builders. Thanks for testing all of these and letting me know. greg k-h
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web