Skip to content
Advertisement

What’s the purpose of the UD2 opcode in the Linux kernel?

I have found the following fragment in the Linux kernel (not the corresponding C code though), somewhere during the start up phase. You can clearly see the 0F 0B parts, which stand for the UD2 opcode (IDA refused to disassemble).

There are some possible usages for this opcode explained here and here. In this case, however, the opcodes after this instruction don’t really make sense.

JavaScript

Advertisement

Answer

It’s the BUG() macro from include/asm-i386/bug.h.

JavaScript

For example, the one at 0C05AF is for file with name at 0xC0274A86 and line number 117 (0x75).

Advertisement