Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/arch/x86/x86asm: missing Control-flow Enforcement instructions; e.g. ENDBR64 #35865

mewmew opened this issue Nov 27, 2019 · 1 comment


Copy link

@mewmew mewmew commented Nov 27, 2019

As a follow-up of #18665, instructions related to Control-flow Enforcement are currently not recognized by the x/arch/x86 disassembler.

Example link at

package main

import (


func main() {
	// ref: Section 7.1: ENDBR64 of "Control-flow Enforcement Technology Specification"
	text := []byte{0xF3, 0x0F, 0x1E, 0xFA} // endbr64
	inst, err := x86asm.Decode(text[:], 64)
	if err != nil {
	fmt.Println("inst:", inst)
	// Expected: ENDBR64
	// Got:      REP Op(0)

At rev golang/arch@368ea8f, the ENDBR64 instruction is incorrectly recognized as REP Op(0) without reporting any error from decode. The ENDBR64 instruction has the byte sequence 0xF3, 0x0F, 0x1E, 0xFA and was introduced as part of the Control-flow Enforcement Technology Specification:

/cc: @rsc @minux

Copy link

@TACIXAT TACIXAT commented May 17, 2021

This affects me too.

Happy to give fixing it a shot if someone provides points on where the code that needs to be changed is. Thanks!


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants