История изменений
Исправление Lrrr, (текущая версия) :
The hex sequence is x86-64 shellcode that performs the following operations:
Computes a large value (0x3ffffff8) and pushes it twice onto the stack to form a struct rlimit.
Sets the resource type to RLIMIT_NOFILE (7).
Invokes syscall 160 (setrlimit) to raise both the soft and hard limits on the number of open files to 0x3ffffff8.
Pops one value from the stack, decrements it to 0x3ffffff7.
Invokes syscall 33 (dup2) to duplicate file descriptor 0 (stdin) to the high file descriptor 0x3ffffff7.
Systemd is related because modern versions (as the init process) increase the system-wide fs.nr_open sysctl to a very high value (e.g., 2^27 or higher), allowing the setrlimit call to succeed with such a large limit without failing due to exceeding fs.nr_open. On non-systemd systems, fs.nr_open defaults to a much lower value (typically 1M), causing setrlimit to fail early
нейронка разобралась))
А если серьезно, то разработка ядра похоже уже давно прогнила. Я помню историю, как Грега КХ спросили что будет, если патч на Си сломает какие-нибудь раст-биндинги. Грег начал объяснять что там есть специальные дружелюбные раст-мейнтейнеры, которые все поправят. Его спросили, а что случится, если правки окажутся нетривиальными. На что он начал мямлить, что пока такого не случалось. На что ему предъявили патч, которые месяц висел без мержа как раз из-за этого. Он на это просто не стал отвечать.
Исходная версия Lrrr, :
The hex sequence is x86-64 shellcode that performs the following operations:
Computes a large value (0x3ffffff8) and pushes it twice onto the stack to form a struct rlimit.
Sets the resource type to RLIMIT_NOFILE (7).
Invokes syscall 160 (setrlimit) to raise both the soft and hard limits on the number of open files to 0x3ffffff8.
Pops one value from the stack, decrements it to 0x3ffffff7.
Invokes syscall 33 (dup2) to duplicate file descriptor 0 (stdin) to the high file descriptor 0x3ffffff7.
Systemd is related because modern versions (as the init process) increase the system-wide fs.nr_open sysctl to a very high value (e.g., 2^27 or higher), allowing the setrlimit call to succeed with such a large limit without failing due to exceeding fs.nr_open. On non-systemd systems, fs.nr_open defaults to a much lower value (typically 1M), causing setrlimit to fail early
нейронка разобралась))