github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/linux/test/cet_user_shstk (about)

     1  # requires: arch=amd64
     2  
     3  arch_prctl$ARCH_SHSTK_DISABLE(0x5002, 0x1)
     4  arch_prctl$ARCH_SHSTK_ENABLE(0x5001, 0x1)
     5  arch_prctl$ARCH_SHSTK_UNLOCK(0x5004, 0x1)
     6  
     7  r0 = syz_clone(0x11, 0x0, 0x0, 0x0, 0x0, 0x0)
     8  
     9  arch_prctl$ARCH_SHSTK_ENABLE(0x5001, 0x2)
    10  arch_prctl$ARCH_SHSTK_DISABLE(0x5002, 0x2)
    11  arch_prctl$ARCH_SHSTK_ENABLE(0x5001, 0x2)
    12  
    13  ptrace(0x10, r0)
    14  
    15  ptrace$ARCH_SHSTK_DISABLE(0x1e, r0, 0x1, 0x5002)
    16  ptrace$ARCH_SHSTK_ENABLE(0x1e, r0, 0x1, 0x5001)
    17  ptrace$ARCH_SHSTK_UNLOCK(0x1e, r0, 0x1, 0x5004)
    18  
    19  ptrace$getregset(0x4204, r0, 0x204, &AUTO={&AUTO='LLLLLLLLLLLLLLLLLLLLLLLLLLLL', 0x8})
    20  ptrace$setregset(0x4205, r0, 0x204, &AUTO={&AUTO='LLLLLLLLLLLLLLLLLLLLLLLLLLLL', 0x8})
    21  
    22  ptrace(0x11, r0)
    23  
    24  mmap(&(0x7f0000000000/0x200000)=nil, 0x200000, 0x3, 0x22, 0, 0x0)
    25  map_shadow_stack(&(0x7f0000000000/0x200000)=nil, 0x200000, 0x1)
    26  
    27  arch_prctl$ARCH_SHSTK_DISABLE(0x5002, 0x1)