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

Bug#942808: Bug#943459: dropbear-initramfs: race condition: init-bottom script doesn't abort/cleanup configure_networking()



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.

-- 
Guilhem.

Attachment: signature.asc
Description: PGP signature


Reply to: