Skip to content
Snippets Groups Projects
Forked from Glasgow Haskell Compiler / GHC
Source project has a limited visibility.
  • Moritz Angermann's avatar
    44c9ebcb
    [rts] Untag bq->bh prior to reading the info table · 44c9ebcb
    Moritz Angermann authored and Zubin's avatar Zubin committed
    In `checkBlockingQueues` we must always untag the `bh` field of an `StgBlockingQueue`.
    While at first glance it might seem a sensible assumption that `bh` will
    always be a blackhole and therefore never be tagged, the GC could
    shortcut the indirection and put a tagged pointer into the indirection.
    
    This blew up on aarch64-darwin with a misaligned access. `bh` pointed
    to an address that always ended in 0xa. On architectures that
    are a little less strict about alignment, this would have read
    a garbage info table pointer, which very, very unlikely would have been equal to
    `stg_BLACKHOLE_info` and therefore things accidentally worked. However,
    on AArch64, the read of the info table pointer resulted in a SIGBUS due
    to misaligned read.
    
    Fixes #20093.
    
    (cherry picked from commit 1832676a)
    [rts] Untag bq->bh prior to reading the info table
    Moritz Angermann authored and Zubin's avatar Zubin committed
    In `checkBlockingQueues` we must always untag the `bh` field of an `StgBlockingQueue`.
    While at first glance it might seem a sensible assumption that `bh` will
    always be a blackhole and therefore never be tagged, the GC could
    shortcut the indirection and put a tagged pointer into the indirection.
    
    This blew up on aarch64-darwin with a misaligned access. `bh` pointed
    to an address that always ended in 0xa. On architectures that
    are a little less strict about alignment, this would have read
    a garbage info table pointer, which very, very unlikely would have been equal to
    `stg_BLACKHOLE_info` and therefore things accidentally worked. However,
    on AArch64, the read of the info table pointer resulted in a SIGBUS due
    to misaligned read.
    
    Fixes #20093.
    
    (cherry picked from commit 1832676a)
Code owners
Assign users and groups as approvers for specific file changes. Learn more.