From: Greg Kroah-Hartman Date: Mon, 16 Mar 2020 11:01:29 +0000 (+0100) Subject: 4.19-stable patches X-Git-Tag: v4.19.111~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6442088cd0818ae0f1d10d55a8b2c21ec9d79a12;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: cgroup-cgroup_procs_next-should-increase-position-index.patch cgroup-iterate-tasks-that-did-not-finish-do_exit.patch drm-amd-display-remove-duplicated-assignment-to-grph_obj_type.patch iommu-vt-d-quirk_ioat_snb_local_iommu-replace-warn_taint-with-pr_warn-add_taint.patch iwlwifi-mvm-do-not-require-phy_sku-nvm-section-for-3168-devices.patch netfilter-nf_conntrack-ct_cpu_seq_next-should-increase-position-index.patch netfilter-synproxy-synproxy_cpu_seq_next-should-increase-position-index.patch netfilter-x_tables-xt_mttg_seq_next-should-increase-position-index.patch netfilter-xt_recent-recent_seq_next-should-increase-position-index.patch virtio-blk-fix-hw_queue-stopped-on-arbitrary-error.patch workqueue-don-t-use-wq_select_unbound_cpu-for-bound-works.patch --- diff --git a/queue-4.19/cgroup-cgroup_procs_next-should-increase-position-index.patch b/queue-4.19/cgroup-cgroup_procs_next-should-increase-position-index.patch new file mode 100644 index 00000000000..bdec4f5ba5c --- /dev/null +++ b/queue-4.19/cgroup-cgroup_procs_next-should-increase-position-index.patch @@ -0,0 +1,85 @@ +From 2d4ecb030dcc90fb725ecbfc82ce5d6c37906e0e Mon Sep 17 00:00:00 2001 +From: Vasily Averin +Date: Thu, 30 Jan 2020 13:34:59 +0300 +Subject: cgroup: cgroup_procs_next should increase position index + +From: Vasily Averin + +commit 2d4ecb030dcc90fb725ecbfc82ce5d6c37906e0e upstream. + +If seq_file .next fuction does not change position index, +read after some lseek can generate unexpected output: + +1) dd bs=1 skip output of each 2nd elements +$ dd if=/sys/fs/cgroup/cgroup.procs bs=8 count=1 +2 +3 +4 +5 +1+0 records in +1+0 records out +8 bytes copied, 0,000267297 s, 29,9 kB/s +[test@localhost ~]$ dd if=/sys/fs/cgroup/cgroup.procs bs=1 count=8 +2 +4 <<< NB! 3 was skipped +6 <<< ... and 5 too +8 <<< ... and 7 +8+0 records in +8+0 records out +8 bytes copied, 5,2123e-05 s, 153 kB/s + + This happen because __cgroup_procs_start() makes an extra + extra cgroup_procs_next() call + +2) read after lseek beyond end of file generates whole last line. +3) read after lseek into middle of last line generates +expected rest of last line and unexpected whole line once again. + +Additionally patch removes an extra position index changes in +__cgroup_procs_start() + +Cc: stable@vger.kernel.org +https://bugzilla.kernel.org/show_bug.cgi?id=206283 +Signed-off-by: Vasily Averin +Signed-off-by: Tejun Heo +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/cgroup/cgroup.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +--- a/kernel/cgroup/cgroup.c ++++ b/kernel/cgroup/cgroup.c +@@ -4355,6 +4355,9 @@ static void *cgroup_procs_next(struct se + struct kernfs_open_file *of = s->private; + struct css_task_iter *it = of->priv; + ++ if (pos) ++ (*pos)++; ++ + return css_task_iter_next(it); + } + +@@ -4370,7 +4373,7 @@ static void *__cgroup_procs_start(struct + * from position 0, so we can simply keep iterating on !0 *pos. + */ + if (!it) { +- if (WARN_ON_ONCE((*pos)++)) ++ if (WARN_ON_ONCE((*pos))) + return ERR_PTR(-EINVAL); + + it = kzalloc(sizeof(*it), GFP_KERNEL); +@@ -4378,10 +4381,11 @@ static void *__cgroup_procs_start(struct + return ERR_PTR(-ENOMEM); + of->priv = it; + css_task_iter_start(&cgrp->self, iter_flags, it); +- } else if (!(*pos)++) { ++ } else if (!(*pos)) { + css_task_iter_end(it); + css_task_iter_start(&cgrp->self, iter_flags, it); +- } ++ } else ++ return it->cur_task; + + return cgroup_procs_next(s, NULL, NULL); + } diff --git a/queue-4.19/cgroup-iterate-tasks-that-did-not-finish-do_exit.patch b/queue-4.19/cgroup-iterate-tasks-that-did-not-finish-do_exit.patch new file mode 100644 index 00000000000..e812da49945 --- /dev/null +++ b/queue-4.19/cgroup-iterate-tasks-that-did-not-finish-do_exit.patch @@ -0,0 +1,100 @@ +From 9c974c77246460fa6a92c18554c3311c8c83c160 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michal=20Koutn=C3=BD?= +Date: Fri, 24 Jan 2020 12:40:15 +0100 +Subject: cgroup: Iterate tasks that did not finish do_exit() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Michal Koutný + +commit 9c974c77246460fa6a92c18554c3311c8c83c160 upstream. + +PF_EXITING is set earlier than actual removal from css_set when a task +is exitting. This can confuse cgroup.procs readers who see no PF_EXITING +tasks, however, rmdir is checking against css_set membership so it can +transitionally fail with EBUSY. + +Fix this by listing tasks that weren't unlinked from css_set active +lists. +It may happen that other users of the task iterator (without +CSS_TASK_ITER_PROCS) spot a PF_EXITING task before cgroup_exit(). This +is equal to the state before commit c03cd7738a83 ("cgroup: Include dying +leaders with live threads in PROCS iterations") but it may be reviewed +later. + +Reported-by: Suren Baghdasaryan +Fixes: c03cd7738a83 ("cgroup: Include dying leaders with live threads in PROCS iterations") +Signed-off-by: Michal Koutný +Signed-off-by: Tejun Heo +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/cgroup.h | 1 + + kernel/cgroup/cgroup.c | 23 ++++++++++++++++------- + 2 files changed, 17 insertions(+), 7 deletions(-) + +--- a/include/linux/cgroup.h ++++ b/include/linux/cgroup.h +@@ -62,6 +62,7 @@ struct css_task_iter { + struct list_head *mg_tasks_head; + struct list_head *dying_tasks_head; + ++ struct list_head *cur_tasks_head; + struct css_set *cur_cset; + struct css_set *cur_dcset; + struct task_struct *cur_task; +--- a/kernel/cgroup/cgroup.c ++++ b/kernel/cgroup/cgroup.c +@@ -4157,12 +4157,16 @@ static void css_task_iter_advance_css_se + } + } while (!css_set_populated(cset) && list_empty(&cset->dying_tasks)); + +- if (!list_empty(&cset->tasks)) ++ if (!list_empty(&cset->tasks)) { + it->task_pos = cset->tasks.next; +- else if (!list_empty(&cset->mg_tasks)) ++ it->cur_tasks_head = &cset->tasks; ++ } else if (!list_empty(&cset->mg_tasks)) { + it->task_pos = cset->mg_tasks.next; +- else ++ it->cur_tasks_head = &cset->mg_tasks; ++ } else { + it->task_pos = cset->dying_tasks.next; ++ it->cur_tasks_head = &cset->dying_tasks; ++ } + + it->tasks_head = &cset->tasks; + it->mg_tasks_head = &cset->mg_tasks; +@@ -4220,10 +4224,14 @@ repeat: + else + it->task_pos = it->task_pos->next; + +- if (it->task_pos == it->tasks_head) ++ if (it->task_pos == it->tasks_head) { + it->task_pos = it->mg_tasks_head->next; +- if (it->task_pos == it->mg_tasks_head) ++ it->cur_tasks_head = it->mg_tasks_head; ++ } ++ if (it->task_pos == it->mg_tasks_head) { + it->task_pos = it->dying_tasks_head->next; ++ it->cur_tasks_head = it->dying_tasks_head; ++ } + if (it->task_pos == it->dying_tasks_head) + css_task_iter_advance_css_set(it); + } else { +@@ -4242,11 +4250,12 @@ repeat: + goto repeat; + + /* and dying leaders w/o live member threads */ +- if (!atomic_read(&task->signal->live)) ++ if (it->cur_tasks_head == it->dying_tasks_head && ++ !atomic_read(&task->signal->live)) + goto repeat; + } else { + /* skip all dying ones */ +- if (task->flags & PF_EXITING) ++ if (it->cur_tasks_head == it->dying_tasks_head) + goto repeat; + } + } diff --git a/queue-4.19/drm-amd-display-remove-duplicated-assignment-to-grph_obj_type.patch b/queue-4.19/drm-amd-display-remove-duplicated-assignment-to-grph_obj_type.patch new file mode 100644 index 00000000000..fd5826ef4ad --- /dev/null +++ b/queue-4.19/drm-amd-display-remove-duplicated-assignment-to-grph_obj_type.patch @@ -0,0 +1,34 @@ +From d785476c608c621b345dd9396e8b21e90375cb0e Mon Sep 17 00:00:00 2001 +From: Colin Ian King +Date: Fri, 8 Nov 2019 14:45:27 +0000 +Subject: drm/amd/display: remove duplicated assignment to grph_obj_type + +From: Colin Ian King + +commit d785476c608c621b345dd9396e8b21e90375cb0e upstream. + +Variable grph_obj_type is being assigned twice, one of these is +redundant so remove it. + +Addresses-Coverity: ("Evaluation order violation") +Signed-off-by: Colin Ian King +Signed-off-by: Alex Deucher +Cc: +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c +@@ -364,8 +364,7 @@ bool amdgpu_atombios_get_connector_info_ + router.ddc_valid = false; + router.cd_valid = false; + for (j = 0; j < ((le16_to_cpu(path->usSize) - 8) / 2); j++) { +- uint8_t grph_obj_type= +- grph_obj_type = ++ uint8_t grph_obj_type = + (le16_to_cpu(path->usGraphicObjIds[j]) & + OBJECT_TYPE_MASK) >> OBJECT_TYPE_SHIFT; + diff --git a/queue-4.19/iommu-vt-d-quirk_ioat_snb_local_iommu-replace-warn_taint-with-pr_warn-add_taint.patch b/queue-4.19/iommu-vt-d-quirk_ioat_snb_local_iommu-replace-warn_taint-with-pr_warn-add_taint.patch new file mode 100644 index 00000000000..d2620e48f16 --- /dev/null +++ b/queue-4.19/iommu-vt-d-quirk_ioat_snb_local_iommu-replace-warn_taint-with-pr_warn-add_taint.patch @@ -0,0 +1,53 @@ +From 81ee85d0462410de8eeeec1b9761941fd6ed8c7b Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 9 Mar 2020 19:25:10 +0100 +Subject: iommu/vt-d: quirk_ioat_snb_local_iommu: replace WARN_TAINT with pr_warn + add_taint + +From: Hans de Goede + +commit 81ee85d0462410de8eeeec1b9761941fd6ed8c7b upstream. + +Quoting from the comment describing the WARN functions in +include/asm-generic/bug.h: + + * WARN(), WARN_ON(), WARN_ON_ONCE, and so on can be used to report + * significant kernel issues that need prompt attention if they should ever + * appear at runtime. + * + * Do not use these macros when checking for invalid external inputs + +The (buggy) firmware tables which the dmar code was calling WARN_TAINT +for really are invalid external inputs. They are not under the kernel's +control and the issues in them cannot be fixed by a kernel update. +So logging a backtrace, which invites bug reports to be filed about this, +is not helpful. + +Fixes: 556ab45f9a77 ("ioat2: catch and recover from broken vtd configurations v6") +Signed-off-by: Hans de Goede +Acked-by: Lu Baolu +Link: https://lore.kernel.org/r/20200309182510.373875-1-hdegoede@redhat.com +BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=701847 +Signed-off-by: Joerg Roedel +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iommu/intel-iommu.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +--- a/drivers/iommu/intel-iommu.c ++++ b/drivers/iommu/intel-iommu.c +@@ -3998,10 +3998,11 @@ static void quirk_ioat_snb_local_iommu(s + + /* we know that the this iommu should be at offset 0xa000 from vtbar */ + drhd = dmar_find_matched_drhd_unit(pdev); +- if (WARN_TAINT_ONCE(!drhd || drhd->reg_base_addr - vtbar != 0xa000, +- TAINT_FIRMWARE_WORKAROUND, +- "BIOS assigned incorrect VT-d unit for Intel(R) QuickData Technology device\n")) ++ if (!drhd || drhd->reg_base_addr - vtbar != 0xa000) { ++ pr_warn_once(FW_BUG "BIOS assigned incorrect VT-d unit for Intel(R) QuickData Technology device\n"); ++ add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK); + pdev->dev.archdata.iommu = DUMMY_DEVICE_DOMAIN_INFO; ++ } + } + DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT_SNB, quirk_ioat_snb_local_iommu); + diff --git a/queue-4.19/iwlwifi-mvm-do-not-require-phy_sku-nvm-section-for-3168-devices.patch b/queue-4.19/iwlwifi-mvm-do-not-require-phy_sku-nvm-section-for-3168-devices.patch new file mode 100644 index 00000000000..f9386d661f8 --- /dev/null +++ b/queue-4.19/iwlwifi-mvm-do-not-require-phy_sku-nvm-section-for-3168-devices.patch @@ -0,0 +1,41 @@ +From a9149d243f259ad8f02b1e23dfe8ba06128f15e1 Mon Sep 17 00:00:00 2001 +From: Dan Moulding +Date: Tue, 28 Jan 2020 02:31:07 -0700 +Subject: iwlwifi: mvm: Do not require PHY_SKU NVM section for 3168 devices + +From: Dan Moulding + +commit a9149d243f259ad8f02b1e23dfe8ba06128f15e1 upstream. + +The logic for checking required NVM sections was recently fixed in +commit b3f20e098293 ("iwlwifi: mvm: fix NVM check for 3168 +devices"). However, with that fixed the else is now taken for 3168 +devices and within the else clause there is a mandatory check for the +PHY_SKU section. This causes the parsing to fail for 3168 devices. + +The PHY_SKU section is really only mandatory for the IWL_NVM_EXT +layout (the phy_sku parameter of iwl_parse_nvm_data is only used when +the NVM type is IWL_NVM_EXT). So this changes the PHY_SKU section +check so that it's only mandatory for IWL_NVM_EXT. + +Fixes: b3f20e098293 ("iwlwifi: mvm: fix NVM check for 3168 devices") +Signed-off-by: Dan Moulding +Signed-off-by: Kalle Valo +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/intel/iwlwifi/mvm/nvm.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c +@@ -314,7 +314,8 @@ iwl_parse_nvm_sections(struct iwl_mvm *m + } + + /* PHY_SKU section is mandatory in B0 */ +- if (!mvm->nvm_sections[NVM_SECTION_TYPE_PHY_SKU].data) { ++ if (mvm->trans->cfg->nvm_type == IWL_NVM_EXT && ++ !mvm->nvm_sections[NVM_SECTION_TYPE_PHY_SKU].data) { + IWL_ERR(mvm, + "Can't parse phy_sku in B0, empty sections\n"); + return NULL; diff --git a/queue-4.19/netfilter-nf_conntrack-ct_cpu_seq_next-should-increase-position-index.patch b/queue-4.19/netfilter-nf_conntrack-ct_cpu_seq_next-should-increase-position-index.patch new file mode 100644 index 00000000000..537b00c68d3 --- /dev/null +++ b/queue-4.19/netfilter-nf_conntrack-ct_cpu_seq_next-should-increase-position-index.patch @@ -0,0 +1,35 @@ +From dc15af8e9dbd039ebb06336597d2c491ef46ab74 Mon Sep 17 00:00:00 2001 +From: Vasily Averin +Date: Tue, 25 Feb 2020 10:05:47 +0300 +Subject: netfilter: nf_conntrack: ct_cpu_seq_next should increase position index + +From: Vasily Averin + +commit dc15af8e9dbd039ebb06336597d2c491ef46ab74 upstream. + +If .next function does not change position index, +following .show function will repeat output related +to current position index. + +Cc: stable@vger.kernel.org +Fixes: 1f4aace60b0e ("fs/seq_file.c: simplify seq_file iteration code ...") +Link: https://bugzilla.kernel.org/show_bug.cgi?id=206283 +Signed-off-by: Vasily Averin +Signed-off-by: Pablo Neira Ayuso +Signed-off-by: Greg Kroah-Hartman + +--- + net/netfilter/nf_conntrack_standalone.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/netfilter/nf_conntrack_standalone.c ++++ b/net/netfilter/nf_conntrack_standalone.c +@@ -390,7 +390,7 @@ static void *ct_cpu_seq_next(struct seq_ + *pos = cpu + 1; + return per_cpu_ptr(net->ct.stat, cpu); + } +- ++ (*pos)++; + return NULL; + } + diff --git a/queue-4.19/netfilter-synproxy-synproxy_cpu_seq_next-should-increase-position-index.patch b/queue-4.19/netfilter-synproxy-synproxy_cpu_seq_next-should-increase-position-index.patch new file mode 100644 index 00000000000..7a64c8ba812 --- /dev/null +++ b/queue-4.19/netfilter-synproxy-synproxy_cpu_seq_next-should-increase-position-index.patch @@ -0,0 +1,35 @@ +From bb71f846a0002239f7058c84f1496648ff4a5c20 Mon Sep 17 00:00:00 2001 +From: Vasily Averin +Date: Tue, 25 Feb 2020 10:05:59 +0300 +Subject: netfilter: synproxy: synproxy_cpu_seq_next should increase position index + +From: Vasily Averin + +commit bb71f846a0002239f7058c84f1496648ff4a5c20 upstream. + +If .next function does not change position index, +following .show function will repeat output related +to current position index. + +Cc: stable@vger.kernel.org +Fixes: 1f4aace60b0e ("fs/seq_file.c: simplify seq_file iteration code ...") +Link: https://bugzilla.kernel.org/show_bug.cgi?id=206283 +Signed-off-by: Vasily Averin +Signed-off-by: Pablo Neira Ayuso +Signed-off-by: Greg Kroah-Hartman + +--- + net/netfilter/nf_synproxy_core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/netfilter/nf_synproxy_core.c ++++ b/net/netfilter/nf_synproxy_core.c +@@ -273,7 +273,7 @@ static void *synproxy_cpu_seq_next(struc + *pos = cpu + 1; + return per_cpu_ptr(snet->stats, cpu); + } +- ++ (*pos)++; + return NULL; + } + diff --git a/queue-4.19/netfilter-x_tables-xt_mttg_seq_next-should-increase-position-index.patch b/queue-4.19/netfilter-x_tables-xt_mttg_seq_next-should-increase-position-index.patch new file mode 100644 index 00000000000..6be7a96d1c3 --- /dev/null +++ b/queue-4.19/netfilter-x_tables-xt_mttg_seq_next-should-increase-position-index.patch @@ -0,0 +1,69 @@ +From ee84f19cbbe9cf7cba2958acb03163fed3ecbb0f Mon Sep 17 00:00:00 2001 +From: Vasily Averin +Date: Tue, 25 Feb 2020 10:07:12 +0300 +Subject: netfilter: x_tables: xt_mttg_seq_next should increase position index + +From: Vasily Averin + +commit ee84f19cbbe9cf7cba2958acb03163fed3ecbb0f upstream. + +If .next function does not change position index, +following .show function will repeat output related +to current position index. + +Without patch: + # dd if=/proc/net/ip_tables_matches # original file output + conntrack + conntrack + conntrack + recent + recent + icmp + udplite + udp + tcp + 0+1 records in + 0+1 records out + 65 bytes copied, 5.4074e-05 s, 1.2 MB/s + + # dd if=/proc/net/ip_tables_matches bs=62 skip=1 + dd: /proc/net/ip_tables_matches: cannot skip to specified offset + cp <<< end of last line + tcp <<< and then unexpected whole last line once again + 0+1 records in + 0+1 records out + 7 bytes copied, 0.000102447 s, 68.3 kB/s + +Cc: stable@vger.kernel.org +Fixes: 1f4aace60b0e ("fs/seq_file.c: simplify seq_file iteration code ...") +Link: https://bugzilla.kernel.org/show_bug.cgi?id=206283 +Signed-off-by: Vasily Averin +Signed-off-by: Pablo Neira Ayuso +Signed-off-by: Greg Kroah-Hartman + +--- + net/netfilter/x_tables.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/net/netfilter/x_tables.c ++++ b/net/netfilter/x_tables.c +@@ -1556,6 +1556,9 @@ static void *xt_mttg_seq_next(struct seq + uint8_t nfproto = (unsigned long)PDE_DATA(file_inode(seq->file)); + struct nf_mttg_trav *trav = seq->private; + ++ if (ppos != NULL) ++ ++(*ppos); ++ + switch (trav->class) { + case MTTG_TRAV_INIT: + trav->class = MTTG_TRAV_NFP_UNSPEC; +@@ -1581,9 +1584,6 @@ static void *xt_mttg_seq_next(struct seq + default: + return NULL; + } +- +- if (ppos != NULL) +- ++*ppos; + return trav; + } + diff --git a/queue-4.19/netfilter-xt_recent-recent_seq_next-should-increase-position-index.patch b/queue-4.19/netfilter-xt_recent-recent_seq_next-should-increase-position-index.patch new file mode 100644 index 00000000000..58b3e106891 --- /dev/null +++ b/queue-4.19/netfilter-xt_recent-recent_seq_next-should-increase-position-index.patch @@ -0,0 +1,61 @@ +From db25517a550926f609c63054b12ea9ad515e1a10 Mon Sep 17 00:00:00 2001 +From: Vasily Averin +Date: Tue, 25 Feb 2020 10:06:29 +0300 +Subject: netfilter: xt_recent: recent_seq_next should increase position index + +From: Vasily Averin + +commit db25517a550926f609c63054b12ea9ad515e1a10 upstream. + +If .next function does not change position index, +following .show function will repeat output related +to current position index. + +Without the patch: + # dd if=/proc/net/xt_recent/SSH # original file outpt + src=127.0.0.4 ttl: 0 last_seen: 6275444819 oldest_pkt: 1 6275444819 + src=127.0.0.2 ttl: 0 last_seen: 6275438906 oldest_pkt: 1 6275438906 + src=127.0.0.3 ttl: 0 last_seen: 6275441953 oldest_pkt: 1 6275441953 + 0+1 records in + 0+1 records out + 204 bytes copied, 6.1332e-05 s, 3.3 MB/s + +Read after lseek into middle of last line (offset 140 in example below) +generates expected end of last line and then unexpected whole last line +once again + + # dd if=/proc/net/xt_recent/SSH bs=140 skip=1 + dd: /proc/net/xt_recent/SSH: cannot skip to specified offset + 127.0.0.3 ttl: 0 last_seen: 6275441953 oldest_pkt: 1 6275441953 + src=127.0.0.3 ttl: 0 last_seen: 6275441953 oldest_pkt: 1 6275441953 + 0+1 records in + 0+1 records out + 132 bytes copied, 6.2487e-05 s, 2.1 MB/s + +Cc: stable@vger.kernel.org +Fixes: 1f4aace60b0e ("fs/seq_file.c: simplify seq_file iteration code ...") +Link: https://bugzilla.kernel.org/show_bug.cgi?id=206283 +Signed-off-by: Vasily Averin +Signed-off-by: Pablo Neira Ayuso +Signed-off-by: Greg Kroah-Hartman + +--- + net/netfilter/xt_recent.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/netfilter/xt_recent.c ++++ b/net/netfilter/xt_recent.c +@@ -497,12 +497,12 @@ static void *recent_seq_next(struct seq_ + const struct recent_entry *e = v; + const struct list_head *head = e->list.next; + ++ (*pos)++; + while (head == &t->iphash[st->bucket]) { + if (++st->bucket >= ip_list_hash_size) + return NULL; + head = t->iphash[st->bucket].next; + } +- (*pos)++; + return list_entry(head, struct recent_entry, list); + } + diff --git a/queue-4.19/series b/queue-4.19/series index 0c2b21fec6f..1b47b2dd7bd 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -43,3 +43,14 @@ bonding-alb-make-sure-arp-header-is-pulled-before-accessing-it.patch slip-make-slhc_compress-more-robust-against-malicious-packets.patch net-fec-validate-the-new-settings-in-fec_enet_set_coalesce.patch macvlan-add-cond_resched-during-multicast-processing.patch +cgroup-cgroup_procs_next-should-increase-position-index.patch +cgroup-iterate-tasks-that-did-not-finish-do_exit.patch +iwlwifi-mvm-do-not-require-phy_sku-nvm-section-for-3168-devices.patch +virtio-blk-fix-hw_queue-stopped-on-arbitrary-error.patch +iommu-vt-d-quirk_ioat_snb_local_iommu-replace-warn_taint-with-pr_warn-add_taint.patch +netfilter-nf_conntrack-ct_cpu_seq_next-should-increase-position-index.patch +netfilter-synproxy-synproxy_cpu_seq_next-should-increase-position-index.patch +netfilter-xt_recent-recent_seq_next-should-increase-position-index.patch +netfilter-x_tables-xt_mttg_seq_next-should-increase-position-index.patch +workqueue-don-t-use-wq_select_unbound_cpu-for-bound-works.patch +drm-amd-display-remove-duplicated-assignment-to-grph_obj_type.patch diff --git a/queue-4.19/virtio-blk-fix-hw_queue-stopped-on-arbitrary-error.patch b/queue-4.19/virtio-blk-fix-hw_queue-stopped-on-arbitrary-error.patch new file mode 100644 index 00000000000..49489c9e935 --- /dev/null +++ b/queue-4.19/virtio-blk-fix-hw_queue-stopped-on-arbitrary-error.patch @@ -0,0 +1,51 @@ +From f5f6b95c72f7f8bb46eace8c5306c752d0133daa Mon Sep 17 00:00:00 2001 +From: Halil Pasic +Date: Thu, 13 Feb 2020 13:37:27 +0100 +Subject: virtio-blk: fix hw_queue stopped on arbitrary error + +From: Halil Pasic + +commit f5f6b95c72f7f8bb46eace8c5306c752d0133daa upstream. + +Since nobody else is going to restart our hw_queue for us, the +blk_mq_start_stopped_hw_queues() is in virtblk_done() is not sufficient +necessarily sufficient to ensure that the queue will get started again. +In case of global resource outage (-ENOMEM because mapping failure, +because of swiotlb full) our virtqueue may be empty and we can get +stuck with a stopped hw_queue. + +Let us not stop the queue on arbitrary errors, but only on -EONSPC which +indicates a full virtqueue, where the hw_queue is guaranteed to get +started by virtblk_done() before when it makes sense to carry on +submitting requests. Let us also remove a stale comment. + +Signed-off-by: Halil Pasic +Cc: Jens Axboe +Fixes: f7728002c1c7 ("virtio_ring: fix return code on DMA mapping fails") +Link: https://lore.kernel.org/r/20200213123728.61216-2-pasic@linux.ibm.com +Signed-off-by: Michael S. Tsirkin +Reviewed-by: Stefan Hajnoczi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/block/virtio_blk.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +--- a/drivers/block/virtio_blk.c ++++ b/drivers/block/virtio_blk.c +@@ -271,10 +271,12 @@ static blk_status_t virtio_queue_rq(stru + err = virtblk_add_req(vblk->vqs[qid].vq, vbr, vbr->sg, num); + if (err) { + virtqueue_kick(vblk->vqs[qid].vq); +- blk_mq_stop_hw_queue(hctx); ++ /* Don't stop the queue if -ENOMEM: we may have failed to ++ * bounce the buffer due to global resource outage. ++ */ ++ if (err == -ENOSPC) ++ blk_mq_stop_hw_queue(hctx); + spin_unlock_irqrestore(&vblk->vqs[qid].lock, flags); +- /* Out of mem doesn't actually happen, since we fall back +- * to direct descriptors */ + if (err == -ENOMEM || err == -ENOSPC) + return BLK_STS_DEV_RESOURCE; + return BLK_STS_IOERR; diff --git a/queue-4.19/workqueue-don-t-use-wq_select_unbound_cpu-for-bound-works.patch b/queue-4.19/workqueue-don-t-use-wq_select_unbound_cpu-for-bound-works.patch new file mode 100644 index 00000000000..8d9a1f9da53 --- /dev/null +++ b/queue-4.19/workqueue-don-t-use-wq_select_unbound_cpu-for-bound-works.patch @@ -0,0 +1,61 @@ +From aa202f1f56960c60e7befaa0f49c72b8fa11b0a8 Mon Sep 17 00:00:00 2001 +From: Hillf Danton +Date: Fri, 24 Jan 2020 20:14:45 -0500 +Subject: workqueue: don't use wq_select_unbound_cpu() for bound works + +From: Hillf Danton + +commit aa202f1f56960c60e7befaa0f49c72b8fa11b0a8 upstream. + +wq_select_unbound_cpu() is designed for unbound workqueues only, but +it's wrongly called when using a bound workqueue too. + +Fixing this ensures work queued to a bound workqueue with +cpu=WORK_CPU_UNBOUND always runs on the local CPU. + +Before, that would happen only if wq_unbound_cpumask happened to include +it (likely almost always the case), or was empty, or we got lucky with +forced round-robin placement. So restricting +/sys/devices/virtual/workqueue/cpumask to a small subset of a machine's +CPUs would cause some bound work items to run unexpectedly there. + +Fixes: ef557180447f ("workqueue: schedule WORK_CPU_UNBOUND work on wq_unbound_cpumask CPUs") +Cc: stable@vger.kernel.org # v4.5+ +Signed-off-by: Hillf Danton +[dj: massage changelog] +Signed-off-by: Daniel Jordan +Cc: Tejun Heo +Cc: Lai Jiangshan +Cc: linux-kernel@vger.kernel.org +Signed-off-by: Tejun Heo +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/workqueue.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +--- a/kernel/workqueue.c ++++ b/kernel/workqueue.c +@@ -1384,14 +1384,16 @@ static void __queue_work(int cpu, struct + WARN_ON_ONCE(!is_chained_work(wq))) + return; + retry: +- if (req_cpu == WORK_CPU_UNBOUND) +- cpu = wq_select_unbound_cpu(raw_smp_processor_id()); +- + /* pwq which will be used unless @work is executing elsewhere */ +- if (!(wq->flags & WQ_UNBOUND)) +- pwq = per_cpu_ptr(wq->cpu_pwqs, cpu); +- else ++ if (wq->flags & WQ_UNBOUND) { ++ if (req_cpu == WORK_CPU_UNBOUND) ++ cpu = wq_select_unbound_cpu(raw_smp_processor_id()); + pwq = unbound_pwq_by_node(wq, cpu_to_node(cpu)); ++ } else { ++ if (req_cpu == WORK_CPU_UNBOUND) ++ cpu = raw_smp_processor_id(); ++ pwq = per_cpu_ptr(wq->cpu_pwqs, cpu); ++ } + + /* + * If @work was previously on a different pool, it might still be