[<prev] [next>] [day] [month] [year] [list]
Message-ID: <32cb089b2afec5dc3bb96234753cca4b22cb9ccd.camel@surriel.com>
Date: Thu, 02 Nov 2023 20:56:47 -0400
From: Rik van Riel <riel@...riel.com>
To: Edward Adam Davis <eadavis@...com>
Cc: akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, llvm@...ts.linux.dev, mike.kravetz@...cle.com,
muchun.song@...ux.dev, nathan@...nel.org, ndesaulniers@...gle.com,
syzbot+6ada951e7c0f7bc8a71e@...kaller.appspotmail.com,
syzkaller-bugs@...glegroups.com, trix@...hat.com
Subject: Re: [PATCH] mm/hugetlb: fix null ptr defer in hugetlb_vma_lock_write
On Thu, 2023-11-02 at 20:58 +0800, Edward Adam Davis wrote:
>
> +++ b/include/linux/hugetlb.h
>
> +#define HPAGE_RESV_OWNER (1UL << 0)
> static inline bool __vma_private_lock(struct vm_area_struct *vma)
> {
> - return (!(vma->vm_flags & VM_MAYSHARE)) && vma-
> >vm_private_data;
> + return (!(vma->vm_flags & VM_MAYSHARE)) && vma-
> >vm_private_data &&
> + is_vma_resv_set(vma, HPAGE_RESV_OWNER);
> }
>
> /*
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 1301ba7b2c9a..97ea782dfba6 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -1033,7 +1033,6 @@ __weak unsigned long vma_mmu_pagesize(struct
> vm_area_struct *vma)
> * bits of the reservation map pointer, which are always clear due
> to
> * alignment.
> */
> -#define HPAGE_RESV_OWNER (1UL << 0)
> #define HPAGE_RESV_UNMAPPED (1UL << 1)
> #define HPAGE_RESV_MASK (HPAGE_RESV_OWNER | HPAGE_RESV_UNMAPPED)
>
Moving just that one define is less than ideal, and the
kernel test robot seems unhappy, too.
It may be cleaner to just move __vma_private_lock into
hugetlb.c, where it has all the dependencies it needs.
It isn't being called from anywhere else, anyway.
Hopefully that will keep the kernel test robot happy, too :)
--
All Rights Reversed.
Powered by blists - more mailing lists