From: LeoLiu-oc LeoLiu-oc@zhaoxin.com
zhaoxin inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I40QDN CVE: NA
----------------------------------------------------------------
Fix some clerical mistakes in previous patch.
Fixes: 4d79e0478e4d ("USB:Fix kernel NULL pointer when unbind UHCI form vfio-pci") Signed-off-by: LeoLiu-oc LeoLiu-oc@zhaoxin.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com Reviewed-by: Xie XiuQi xiexiuqi@huawei.com --- drivers/usb/core/hcd-pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c index 000ee7a6731f..bbf9bd2d4b08 100644 --- a/drivers/usb/core/hcd-pci.c +++ b/drivers/usb/core/hcd-pci.c @@ -67,8 +67,8 @@ static void for_each_companion(struct pci_dev *pdev, struct usb_hcd *hcd, continue;
if (strncmp(drv->name, "uhci_hcd", sizeof("uhci_hcd") - 1) && - strncmp(drv->name, "ooci_hcd", sizeof("uhci_hcd") - 1) && - strncmp(drv->name, "ehci_hcd", sizeof("uhci_hcd") - 1)) + strncmp(drv->name, "ohci-pci", sizeof("ohci-pci") - 1) && + strncmp(drv->name, "ehci-pci", sizeof("ehci-pci") - 1)) continue;
/*
From: "Liang Li (Euler)" liliang889@huawei.com
virt inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I401IF CVE: NA
------------------------------
When CONFIG_IOMMU_API is off, kernel compile failed with below error:
... LD vmlinux.o drivers/of/platform.o: In function `iommu_bind_guest_msi': platform.c:(.text+0x9e): multiple definition of `iommu_bind_guest_msi' drivers/of/device.o:device.c:(.text+0x122): first defined here .../repo/srcs/kernel/Makefile:1178: recipe for target 'vmlinux' failed ...
This should be a typo introduced by commit 9db83ab7c29. Simply correct the stub function to be 'static inline' in header file should be good enough.
Signed-off-by: Liang Li (Euler) liliang889@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com Reviewed-by: Kunkun Jiang jiangkunkun@huawei.com Reviewed-by: Hanjun Guo guohanjun@huawei.com --- include/linux/iommu.h | 1 + 1 file changed, 1 insertion(+)
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index f0e2c1f5d143..d899e7a5f234 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -1206,6 +1206,7 @@ iommu_sva_bind_group(struct iommu_group *group, struct mm_struct *mm, return NULL; }
+static inline int iommu_bind_guest_msi(struct iommu_domain *domain, dma_addr_t giova, phys_addr_t gpa, size_t size) {
From: "Paul E. McKenney" paulmck@kernel.org
mainline inclusion from mainline-v5.11-rc1 commit 50edb988534c621a56ca103c0c16ac59e7399f01 category: bugfix bugzilla: 176017 CVE: NA
-------------------------------------------------------------------------
It turns out that init_srcu_struct() can be invoked from usermode tasks, and that fatal signals received by these tasks can cause memory-allocation failures. These failures are not handled well by init_srcu_struct(), so much so that NULL pointer dereferences can result. This commit therefore causes init_srcu_struct() to take an early exit upon detection of memory-allocation failure.
Link: https://lore.kernel.org/lkml/20200908144306.33355-1-aik@ozlabs.ru/ Reported-by: Alexey Kardashevskiy aik@ozlabs.ru Tested-by: Alexey Kardashevskiy aik@ozlabs.ru Signed-off-by: Paul E. McKenney paulmck@kernel.org Signed-off-by: Zhen Lei thunder.leizhen@huawei.com Reviewed-by: Xie XiuQi xiexiuqi@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- kernel/rcu/srcutree.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c index c13348ee80a5..6f7880acfdd5 100644 --- a/kernel/rcu/srcutree.c +++ b/kernel/rcu/srcutree.c @@ -177,11 +177,13 @@ static int init_srcu_struct_fields(struct srcu_struct *ssp, bool is_static) INIT_DELAYED_WORK(&ssp->work, process_srcu); if (!is_static) ssp->sda = alloc_percpu(struct srcu_data); + if (!ssp->sda) + return -ENOMEM; init_srcu_struct_nodes(ssp, is_static); ssp->srcu_gp_seq_needed_exp = 0; ssp->srcu_last_gp_end = ktime_get_mono_fast_ns(); smp_store_release(&ssp->srcu_gp_seq_needed, 0); /* Init done. */ - return ssp->sda ? 0 : -ENOMEM; + return 0; }
#ifdef CONFIG_DEBUG_LOCK_ALLOC