linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
To: Yang Shi <shy828301@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	"Liam R . Howlett" <Liam.Howlett@oracle.com>,
	Vlastimil Babka <vbabka@suse.cz>, Jann Horn <jannh@google.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Peter Xu <peterx@redhat.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>, Mark Brown <broonie@kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	Andreas Larsson <andreas@gaisler.com>
Subject: Re: [PATCH hotfix 6.12 v3 4/5] mm: refactor arch_validate_flags() and arm64 MTE handling
Date: Tue, 29 Oct 2024 16:21:22 +0000	[thread overview]
Message-ID: <00a06ba2-e9ad-46a8-a3f3-5d4ad9eb1c00@lucifer.local> (raw)
In-Reply-To: <CAHbLzkrvwXOhjbH9pMoJq_-r9nCbwW=HrTnkA3avP2C=7QaMNg@mail.gmail.com>

On Tue, Oct 29, 2024 at 09:08:22AM -0700, Yang Shi wrote:
> On Tue, Oct 29, 2024 at 8:52 AM Lorenzo Stoakes
> <lorenzo.stoakes@oracle.com> wrote:
> >
> > On Tue, Oct 29, 2024 at 08:43:04AM -0700, Yang Shi wrote:
> >
> > >
> > > Sorry for chiming in late. This looks problematic IIUC. The patch 5/5
> > > moved arch_validate_flags() before call_mmap() as the commit log said.
> > > But shmem_file() does this check:
> > > mapping->a_ops == &shmem_aops
> > >
> > > But mapping->a_ops is not initialized until shmem_mmap(), which is
> > > called by call_mmap().
> > >
> > > So shmem_file() should always return false here. Did I miss something?
> >
> > Well firstly this is tested and works so you did miss something :)
> >
> > Bu shmem_mmap() is not setting mapping->a_ops, it's setting vma->vm_ops.
> >
> > __shmem_get_inode() and shmem_symlink() set mapping->a_ops.
>
> My bad, stared at "_ops", but missed "vm" prefix. And shmem_mmap()
> can't touch a_ops. Sorry for the disruption.

No worries, the various ops are quite confusing and precisely where what
happens, I had to double check this myself... :)


  reply	other threads:[~2024-10-29 16:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-29 13:03 [PATCH hotfix 6.12 v3 0/5] fix error handling in mmap_region() and refactor (hotfixes) Lorenzo Stoakes
2024-10-29 13:03 ` [PATCH hotfix 6.12 v3 1/5] mm: avoid unsafe VMA hook invocation when error arises on mmap hook Lorenzo Stoakes
2024-10-29 13:03 ` [PATCH hotfix 6.12 v3 2/5] mm: unconditionally close VMAs on error Lorenzo Stoakes
2024-10-29 13:03 ` [PATCH hotfix 6.12 v3 3/5] mm: refactor map_deny_write_exec() Lorenzo Stoakes
2024-10-29 13:03 ` [PATCH hotfix 6.12 v3 4/5] mm: refactor arch_validate_flags() and arm64 MTE handling Lorenzo Stoakes
2024-10-29 14:38   ` Liam R. Howlett
2024-10-29 15:23   ` Lorenzo Stoakes
2024-10-29 15:43   ` Yang Shi
2024-10-29 15:52     ` Lorenzo Stoakes
2024-10-29 16:08       ` Yang Shi
2024-10-29 16:21         ` Lorenzo Stoakes [this message]
2024-10-29 13:03 ` [PATCH hotfix 6.12 v3 5/5] mm: resolve faulty mmap_region() error path behaviour Lorenzo Stoakes

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=00a06ba2-e9ad-46a8-a3f3-5d4ad9eb1c00@lucifer.local \
    --to=lorenzo.stoakes@oracle.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=andreas@gaisler.com \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=davem@davemloft.net \
    --cc=jannh@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=peterx@redhat.com \
    --cc=shy828301@gmail.com \
    --cc=torvalds@linux-foundation.org \
    --cc=vbabka@suse.cz \
    --cc=will@kernel.org \
    /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