get_addr_ref_32(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… get_addr_ref_32(9) β€” the Kernel API Manual, but make it cute

okay so bestie, welcome to get_addr_ref_32(9) from the Kernel API Manual ✨ this one is short and sweet and honestly kinda iconic β€” it's the 32-bit address resolver of your dreams πŸŽ€


🌸 NAME 🌸

get_addr_ref_32 β€” Obtain a 32-bit linear address

like, that's the whole vibe. it gets you a 32-bit linear address. slay.


✨ SYNOPSIS ✨

void __user * get_addr_ref_32 (struct insn *insn , struct pt_regs *regs
);

no cap, that's the whole signature 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • insn β€” the instruction you're looking at, and it's bringing its ModRM, SIB bytes and displacement with it. it's giving "I came prepared" πŸ’…
  • regs β€” the register values exactly as they looked when you entered kernel mode. like a little snapshot of the moment, preserved for you πŸŽ€

πŸ’– DESCRIPTION πŸ’–

so here's the tea β˜• β€” this function is only for 32-bit address encodings. its whole job is to obtain the linear memory address referred to by the instruction's ModRM, SIB, displacement bytes and segment base address, as applicable. yes, the "as applicable" is doing heavy lifting there, it's that girl ✨

and if you're in protected mode? segment limits are enforced β€” no sneaking past them, periodt. 🚨

on success you get back the linear address referenced by the instruction and the registers πŸ’œ

and on error? you get -1L. yeah. negative one long. it happens to the best of us 😭


πŸ‘‘ SEE ALSO πŸ‘‘

the kernel file ./arch/x86/lib/insn-eval.c is the main character here, and it also wants you to know about all these besties:

iykyk 🌈


aaaand that's the page, bestie πŸ“ big love to ./arch/x86/lib for housing all this, dated October 2026 β€” go read the source, it ate πŸ’…βœ¨

πŸ“¦ where this page comes from