News for hackers. Stuff that matters.
Re:The PS5 Has Been Jailbroken by kristofferR on Monday October 03, 2022 @07:01AM (#33065823)
I was unfamiliar with the term gadget in this context too, it seems to refer to an exploitation technique to bypass ASLR:

https://ctf101.org/binary-exploitation/return-oriented-progr....

https://trustfoundry.net/2019/07/18/basic-rop-techniques-and...

Re:The PS5 Has Been Jailbroken by ethbr0 on Monday October 03, 2022 @07:38AM (#33066066)
Of the top of my head (not my primary space), a gadget is a piece of code at a known or guessable location that provides specific functionality.

This is important as modern no-execute et al. prevent you from simply dumping arbitrary code into memory and running it.

Consequently, modern exploits tend to look like: (1) figure out how memory is laid out, or close enough, (2) calculate where a useful function is, that you can call with arbitrary parameters (aka a gadget), (3) abuse that function to do your bidding by controlling its parameters and the instruction pointer.

(2) gets around your inability to write + execute code directly, because the system is by definition already set up to allow built-in code to execute. And that built-in code generally does lots of useful things (like reading and writing memory).

ASLR makes (1) harder, but fundamental efficiency reasons at the operating system code level mean than usually "everything" isn't fully randomized.

Re:The PS5 Has Been Jailbroken by _kbh_ on Monday October 03, 2022 @09:50AM (#33067485)
> Of the top of my head (not my primary space), a gadget is a piece of code at a known or guessable location that provides specific functionality.

> Consequently, modern exploits tend to look like: (1) figure out how memory is laid out, or close enough, (2) calculate where a useful function is, that you can call with arbitrary parameters (aka a gadget), (3) abuse that function to do your bidding by controlling its parameters and the instruction pointer.

This is all correct, but generally a gadget is what a snippet of assembly / machine code that you call to get the CPU into a state to call a function. So its less a function and more a set of instructions (anywhere) that are useful.

So for example, you might have a gadget to set specific registers with values off the stack so you can call malloc with the correct size, etc.

Re:The PS5 Has Been Jailbroken by P5fRxh5kUvp2th on Monday October 03, 2022 @10:06AM (#33067707)
Well back in my day ... slips in dentures* a gadget was just a generic thing you played around with and did a thing.

Now get the hell off my lawn you whippersnappers, before I throw my teef at you.

Re:The PS5 Has Been Jailbroken by ethbr0 on Monday October 03, 2022 @11:10AM (#33068588)
Thanks for the clarification! I figure if someone is curious enough + looks up links on their own, giving them a good answer is only fair. :)
Re:The PS5 Has Been Jailbroken by mikepurvis on Monday October 03, 2022 @07:42AM (#33066087)
I don't know if this is intentional, but my brain has always connected the word back to the codename used for the nuclear bomb research being done during WWII:

https://en.wikipedia.org/wiki/Gadget_(disambiguation)#Scienc...

The idea being that a code "gadget" is something similarly small and innocuous-looking that turns out to have far, far more powerful effects than anyone would guess just by looking at it.