hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/release-management/issues/ID3TGE -------------------------------- Due to security, we remove the dump_pagetable interface Fixes: 6215c86ac4fb ("zcopy: Add debug inerface dump_pagetable") Signed-off-by: Liu Mingrui <liumingrui@huawei.com> --- drivers/misc/zcopy/zcopy.c | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/drivers/misc/zcopy/zcopy.c b/drivers/misc/zcopy/zcopy.c index 295519412c1c..a20269a3d843 100644 --- a/drivers/misc/zcopy/zcopy.c +++ b/drivers/misc/zcopy/zcopy.c @@ -38,7 +38,6 @@ enum pgt_entry { enum { IO_ATTACH = 1, - IO_DUMP = 3, IO_MAX }; @@ -50,11 +49,6 @@ struct zcopy_ioctl_pswap { unsigned long size; }; -struct zcopy_ioctl_dump { - unsigned long size; - unsigned long addr; -}; - struct zcopy_cdev { struct cdev chrdev; dev_t dev; @@ -70,7 +64,6 @@ static int (*__zcopy_pmd_alloc)(struct mm_struct *, pud_t *, unsigned long); static int (*__zcopy_pud_alloc)(struct mm_struct *, p4d_t *, unsigned long); static unsigned long (*kallsyms_lookup_name_funcp)(const char *); static void (*zcopy_page_remove_rmap)(struct page *, bool); -static void (*dump_pagetable)(unsigned long addr); static struct kretprobe __kretprobe; @@ -558,18 +551,6 @@ static long zcopy_ioctl(struct file *file, unsigned int type, unsigned long ptr) ctx.src_pid, ctx.size); break; } - case IO_DUMP: - { - struct zcopy_ioctl_dump param; - - if (copy_from_user((void *)¶m, (void *)ptr, - sizeof(struct zcopy_ioctl_dump))) { - ret = -EFAULT; - break; - } - dump_pagetable(param.addr); - break; - } default: break; } @@ -633,11 +614,6 @@ static int register_unexport_func(void) zcopy_page_remove_rmap = (void (*)(struct page *, bool))__kallsyms_lookup_name("page_remove_rmap"); ret = REGISTER_CHECK(zcopy_page_remove_rmap, "page_remove_rmap"); - if (ret) - goto out; - - dump_pagetable = (void (*)(unsigned long))__kallsyms_lookup_name("show_pte"); - ret = REGISTER_CHECK(dump_pagetable, "show_pte"); out: return ret; -- 2.25.1