linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Rik van Riel <riel@surriel.com>
To: Edward Adam Davis <eadavis@qq.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,  llvm@lists.linux.dev,
	mike.kravetz@oracle.com, muchun.song@linux.dev,
	 nathan@kernel.org, ndesaulniers@google.com,
	 syzbot+6ada951e7c0f7bc8a71e@syzkaller.appspotmail.com,
	 syzkaller-bugs@googlegroups.com, trix@redhat.com
Subject: Re: [PATCH] mm/hugetlb: fix null ptr defer in hugetlb_vma_lock_write
Date: Thu, 02 Nov 2023 20:56:47 -0400	[thread overview]
Message-ID: <32cb089b2afec5dc3bb96234753cca4b22cb9ccd.camel@surriel.com> (raw)
In-Reply-To: <tencent_164A247533766D667C3D873798968236C409@qq.com>

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.


  parent reply	other threads:[~2023-11-03  0:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-29  9:27 [syzbot] [mm?] general protection fault " syzbot
2023-10-31 18:38 ` Rik van Riel
2023-11-02 12:15   ` Aleksandr Nogikh
2023-11-01  6:36 ` [PATCH] mm/hugetlb: fix null ptr defer " Edward Adam Davis
2023-11-01 14:27   ` Rik van Riel
2023-11-02 12:58     ` Edward Adam Davis
2023-11-02 23:29       ` kernel test robot
2023-11-02 23:29       ` kernel test robot
2023-11-03  0:56       ` Rik van Riel [this message]
2023-11-03  1:26       ` kernel test robot
2023-11-03  2:24       ` Mike Kravetz
2023-11-03  2:28         ` Mike Kravetz
2023-11-03  2:37         ` Mike Kravetz
2023-11-03  3:15           ` Rik van Riel
2023-11-03  4:31             ` Mike Kravetz
2023-11-08  3:22       ` Mike Kravetz
2023-11-02 13:46     ` Yin, Fengwei

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=32cb089b2afec5dc3bb96234753cca4b22cb9ccd.camel@surriel.com \
    --to=riel@surriel.com \
    --cc=akpm@linux-foundation.org \
    --cc=eadavis@qq.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=llvm@lists.linux.dev \
    --cc=mike.kravetz@oracle.com \
    --cc=muchun.song@linux.dev \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=syzbot+6ada951e7c0f7bc8a71e@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=trix@redhat.com \
    /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