From: Sasha Levin Date: Thu, 11 Jun 2020 17:42:09 +0000 (-0400) Subject: Fixes for 4.9 X-Git-Tag: v5.4.47~123 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9c72c329fa277879ea940ea6618224434c2c8bb9;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.9 Signed-off-by: Sasha Levin --- diff --git a/queue-4.9/arm-8977-1-ptrace-fix-mask-for-thumb-breakpoint-hook.patch b/queue-4.9/arm-8977-1-ptrace-fix-mask-for-thumb-breakpoint-hook.patch new file mode 100644 index 00000000000..b23a02400fa --- /dev/null +++ b/queue-4.9/arm-8977-1-ptrace-fix-mask-for-thumb-breakpoint-hook.patch @@ -0,0 +1,53 @@ +From c9fd60ba503614b5a7d1efa8843f2c4be463602b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 18 May 2020 19:41:11 +0100 +Subject: ARM: 8977/1: ptrace: Fix mask for thumb breakpoint hook + +From: Fredrik Strupe + +[ Upstream commit 3866f217aaa81bf7165c7f27362eee5d7919c496 ] + +call_undef_hook() in traps.c applies the same instr_mask for both 16-bit +and 32-bit thumb instructions. If instr_mask then is only 16 bits wide +(0xffff as opposed to 0xffffffff), the first half-word of 32-bit thumb +instructions will be masked out. This makes the function match 32-bit +thumb instructions where the second half-word is equal to instr_val, +regardless of the first half-word. + +The result in this case is that all undefined 32-bit thumb instructions +with the second half-word equal to 0xde01 (udf #1) work as breakpoints +and will raise a SIGTRAP instead of a SIGILL, instead of just the one +intended 16-bit instruction. An example of such an instruction is +0xeaa0de01, which is unallocated according to Arm ARM and should raise a +SIGILL, but instead raises a SIGTRAP. + +This patch fixes the issue by setting all the bits in instr_mask, which +will still match the intended 16-bit thumb instruction (where the +upper half is always 0), but not any 32-bit thumb instructions. + +Cc: Oleg Nesterov +Signed-off-by: Fredrik Strupe +Signed-off-by: Russell King +Signed-off-by: Sasha Levin +--- + arch/arm/kernel/ptrace.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c +index ae738a6319f6..364985c96a92 100644 +--- a/arch/arm/kernel/ptrace.c ++++ b/arch/arm/kernel/ptrace.c +@@ -227,8 +227,8 @@ static struct undef_hook arm_break_hook = { + }; + + static struct undef_hook thumb_break_hook = { +- .instr_mask = 0xffff, +- .instr_val = 0xde01, ++ .instr_mask = 0xffffffff, ++ .instr_val = 0x0000de01, + .cpsr_mask = PSR_T_BIT, + .cpsr_val = PSR_T_BIT, + .fn = break_trap, +-- +2.25.1 + diff --git a/queue-4.9/drivers-net-ibmvnic-update-vnic-protocol-version-rep.patch b/queue-4.9/drivers-net-ibmvnic-update-vnic-protocol-version-rep.patch new file mode 100644 index 00000000000..1d9eaf10634 --- /dev/null +++ b/queue-4.9/drivers-net-ibmvnic-update-vnic-protocol-version-rep.patch @@ -0,0 +1,43 @@ +From dd6fc84d2312aa055431d3342ee05623bb74dae9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 28 May 2020 11:19:17 -0500 +Subject: drivers/net/ibmvnic: Update VNIC protocol version reporting + +From: Thomas Falcon + +[ Upstream commit 784688993ebac34dffe44a9f2fabbe126ebfd4db ] + +VNIC protocol version is reported in big-endian format, but it +is not byteswapped before logging. Fix that, and remove version +comparison as only one protocol version exists at this time. + +Signed-off-by: Thomas Falcon +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/ibm/ibmvnic.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 897a87ae8655..20f7ab4aa2f1 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -3362,12 +3362,10 @@ static void ibmvnic_handle_crq(union ibmvnic_crq *crq, + dev_err(dev, "Error %ld in VERSION_EXCHG_RSP\n", rc); + break; + } +- dev_info(dev, "Partner protocol version is %d\n", +- crq->version_exchange_rsp.version); +- if (be16_to_cpu(crq->version_exchange_rsp.version) < +- ibmvnic_version) +- ibmvnic_version = ++ ibmvnic_version = + be16_to_cpu(crq->version_exchange_rsp.version); ++ dev_info(dev, "Partner protocol version is %d\n", ++ ibmvnic_version); + send_cap_queries(adapter); + break; + case QUERY_CAPABILITY_RSP: +-- +2.25.1 + diff --git a/queue-4.9/sched-fair-don-t-numa-balance-for-kthreads.patch b/queue-4.9/sched-fair-don-t-numa-balance-for-kthreads.patch new file mode 100644 index 00000000000..0e20c1e27db --- /dev/null +++ b/queue-4.9/sched-fair-don-t-numa-balance-for-kthreads.patch @@ -0,0 +1,55 @@ +From f341d73ce94cd417b002ea7beb07c06e7c802bf2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 26 May 2020 09:38:31 -0600 +Subject: sched/fair: Don't NUMA balance for kthreads + +From: Jens Axboe + +[ Upstream commit 18f855e574d9799a0e7489f8ae6fd8447d0dd74a ] + +Stefano reported a crash with using SQPOLL with io_uring: + + BUG: kernel NULL pointer dereference, address: 00000000000003b0 + CPU: 2 PID: 1307 Comm: io_uring-sq Not tainted 5.7.0-rc7 #11 + RIP: 0010:task_numa_work+0x4f/0x2c0 + Call Trace: + task_work_run+0x68/0xa0 + io_sq_thread+0x252/0x3d0 + kthread+0xf9/0x130 + ret_from_fork+0x35/0x40 + +which is task_numa_work() oopsing on current->mm being NULL. + +The task work is queued by task_tick_numa(), which checks if current->mm is +NULL at the time of the call. But this state isn't necessarily persistent, +if the kthread is using use_mm() to temporarily adopt the mm of a task. + +Change the task_tick_numa() check to exclude kernel threads in general, +as it doesn't make sense to attempt ot balance for kthreads anyway. + +Reported-by: Stefano Garzarella +Signed-off-by: Jens Axboe +Signed-off-by: Ingo Molnar +Acked-by: Peter Zijlstra +Link: https://lore.kernel.org/r/865de121-8190-5d30-ece5-3b097dc74431@kernel.dk +Signed-off-by: Sasha Levin +--- + kernel/sched/fair.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c +index 5e65c7eea872..8233032a2f01 100644 +--- a/kernel/sched/fair.c ++++ b/kernel/sched/fair.c +@@ -2542,7 +2542,7 @@ void task_tick_numa(struct rq *rq, struct task_struct *curr) + /* + * We don't care about NUMA placement if we don't have memory. + */ +- if (!curr->mm || (curr->flags & PF_EXITING) || work->next != work) ++ if ((curr->flags & (PF_EXITING | PF_KTHREAD)) || work->next != work) + return; + + /* +-- +2.25.1 + diff --git a/queue-4.9/series b/queue-4.9/series index 75a41bf18f2..b6d37d548bf 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -2,3 +2,6 @@ ipv6-fix-ipv6_addrform-operation-logic.patch vxlan-avoid-infinite-loop-when-suppressing-ns-messages-with-invalid-options.patch scsi-return-correct-blkprep-status-code-in-case-scsi_init_io-fails.patch crypto-talitos-fix-ecb-and-cbc-algs-ivsize.patch +arm-8977-1-ptrace-fix-mask-for-thumb-breakpoint-hook.patch +sched-fair-don-t-numa-balance-for-kthreads.patch +drivers-net-ibmvnic-update-vnic-protocol-version-rep.patch