[Toybox] Impact of global struct size
Rob Landley
rob at landley.net
Thu Jan 4 10:11:18 PST 2024
On 1/3/24 12:19, Mouse wrote:
>> (The line between PIE and dynamic linking confuses even me. How does
>> static PIE relocate itself?
>
> It may not. It could get relocated by in-kernel ASLR or the like.
> Also, I think PIE isn't relevant, or certainly isn't _as_ relevant, to
> the final executable; my impression is that it's more important for
> library code, so it doesn't need fixups. These are less important for
> static executables, since the fixups there happen once, at link time,
> whereas for a .so the fixups happen at runtime and reduce the
> text-segment sharing that is one of the benefits of shared objects.
I want https://www.muppetlabs.com/~breadbox/software/tiny/teensy.html but a
walkthrough for the kernel's ELF loader. (I've had to walk through it MYSELF
several times, but I didn't do writeups afterwards so forgot it all.)
I suppose I should start by reading his dynamic version:
https://www.muppetlabs.com/~breadbox/software/tiny/somewhat.html
>> Luckily X11 has "detach and restart" plumbing that lets it reopen a
>> process's network pipe without killing the window or the process,
>
> ...? When did it grow that, and where can I find out more about it?
Um... A) Before Scale 2011, B) ask Kir Kolyshkin? He said it was something old.
(I think the program can just detect that the connection closed and dial out to
the server again, opening a new window and repopulating it? It's just most
programs don't bother.)
What OpenVZ was doing was
A) tell the container to create a giant multi-process coredump file that had
every process in the container in one big file (but don't STOP anything, just
checkpoint the live running stuff racily).
B) rsync the filesystem and coredump over to the new machine.
C) Suspend the container (all processes) and re-write the big coredump file.
D) rsync everything AGAIN (fast because not much changed)
E) do TCP/IP connection hijacking so the new machine inherits the old open
connections (you don't have to predict sequence numbers the other side sends
you, don't forget to broadcast an ARP update so the packets go to the new
ethernet address):
https://www.idc-online.com/technical_references/pdfs/data_communications/TCP_Sequence_Prediction_Attack.pdf
F) Resume the new container in the new filesystem.
He had an animated X11 window (screensaver) that paused for 1/3 of a second
while migrating from machine to machine. His demo involved plugging in a cat 5
to the new machine, migrating to it, and unplugging the old one's network cable.
This was in 2011. I assume vanilla Linux has caught up by now, but there was
quite the laundry list at the time...
Rob
More information about the Toybox
mailing list