Re: [PATCH RFC v3 2/6] riscv/mm: add untagged_addr_remote_unlocked()

From: Rik van Riel

Date: Mon Jul 20 2026 - 13:35:07 EST


On Mon, 2026-07-20 at 17:46 +0100, Usama Arif wrote:
>
>
> On 20/07/2026 16:08, Rik van Riel wrote:
> > On Mon, 2026-07-20 at 04:57 -0700, Usama Arif wrote:
> > > On Fri, 17 Jul 2026 13:00:32 -0400 Rik van Riel
> > > <riel@xxxxxxxxxxx>
> > > wrote:
> > >
> > >
> > > >
> > > > mm->context.pmlen is set only through PR_SET_TAGGED_ADDR_CTRL
> > > > and
> > > > is stable
> > > > afterwards, so it can be read without the mmap lock, as it
> > > > already
> > > > is from
> > > > untagged_addr() and mm_untag_mask().
> > > >
> > >
> > > I think it might not be stable? set_tagged_addr_ctrl() can change
> > > it
> > > repeatedly until a CLONE_VM operation sets MM_CONTEXT_LOCK_PMLEN.
> >
> > You're right, ARM tagged addresses seem to work a
>
> ah do you mean RISCV here?

Ugh, I looked at the wrong one. RISCV is like
x86, with a dynamic (though a limited number
of options?) mask.

Having said that, won't a process have all of
its VMAs in the masked-off area, so coming in
from a remote process to a valid memory address
should already give us a valid address?

--
All Rights Reversed.