]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.1-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Jul 2023 15:24:13 +0000 (17:24 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Jul 2023 15:24:13 +0000 (17:24 +0200)
added patches:
net-sched-sch_qfq-reintroduce-lmax-bound-check-for-mtu.patch
swiotlb-mark-swiotlb_memblock_alloc-as-__init.patch

queue-6.1/net-sched-sch_qfq-reintroduce-lmax-bound-check-for-mtu.patch [new file with mode: 0644]
queue-6.1/series
queue-6.1/swiotlb-mark-swiotlb_memblock_alloc-as-__init.patch [new file with mode: 0644]

diff --git a/queue-6.1/net-sched-sch_qfq-reintroduce-lmax-bound-check-for-mtu.patch b/queue-6.1/net-sched-sch_qfq-reintroduce-lmax-bound-check-for-mtu.patch
new file mode 100644 (file)
index 0000000..ec990f6
--- /dev/null
@@ -0,0 +1,47 @@
+From 158810b261d02fc7dd92ca9c392d8f8a211a2401 Mon Sep 17 00:00:00 2001
+From: Pedro Tammela <pctammela@mojatatu.com>
+Date: Tue, 11 Jul 2023 18:01:00 -0300
+Subject: net/sched: sch_qfq: reintroduce lmax bound check for MTU
+
+From: Pedro Tammela <pctammela@mojatatu.com>
+
+commit 158810b261d02fc7dd92ca9c392d8f8a211a2401 upstream.
+
+25369891fcef deletes a check for the case where no 'lmax' is
+specified which 3037933448f6 previously fixed as 'lmax'
+could be set to the device's MTU without any bound checking
+for QFQ_LMAX_MIN and QFQ_LMAX_MAX. Therefore, reintroduce the check.
+
+Fixes: 25369891fcef ("net/sched: sch_qfq: refactor parsing of netlink parameters")
+Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
+Reviewed-by: Eric Dumazet <edumazet@google.com>
+Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
+Reviewed-by: Simon Horman <simon.horman@corigine.com>
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/sched/sch_qfq.c |   11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+--- a/net/sched/sch_qfq.c
++++ b/net/sched/sch_qfq.c
+@@ -428,10 +428,17 @@ static int qfq_change_class(struct Qdisc
+       else
+               weight = 1;
+-      if (tb[TCA_QFQ_LMAX])
++      if (tb[TCA_QFQ_LMAX]) {
+               lmax = nla_get_u32(tb[TCA_QFQ_LMAX]);
+-      else
++      } else {
++              /* MTU size is user controlled */
+               lmax = psched_mtu(qdisc_dev(sch));
++              if (lmax < QFQ_MIN_LMAX || lmax > QFQ_MAX_LMAX) {
++                      NL_SET_ERR_MSG_MOD(extack,
++                                         "MTU size out of bounds for qfq");
++                      return -EINVAL;
++              }
++      }
+       inv_w = ONE_FP / weight;
+       weight = ONE_FP / inv_w;
index c8f63327ae552242db72ff03cc25c13544bfdf0a..830336051bafde8ef6b34185e9b010f1e76f59b3 100644 (file)
@@ -219,3 +219,5 @@ scsi-qla2xxx-remove-unused-nvme_ls_waitq-wait-queue.patch
 scsi-qla2xxx-fix-end-of-loop-test.patch
 mips-kvm-fix-build-error-with-kvm_mips_debug_cop0_counters-enabled.patch
 revert-drm-amd-disable-psr-su-on-parade-0803-tcon.patch
+swiotlb-mark-swiotlb_memblock_alloc-as-__init.patch
+net-sched-sch_qfq-reintroduce-lmax-bound-check-for-mtu.patch
diff --git a/queue-6.1/swiotlb-mark-swiotlb_memblock_alloc-as-__init.patch b/queue-6.1/swiotlb-mark-swiotlb_memblock_alloc-as-__init.patch
new file mode 100644 (file)
index 0000000..104bf34
--- /dev/null
@@ -0,0 +1,46 @@
+From 9b07d27d0fbb7f7441aa986859a0f53ec93a0335 Mon Sep 17 00:00:00 2001
+From: Randy Dunlap <rdunlap@infradead.org>
+Date: Tue, 21 Feb 2023 23:04:11 -0800
+Subject: swiotlb: mark swiotlb_memblock_alloc() as __init
+
+From: Randy Dunlap <rdunlap@infradead.org>
+
+commit 9b07d27d0fbb7f7441aa986859a0f53ec93a0335 upstream.
+
+swiotlb_memblock_alloc() calls memblock_alloc(), which calls
+(__init) memblock_alloc_try_nid(). However, swiotlb_membloc_alloc()
+can be marked as __init since it is only called by swiotlb_init_remap(),
+which is already marked as __init. This prevents a modpost build
+warning/error:
+
+WARNING: modpost: vmlinux.o: section mismatch in reference: swiotlb_memblock_alloc (section: .text) -> memblock_alloc_try_nid (section: .init.text)
+WARNING: modpost: vmlinux.o: section mismatch in reference: swiotlb_memblock_alloc (section: .text) -> memblock_alloc_try_nid (section: .init.text)
+
+This fixes the build warning/error seen on ARM64, PPC64, S390, i386,
+and x86_64.
+
+Fixes: 8d58aa484920 ("swiotlb: reduce the swiotlb buffer size on allocation failure")
+Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
+Cc: Alexey Kardashevskiy <aik@amd.com>
+Cc: Christoph Hellwig <hch@lst.de>
+Cc: iommu@lists.linux.dev
+Cc: Mike Rapoport <rppt@kernel.org>
+Cc: linux-mm@kvack.org
+Signed-off-by: Christoph Hellwig <hch@lst.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ kernel/dma/swiotlb.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/kernel/dma/swiotlb.c
++++ b/kernel/dma/swiotlb.c
+@@ -324,7 +324,8 @@ static void swiotlb_init_io_tlb_mem(stru
+       return;
+ }
+-static void *swiotlb_memblock_alloc(unsigned long nslabs, unsigned int flags,
++static void __init *swiotlb_memblock_alloc(unsigned long nslabs,
++              unsigned int flags,
+               int (*remap)(void *tlb, unsigned long nslabs))
+ {
+       size_t bytes = PAGE_ALIGN(nslabs << IO_TLB_SHIFT);