From: kernel test robot <lkp@intel.com>
To: Mingyu Wang <25181214217@stu.xidian.edu.cn>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: Re: [RFC PATCH] mm/hugetlb: fix resv_map memory leak in __mmap_region error path
Date: Sat, 2 May 2026 06:14:37 +0800 [thread overview]
Message-ID: <202605020645.8318Xwwx-lkp@intel.com> (raw)
In-Reply-To: <20260425070700.562229-1-25181214217@stu.xidian.edu.cn>
Hi Mingyu,
[This is a private test report for your RFC patch.]
kernel test robot noticed the following build errors:
[auto build test ERROR on akpm-mm/mm-everything]
url: https://github.com/intel-lab-lkp/linux/commits/Mingyu-Wang/mm-hugetlb-fix-resv_map-memory-leak-in-__mmap_region-error-path/20260425-203812
base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link: https://lore.kernel.org/r/20260425070700.562229-1-25181214217%40stu.xidian.edu.cn
patch subject: [RFC PATCH] mm/hugetlb: fix resv_map memory leak in __mmap_region error path
config: hexagon-allnoconfig (https://download.01.org/0day-ci/archive/20260502/202605020645.8318Xwwx-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 5bac06718f502014fade905512f1d26d578a18f3)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260502/202605020645.8318Xwwx-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605020645.8318Xwwx-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from mm/vma.c:7:
In file included from mm/vma_internal.h:12:
In file included from include/linux/backing-dev.h:13:
In file included from include/linux/fs.h:5:
In file included from include/linux/fs/super.h:5:
In file included from include/linux/fs/super_types.h:7:
In file included from include/linux/list_lru.h:14:
In file included from include/linux/xarray.h:16:
In file included from include/linux/gfp.h:7:
In file included from include/linux/mmzone.h:22:
include/linux/mm_types.h:865:28: warning: declaration of 'struct vm_area_desc' will not be visible outside of this function [-Wvisibility]
865 | void (*abort_hook)(struct vm_area_desc *desc);
| ^
>> mm/vma.c:2805:26: error: incompatible pointer types passing 'struct vm_area_desc *' to parameter of type 'struct vm_area_desc *' [-Wincompatible-pointer-types]
2805 | desc.action.abort_hook(&desc);
| ^~~~~
1 warning and 1 error generated.
vim +2805 mm/vma.c
2731
2732 static unsigned long __mmap_region(struct file *file, unsigned long addr,
2733 unsigned long len, vma_flags_t vma_flags,
2734 unsigned long pgoff, struct list_head *uf)
2735 {
2736 struct mm_struct *mm = current->mm;
2737 struct vm_area_struct *vma = NULL;
2738 bool have_mmap_prepare = file && file->f_op->mmap_prepare;
2739 VMA_ITERATOR(vmi, mm, addr);
2740 MMAP_STATE(map, mm, &vmi, addr, len, pgoff, vma_flags, file);
2741 struct vm_area_desc desc = {
2742 .mm = mm,
2743 .file = file,
2744 .action = {
2745 .type = MMAP_NOTHING, /* Default to no further action. */
2746 },
2747 };
2748 bool allocated_new = false;
2749 int error;
2750
2751 map.check_ksm_early = can_set_ksm_flags_early(&map);
2752
2753 error = __mmap_setup(&map, &desc, uf);
2754 if (!error && have_mmap_prepare)
2755 error = call_mmap_prepare(&map, &desc);
2756 if (error)
2757 goto abort_munmap;
2758
2759 if (map.check_ksm_early)
2760 update_ksm_flags(&map);
2761
2762 /* Attempt to merge with adjacent VMAs... */
2763 if (map.prev || map.next) {
2764 VMG_MMAP_STATE(vmg, &map, /* vma = */ NULL);
2765
2766 vma = vma_merge_new_range(&vmg);
2767 }
2768
2769 /* ...but if we can't, allocate a new VMA. */
2770 if (!vma) {
2771 error = __mmap_new_vma(&map, &vma, &desc.action);
2772 if (error)
2773 goto unacct_error;
2774 allocated_new = true;
2775 }
2776
2777 if (have_mmap_prepare)
2778 set_vma_user_defined_fields(vma, &map);
2779
2780 __mmap_complete(&map, vma);
2781
2782 if (have_mmap_prepare && allocated_new) {
2783 error = mmap_action_complete(vma, &desc.action,
2784 /*is_compat=*/false);
2785 if (error)
2786 return error;
2787 }
2788
2789 return addr;
2790
2791 /* Accounting was done by __mmap_setup(). */
2792 unacct_error:
2793 if (map.charged)
2794 vm_unacct_memory(map.charged);
2795 abort_munmap:
2796 /*
2797 * This indicates that .mmap_prepare has set a new file, differing from
2798 * desc->vm_file. But since we're aborting the operation, only the
2799 * original file will be cleaned up. Ensure we clean up both.
2800 */
2801 if (map.file_doesnt_need_get)
2802 fput(map.file);
2803
2804 if (have_mmap_prepare && desc.action.abort_hook)
> 2805 desc.action.abort_hook(&desc);
2806
2807 vms_abort_munmap_vmas(&map.vms, &map.mas_detach);
2808 return error;
2809 }
2810
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
prev parent reply other threads:[~2026-05-01 22:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260425070700.562229-1-25181214217@stu.xidian.edu.cn>
2026-05-01 22:03 ` [RFC PATCH] mm/hugetlb: fix resv_map memory leak in __mmap_region error path kernel test robot
2026-05-01 22:14 ` kernel test robot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202605020645.8318Xwwx-lkp@intel.com \
--to=lkp@intel.com \
--cc=25181214217@stu.xidian.edu.cn \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox