]> git.ipfire.org Git - thirdparty/openwrt.git/commit
image: fix race between mkits.sh and mkimage in .itb squashfs generation
authorChristian Marangi <ansuelsmth@gmail.com>
Wed, 22 Oct 2025 00:17:25 +0000 (02:17 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Thu, 23 Oct 2025 16:14:00 +0000 (18:14 +0200)
commit3de1bbd5aeb542de9a4b20eff0f6bbf1767fd6b9
treeb5549f7c6c85b44dcb09bf92b965694458587bca
parentcdf891052dd2e9f3d2c4179dfc76299a05ab524b
image: fix race between mkits.sh and mkimage in .itb squashfs generation

With further investigation it was found a race in generating .itb images
that include a RootFS caused by the mkits.sh and the mkimage.

Due to the fact that mkits.sh generates a .pagesync image of the passed
rootfs, it can happen that, concurrently, mkimage can be called at the
same time mkits.sh is creating another .pagesync for the same rootfs.

This cause mkimage to use an half made rootfs.pagesync creating a
corrupted image.

To address this, also protect the mkimage with the same lock used for
mkits.sh preventing any kind of concurrent usage/generation of the
rootfs.pagesync blob

Fixes: 52cc9d82f113 ("kernel: rework Initramfs locking logic")
Link: https://github.com/openwrt/openwrt/pull/20492
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
include/image-commands.mk