- 22 2月, 2022 40 次提交
-
-
由 Hangyu Hua 提交于
mainline inclusion from mainline-v5.17-rc2 commit 29eb3154 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4U4NY CVE: CVE-2022-24959 ------------------------------------------------- ym needs to be free when ym->cmd != SIOCYAMSMCS. Fixes: 0781168e ("yam: fix a missing-check bug") Signed-off-by: NHangyu Hua <hbh25y@gmail.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net> conflict: The bug is in function yam_siocdevprivate() in mainline, but it is in function yam_ioctl() because the function name is changed in 25ec92fb("hamradio: use ndo_siocdevprivate") in mainline. Signed-off-by: NLu Wei <luwei32@huawei.com> Reviewed-by: NYue Haibing <yuehaibing@huawei.com> Reviewed-by: NWei Yongjun <weiyongjun1@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Mao HongBo 提交于
phytium inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I41AUQ -------------------------------------- On phytium S2500 multi-socket server, for example 2-socket(2P), there are socekt0 and socket1 on the server: If storage device(like SAS controller and disks to save vmcore into) is installed on socket1 and second kernel brings up 2 CPUs both on socket0 with nr_cpus=2, then vmcore will fail to be saved into the disk as interrupts like SPI and LPI(except SGI) can't communicate across cpu sockets in this server platform. To avoid this issue, Bypass other non-cpu0 to ensure that each cpu0 on each socket can boot up and handle interrupt when booting the second kernel. Signed-off-by: NMao HongBo <maohongbo@phytium.com.cn> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Acked-by: NXie XiuQi <xiexiuqi@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Mao HongBo 提交于
phytium inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I41AUQ CVE: NA -------------------------------- Add support for kdump vmcore generation for phytium S2500 platform. Signed-off-by: NMao HongBo <maohongbo@phytium.com.cn> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Acked-by: NXie XiuQi <xiexiuqi@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Wang Yinfeng 提交于
phytium inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4RK58 CVE: NA -------------------------------- The system would hang up when the Phytium S2500 communicates with some BMCs after several rounds of transactions, unless we reset the controller timeout counter manually by calling firmware through SMC. Signed-off-by: NWang Yinfeng <wangyinfeng@phytium.com.cn> Signed-off-by: Chen Baozi <chenbaozi@phytium.com.cn> #openEuler_contributor Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com> Reviewed-by: NXie XiuQi <xiexiuqi@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Acked-by: NXie XiuQi <xiexiuqi@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Mao HongBo 提交于
phytium inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I41AUQ ---------------------------------------------- To fix iommu issue of device access in virtualization scenario for ft2000plus and S2500. Convert to new cputype macros naming of phytium. Signed-off-by: NMao HongBo <maohongbo@phytium.com.cn> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Acked-by: NXie XiuQi <xiexiuqi@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Gu Zitao 提交于
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SPZD CVE: NA ------------------------------- The sunway iommu driver is compatible with the notion of a type-1 IOMMU in VFIO. This patch allows VFIO_IOMMU_TYPE1 to be selected if SW64=y. Signed-off-by: Gu Zitao <guzitao@wxiat.com> #openEuler_contributor Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Gu Zitao 提交于
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SPZD CVE: NA ------------------------------- Signed-off-by: Gu Zitao <guzitao@wxiat.com> #openEuler_contributor Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Gu Zitao 提交于
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SPZD CVE: NA ------------------------------- Implement controller memory operation hook function. Support transmit and receive mode. Signed-off-by: Gu Zitao <guzitao@wxiat.com> #openEuler_contributor Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Gu Zitao 提交于
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SPZD CVE: NA ------------------------------- With this support, it can enable kvm guest rtc sync. Signed-off-by: Gu Zitao <guzitao@wxiat.com> #openEuler_contributor Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Gu Zitao 提交于
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SPZD CVE: NA ------------------------------- Signed-off-by: Gu Zitao <guzitao@wxiat.com> #openEuler_contributor Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Gu Zitao 提交于
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SPZD CVE: NA ------------------------------- LPC bridge function of the chip3 provides support for System Management Bus and General Purpose I/O. Signed-off-by: Gu Zitao <guzitao@wxiat.com> #openEuler_contributor Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Gu Zitao 提交于
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SPZD CVE: NA ------------------------------- The node id of hose is used to denote topological physical id of PCI host bridge, however one may start up the machine by command line 'numa=off' to switch off NUMA system, and this case may raise exception on the node id passed to alloc_pages_node, so let's use dev_to_node(dev) instead and ensure the correctness of the parameter passed in. Signed-off-by: Gu Zitao <guzitao@wxiat.com> #openEuler_contributor Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Gu Zitao 提交于
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SPZD CVE: NA ------------------------------- This adds an IOMMU API implementation for sw64 PCI devices. Signed-off-by: Gu Zitao <guzitao@wxiat.com> #openEuler_contributor Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Gu Zitao 提交于
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SPZD CVE: NA ------------------------------- It causes kernel to crash when loading AST video card driver on sw64 arch showing as follows: ast 0000:0c:00.0: [drm] fb0: astdrmfb frame buffer device Unable to handle kernel paging request at virtual address fff08d00e0000000 CPU 0 kworker/0:2(370): Oops 1 pc = [<ffffffff81086560>] ra = [<ffffffff811f475c>] ps = 0000 Not tainted pc is at memcpy+0xa0/0x260 ra is at drm_fb_helper_dirty_work+0x18c/0x2c0 v0 = fff08d00e0000000 t0 = 0000000000000000 t1 = 0000000000001000 t2 = 0000000000000000 t3 = fff000010730fd60 t4 = 0000000000000001 t5 = 0000000000000004 t6 = fff08d00e0000040 t7 = fff000010730c000 s0 = fff0000107a218d0 s1 = fffff0000d05a000 s2 = fff00001079e1400 s3 = 0000000000001000 s4 = fff08d00e0000000 s5 = 0000000000000000 s6 = fff000010730fdc8 a0 = fff08d00e0000000 a1 = fffff0000d05a000 a2 = 0000000000001000 a3 = fff000400690ce20 a4 = 0000000000000001 a5 = 0000000000000000 t8 = fff00001079e8740 t9 = fff000400690c800 t10 = fffff7f0800d1800 t11= 000000000000b940 pv = ffffffff810864c0 at = 0000000000000000 gp = ffffffff8211b170 sp = (____ptrval____) Disabling lock debugging due to kernel taint Trace: [<ffffffff819833c8>] ww_mutex_unlock+0x38/0x70 [<ffffffff811ce054>] drm_gem_vram_vmap+0x114/0x1e0 [<ffffffff811ce144>] drm_gem_vram_object_vmap+0x24/0x70 [<ffffffff811f46c0>] drm_fb_helper_dirty_work+0xf0/0x2c0 [<ffffffff8097a500>] process_one_work+0x280/0x5d0 [<ffffffff8097a8c0>] worker_thread+0x70/0x7c0 [<ffffffff8098638c>] kthread+0x1fc/0x210 [<ffffffff8097a850>] worker_thread+0x0/0x7c0 [<ffffffff809862d8>] kthread+0x148/0x210 [<ffffffff80911738>] ret_from_kernel_thread+0x18/0x20 [<ffffffff80986190>] kthread+0x0/0x210 The backtrace indicates that the shadow framebuffer copy in drm_fb_helper_dirty_blit_real() should access the real framebuffer using an IO access typically implemented using a physical (ASI_PHYS) access on sw64, so let's fix it. Signed-off-by: Gu Zitao <guzitao@wxiat.com> #openEuler_contributor Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Gu Zitao 提交于
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SPZD CVE: NA ------------------------------- Driver codes of the direct calls, via the SIMD-optimized memset and memcpy functions, may raise dfault under sw64 architecture, so work around 'memset' references to '_memset_c_io' calls. Signed-off-by: Gu Zitao <guzitao@wxiat.com> #openEuler_contributor Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Gu Zitao 提交于
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SPZD CVE: NA ------------------------------- It causes kernel to crash when loading AMD video card driver on sw64 arch showing as follows: Unable to handle kernel paging request at virtual address 0000000000000060 CPU 0 kworker/0:1(56): Oops 0 pc = [<ffffffff809a4b14>] ra = [<ffffffff80923440>] ps = 0000 Not tainted pc is at up_read+0x14/0x80 ra is at do_page_fault+0x380/0x610 v0 = 0000000000000000 t0 = 0000000000000001 t1 = 0000000000000001 t2 = fff0000fd8bbf000 t3 = 0000000000000060 t4 = 00038c3001804009 t5 = 0000002000038d30 t6 = fff0888000040080 t7 = fff0000fd8e48000 s0 = fff0000fd1df8000 s1 = fff0888000040000 s2 = 0000000000000001 s3 = 0000000000000000 s4 = 0000000000000007 s5 = 0000000000000060 s6 = fff0000fd8e4ba60 a0 = 0000000000000060 a1 = 0000000000000000 a2 = 0000000000000001 a3 = fff0000fd8e4ba60 a4 = 0000000000000000 a5 = 0000000000000177 t8 = 0000000000000029 t9 = ffffffff82974bc0 t10= 0000000000000000 t11= 0000000000000178 pv = ffffffff809a4b00 at = 0000000000000007 gp = ffffffff82944bc0 sp = (____ptAMD video card driver on sw_64 arch show as follows: Disabling lock debugging due to kernel taint Trace: [<ffffffff80923440>] do_page_fault+0x380/0x610 [<ffffffff80910f70>] entMM+0x90/0xc0 [<ffffffff813da9bc>] dev_printk_emit+0x4c/0x60 [<ffffffff81189180>] radeon_uvd_resume+0x40/0xa0 [<ffffffff81a56eb0>] memcpy+0x0/0x2f0 [<ffffffff81a56fb0>] memcpy+0x100/0x2f0 [<ffffffff81121e04>] cik_startup+0x3a64/0x3c70 It's the reason that we use SIMD intruction to implement memset/memcpy hooks, which will cause some problems on I/O memory. Sigh, let's correct it. Signed-off-by: Gu Zitao <guzitao@wxiat.com> #openEuler_contributor Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Gu Zitao 提交于
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SPZD CVE: NA ------------------------------- KFD has been verified to function on SW64 systems(SW3231). It should be available as a kernel configuration option on these systems. Signed-off-by: Gu Zitao <guzitao@wxiat.com> #openEuler_contributor Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Gu Zitao 提交于
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SPZD CVE: NA ------------------------------- On SUBARCH_C3B, when using the original driver for LSI MegaRAID SAS-3 PCIe card, a kernel panic may arise from accessing an illegal address. Make some changes for SUBARCH_C3B to avoid it. But it may not be avoided entirely. Signed-off-by: Gu Zitao <guzitao@wxiat.com> #openEuler_contributor Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Gu Zitao 提交于
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SPZD CVE: NA ------------------------------- Signed-off-by: Gu Zitao <guzitao@wxiat.com> #openEuler_contributor Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Gu Zitao 提交于
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SPZD CVE: NA ------------------------------- This patch adds sw64 arch-specific SMBIOS/DMI driver codes, and adds EFI runtime driver codes to allow kernel to access various EFI runtime services provided by EFI firmware. Things like reboot, real time clock, EFI boot variables, and others, however, due to lack of BIOS's efi mmap support, these services have not been implemented, we will fix them in the near future. Signed-off-by: Gu Zitao <guzitao@wxiat.com> #openEuler_contributor Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Gu Zitao 提交于
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SPZD CVE: NA ------------------------------- Signed-off-by: Gu Zitao <guzitao@wxiat.com> #openEuler_contributor Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Gu Zitao 提交于
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SPZD CVE: NA ------------------------------- As we want to get ACPI tables to parse and then use the information for system initialization, we should get the RSDP (Root System Description Pointer) first, it then locates Extended Root Description Table (XSDT) which contains all the 64-bit physical address that pointer to other boot-time tables. Signed-off-by: Gu Zitao <guzitao@wxiat.com> #openEuler_contributor Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Gu Zitao 提交于
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SPZD CVE: NA ------------------------------- Add perf support for hardware events with CPU PMU, and add more user utils and features. Signed-off-by: Gu Zitao <guzitao@wxiat.com> #openEuler_contributor Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Gu Zitao 提交于
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SPZD CVE: NA ------------------------------- Signed-off-by: Gu Zitao <guzitao@wxiat.com> #openEuler_contributor Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Gu Zitao 提交于
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SPZD CVE: NA ------------------------------- Add KVM_SW64_VCPU_INIT definition for SW64 vcpu init. Introduce KVM_SW64_GET_VCB and KVM_SW64_SET_VCB definitions to save and restore vcpu's context for hot-snapshot. Signed-off-by: Gu Zitao <guzitao@wxiat.com> #openEuler_contributor Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Gu Zitao 提交于
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SPZD CVE: NA ------------------------------- This patch fixes compile failure for sw64 architecture. More details about the issue in commit 91d35dd9 ("moduleparam: fix alpha, ia64 and ppc64 compile failures"). Signed-off-by: Gu Zitao <guzitao@wxiat.com> #openEuler_contributor Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Gu Zitao 提交于
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SPZD CVE: NA ------------------------------- Add KEXEC_ARCH_SW_64 definition for kdump/kexec function. Signed-off-by: Gu Zitao <guzitao@wxiat.com> #openEuler_contributor Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Gu Zitao 提交于
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SPZD CVE: NA ------------------------------- Add AUDIT_ARCH_SW64 definition to support syscall_get_arch(), which is required to be implemented on all architectures in order to extend the generic ptrace API with PTRACE_GET_SYSCALL_INFO request. Signed-off-by: Gu Zitao <guzitao@wxiat.com> #openEuler_contributor Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Gu Zitao 提交于
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SPZD CVE: NA ------------------------------- In order to implement ftrace on sw64 architecture, add sw64 support to recordmcount. Signed-off-by: Gu Zitao <guzitao@wxiat.com> #openEuler_contributor Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Gu Zitao 提交于
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SPZD CVE: NA ------------------------------- In order to support build deb package on sw64 architecture, add sw_64 case. Signed-off-by: Gu Zitao <guzitao@wxiat.com> #openEuler_contributor Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Gu Zitao 提交于
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SPZD CVE: NA ------------------------------- This patch contains basic architecture support, including boot code, devicetree support, memory management and DMA support, process and signal management, time management, interrupt handling, syscalls, clocks, loadable module support, ptrace support, headers and library code. Now, it works on SW3231 and SW831. Signed-off-by: Gu Zitao <guzitao@wxiat.com> #openEuler_contributor Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Jingxian He 提交于
euleros inclusion category: feature bugzilla:https://gitee.com/openeuler/kernel/issues/I4UCEQ CVE: NA ------------ When the pinmemory setting string is null, return directly without setting pinmemory addr. Signed-off-by: NJingxian He <hejingxian@huawei.com> Reviewed-by: NKefeng Wang <wangkefeng.wang@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Zheng Yejian 提交于
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4UAQ1 -------------------------------- Refer to following codes, 'strncpy' would stop copying if Null character encountered. For example, when 'code' is "53 be 00 0a 05", 'old_code' would be "53 be 00 00 00". > 396 static void *klp_old_code(unsigned char *code) > 397 { > 398 static unsigned char old_code[JMP_E9_INSN_SIZE]; > 399 > 400 strncpy(old_code, code, JMP_E9_INSN_SIZE); > 401 return old_code; > 402 } As a result, the instructions cannot be restored completely, and the system becomes abnormal. Fixes: f5a67467 ("livepatch/x86: support livepatch without ftrace") Suggested-by: NXu Kuohai <xukuohai@huawei.com> Signed-off-by: NZheng Yejian <zhengyejian1@huawei.com> Reviewed-by: NKuohai Xu <xukuohai@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Zheng Yejian 提交于
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4UAQ1 -------------------------------- There are several issues in klp_mem_{prepare,recycle}: 1. Memory leak when save old codes fail: __klp_enable_patch klp_mem_prepare klp_for_each_func(patch) func->func_node = kzalloc(...) <-- 1. Alloc memory stop_machine(klp_try_enable_patch, ...) enable_patch arch_klp_patch_func INIT_LIST_HEAD(&func_node->func_stack); <-- 2. func_stack list inited as empty copy_from_kernel_nofault <-- 3. When save codes fail klp_mem_recycle klp_for_each_func(patch) <-- 4. Here func_stack list is empty but not singular, 'func_node' not be freed!!! if (func_node && list_is_singular(&func_node->func_stack)) kfree(func_node); 2. Memory leak in following scene: Suppose P1/P2 want to patch same old func, then enable P1 --> enable P2 --> disable P2 --> disable P1 3. UAF(use-after-free) happened in following scene: Suppose P1/P2 want to patch same old func, then enable P1 --> enable P2 --> disable P1 --> disable P2 Above problems are introduced in commit ec7ce700674f ("[Huawei] livepatch: put memory alloc and free out stop machine"): before it: 'func_node' is only keep in 'klp_func_list'; after it: 'func_node' is keep both in 'klp_func_list' and 'struct klp_func', and conditions to free memory of 'func_node' somewhat wrong. To resolve it, we add check and do func_node init when klp_mem_prepare. Fixes: ("000c0197 livepatch: put memory alloc and free out stop machine") Signed-off-by: NZheng Yejian <zhengyejian1@huawei.com> Reviewed-by: NKuohai Xu <xukuohai@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Zheng Yejian 提交于
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4UAQ1 -------------------------------- Introduce 'arch_klp_save_old_code' preparing for moving func_node initializing codes out of stop_machine. Signed-off-by: NZheng Yejian <zhengyejian1@huawei.com> Reviewed-by: NKuohai Xu <xukuohai@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Zheng Yejian 提交于
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4UAQ1 -------------------------------- Introduce __weak arch_klp_mem_{alloc, free}, then reduce duplicated arch_klp_mem_{prepare,recycle} Signed-off-by: NZheng Yejian <zhengyejian1@huawei.com> Reviewed-by: NKuohai Xu <xukuohai@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Zheng Yejian 提交于
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4UAQ1 -------------------------------- Move 'struct klp_func_node' into include/linux/livepatch.h, then introduce klp_{add,del}_func_node and Move 'klp_func_list' related codes out of 'arch' in order to reduce duplicated codes. Preparatory only, no functional change. Signed-off-by: NZheng Yejian <zhengyejian1@huawei.com> Reviewed-by: NKuohai Xu <xukuohai@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Zheng Yejian 提交于
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4UAQ1 -------------------------------- Introduce 'struct arch_klp_data' to encapsulate arch related data. Preparatory for moving 'struct klp_func_node' out of 'arch' and reducing duplicated codes. Signed-off-by: NZheng Yejian <zhengyejian1@huawei.com> Reviewed-by: NKuohai Xu <xukuohai@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Zheng Yejian 提交于
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4UAQ1 -------------------------------- 'struct klp_func_node' is used to save codes of a function which is then be live-patched. Currently this structure is respectively defined in x86/arm32/arm64/ppc32/ppc64. The definitions of field which save old function address are different: In x86/arm32/ppc32/ppc64: void *old_func; In arm64: unsigned long old_addr; Minority subordinates to majority, uniform them as 'void *old_func'. Preparatory only, no functional change. Signed-off-by: NZheng Yejian <zhengyejian1@huawei.com> Reviewed-by: NKuohai Xu <xukuohai@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Liguang Zhang 提交于
mainline inclusion from mainline-v5.14-rc1 commit 114e4337 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4UACK CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=114e43371c58992c3ceece219cc359f16314b2c9 ----------------------------------------------------------------------- In DSDT table, TPM _CID was SMO0768, and no _HID definition. After a kernel upgrade from 4.19 to 5.10, TPM probe function was changed which causes device probe fails. In order to make newer kernel to be compatible with the older acpi definition, it would be best set default probe function. Signed-off-by: NLiguang Zhang <zhangliguang@linux.alibaba.com> Reviewed-by: NJarkko Sakkinen <jarkko@kernel.org> Signed-off-by: NJarkko Sakkinen <jarkko@kernel.org> Signed-off-by: NJiefeng Ou <oujiefeng@h-partners.com> Reviewed-by: NYicong Yang <yangyicong@huawei.com> Reviewed-by: NJay Fang <f.fangjian@huawei.com> Acked-by: Xinwei Kong<kong.kongxinwei@hisilicon.com> Acked-by: NXie XiuQi <xiexiuqi@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-