From b5179fe74978c6a2afeebfcc36a8c38d731b4cea Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 20 Feb 2023 12:50:22 +0100 Subject: [PATCH] 5.4-stable patches added patches: iommu-amd-pass-gfp-flags-to-iommu_map_page-in-amd_iommu_map.patch net-sched-sch-fix-off-by-one-in-htb_activate_prios.patch --- ...s-to-iommu_map_page-in-amd_iommu_map.patch | 35 +++++++++++++++++++ ...fix-off-by-one-in-htb_activate_prios.patch | 33 +++++++++++++++++ queue-5.4/series | 2 ++ 3 files changed, 70 insertions(+) create mode 100644 queue-5.4/iommu-amd-pass-gfp-flags-to-iommu_map_page-in-amd_iommu_map.patch create mode 100644 queue-5.4/net-sched-sch-fix-off-by-one-in-htb_activate_prios.patch diff --git a/queue-5.4/iommu-amd-pass-gfp-flags-to-iommu_map_page-in-amd_iommu_map.patch b/queue-5.4/iommu-amd-pass-gfp-flags-to-iommu_map_page-in-amd_iommu_map.patch new file mode 100644 index 00000000000..dabc25c73a6 --- /dev/null +++ b/queue-5.4/iommu-amd-pass-gfp-flags-to-iommu_map_page-in-amd_iommu_map.patch @@ -0,0 +1,35 @@ +From 3057fb9377eb5e73386dd0d8804bf72bdd23e391 Mon Sep 17 00:00:00 2001 +From: Joerg Roedel +Date: Fri, 18 Oct 2019 11:00:33 +0200 +Subject: iommu/amd: Pass gfp flags to iommu_map_page() in amd_iommu_map() + +From: Joerg Roedel + +commit 3057fb9377eb5e73386dd0d8804bf72bdd23e391 upstream. + +A recent commit added a gfp parameter to amd_iommu_map() to make it +callable from atomic context, but forgot to pass it down to +iommu_map_page() and left GFP_KERNEL there. This caused +sleep-while-atomic warnings and needs to be fixed. + +Reported-by: Qian Cai +Reported-by: Dan Carpenter +Fixes: 781ca2de89ba ("iommu: Add gfp parameter to iommu_ops::map") +Reviewed-by: Jerry Snitselaar +Signed-off-by: Joerg Roedel +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iommu/amd_iommu.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/iommu/amd_iommu.c ++++ b/drivers/iommu/amd_iommu.c +@@ -3114,7 +3114,7 @@ static int amd_iommu_map(struct iommu_do + prot |= IOMMU_PROT_IW; + + mutex_lock(&domain->api_lock); +- ret = iommu_map_page(domain, iova, paddr, page_size, prot, GFP_KERNEL); ++ ret = iommu_map_page(domain, iova, paddr, page_size, prot, gfp); + mutex_unlock(&domain->api_lock); + + domain_flush_np_cache(domain, iova, page_size); diff --git a/queue-5.4/net-sched-sch-fix-off-by-one-in-htb_activate_prios.patch b/queue-5.4/net-sched-sch-fix-off-by-one-in-htb_activate_prios.patch new file mode 100644 index 00000000000..4b6eba20bbe --- /dev/null +++ b/queue-5.4/net-sched-sch-fix-off-by-one-in-htb_activate_prios.patch @@ -0,0 +1,33 @@ +From 9cec2aaffe969f2a3e18b5ec105fc20bb908e475 Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Mon, 6 Feb 2023 16:18:32 +0300 +Subject: net: sched: sch: Fix off by one in htb_activate_prios() + +From: Dan Carpenter + +commit 9cec2aaffe969f2a3e18b5ec105fc20bb908e475 upstream. + +The > needs be >= to prevent an out of bounds access. + +Fixes: de5ca4c3852f ("net: sched: sch: Bounds check priority") +Signed-off-by: Dan Carpenter +Reviewed-by: Simon Horman +Reviewed-by: Kees Cook +Link: https://lore.kernel.org/r/Y+D+KN18FQI2DKLq@kili +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/sched/sch_htb.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/sched/sch_htb.c ++++ b/net/sched/sch_htb.c +@@ -407,7 +407,7 @@ static void htb_activate_prios(struct ht + while (m) { + unsigned int prio = ffz(~m); + +- if (WARN_ON_ONCE(prio > ARRAY_SIZE(p->inner.clprio))) ++ if (WARN_ON_ONCE(prio >= ARRAY_SIZE(p->inner.clprio))) + break; + m &= ~(1 << prio); + diff --git a/queue-5.4/series b/queue-5.4/series index 482838f4825..34a33bde4fb 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -152,3 +152,5 @@ i40e-add-checking-for-null-for-nlmsg_find_attr.patch kvm-initialize-all-of-the-kvm_debugregs-structure-before-sending-it-to-userspace.patch nilfs2-fix-underflow-in-second-superblock-position-calculations.patch asoc-sof-intel-hda-dai-fix-possible-stream_tag-leak.patch +net-sched-sch-fix-off-by-one-in-htb_activate_prios.patch +iommu-amd-pass-gfp-flags-to-iommu_map_page-in-amd_iommu_map.patch -- 2.47.3