Get the latest tech news

My Own Private Binary: An Idiosyncratic Introduction to Linux Kernel Modules


Several years ago, I spent a serious chunk of time figuring out how to make really teensy ELF executable files. I started down this path because I was annoyed that all of my programs, no matter how short they were, never got smaller than 4k or so.

One of the fields of the linux_binprm struct is the filename, so we examine it, and if there's no ".com" extension, then we return negative ENOEXEC, the errno equivalent to our "Exec format error" message. (If for whatever reason you don't trust your compiler to properly handle Unicode characters, you can instead assume a UTF-8 environment and write the second argument to strcmp() as".\342\231\232".) So you could in theory potentially maybe argue that, just for example, using the character immediately preceding the extension would also be valid metadata, and that could be defined to specify optional behavior, like the default stack value for example …

Get the Android app

Or read this on Hacker News

Read more on:

Photo of linux kernel

linux kernel

Photo of private binary

private binary

Photo of linux kernel modules

linux kernel modules

Related news:

News photo

Linux Kernel Defence Map – Security Hardening Concepts

News photo

Linux Kernel Developments, AMD RX 9070 GIMP 3.0 & Other March Highlights

News photo

Intel Posts New Linux Kernel Patches To "Hide The Disgusting Turds"