Messages in this thread | | | Subject | Re: [PATCH 5/8] membarrier, kthread: Use _ONCE accessors for task->mm | From | Andy Lutomirski <> | Date | Wed, 16 Jun 2021 11:45:44 -0700 |
| |
On 6/16/21 11:08 AM, Mathieu Desnoyers wrote: > ----- On Jun 15, 2021, at 11:21 PM, Andy Lutomirski luto@kernel.org wrote: > >> membarrier reads cpu_rq(remote cpu)->curr->mm without locking. Use >> READ_ONCE() and WRITE_ONCE() to remove the data races. > > I notice that kernel/exit.c:exit_mm() also has: > > current->mm = NULL; > > I suspect you may want to add a WRITE_ONCE() there as well ?
Good catch. I was thinking that exit_mm() couldn't execute concurrently with membarrier(), but that's wrong.
--Andy
| |