Re: git: 76ff03aef741 - main - powerpc: Fix copyin/copyout race condition

Brandon Bergren bdragon at FreeBSD.org
Wed Dec 30 22:53:45 UTC 2020


Note: This commit series is stuff salvaged from jhibbits' local tree. Apologies for the malformed commit messages, Piotr and I were discussing them in IRC earlier and I was under the mistaken assumption that they would get reworded before the push.

On Wed, Dec 30, 2020, at 4:45 PM, Piotr Kubaj wrote:
> The branch main has been updated by pkubaj (ports committer):
> 
> URL: 
> https://cgit.FreeBSD.org/src/commit/?id=76ff03aef7411e601673dfc997bd6d691bd9a14e
> 
> commit 76ff03aef7411e601673dfc997bd6d691bd9a14e
> Author:     Justin Hibbits <chmeeedalf at gmail.com>
> AuthorDate: 2020-12-08 22:49:25 +0000
> Commit:     Piotr Kubaj <pkubaj at FreeBSD.org>
> CommitDate: 2020-12-30 22:45:44 +0000
> 
>     powerpc: Fix copyin/copyout race condition
>     
>     It's possible for a context switch, and CPU migration, to occur between
>     fetching the PCPU context and extracting the pc_curpcb.  This can cause
>     the fault handler to be installed for the wrong thread, leading to a
>     panic in copyin()/copyout().  Since curthread is already in %r13, just
>     use that directly, as GPRs are migrated, so there is no migration race
>     risk.

-- 
  Brandon Bergren
  bdragon at FreeBSD.org


More information about the dev-commits-src-all mailing list