[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#942808: ITP: dropbear-rescue -- A set of initramfs scripts to add and run dropbear when the system boots in rescue mode




On 2019-10-25 7:50 p.m., Guilhem Moulin wrote:
Control: retitle -1 race condition: init-bottom script doesn't abort/cleanup configure_networking()
Control: tag -1 pending

On Fri, 25 Oct 2019 at 02:26:39 +0200, Guilhem Moulin wrote:
Ah right, I understand the problem now.  Whether configure_networking()
is run (at premount stage) in the background or not depends on the boot
method.  On local (non-NFS) mounts it's done in the background, and
should be interrupted at bottom stage.  However if no other script is
waiting for interactive user input the bottom script might run before
dropbear had a chance to run yielding a race condition at bottom stage.
This is a bug.
Implemented a fix at https://salsa.debian.org/debian/dropbear/commit/1ab168b9 ,
could you please confirm that it solves the race for you?

It appears that ipconfig doesn't react to SIGTERM, so I've not been able
to properly abort configure_networking().  Instead, the init-bottom
script now waits (for up to 1min) until dropbear is started before
bringing the network down.  Of course it's a bit of a waste as it
needlessly delays the boot process (it's no longer possible to log in at
that stage anyway), but at least when execution is handed over to init(1)
it's with a clean network stack and not with a running ipconfig process.
Now that #943459 resolves the race condition a separate package makes no sense. If someone wants ssh in initramfs it would only be needed to install dropbear-initramfs. Running only on panic would be a minor optimization to avoid running dropbear and configuring network when where is no crypttab. This could actually be achieved by simply moving the init-premount/dropbear to (the undocumented yet ;) ) panic folder.

So I would consider the this case closed.

Thank you very much


Reply to: