]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libmount: don't hold write fd to mounted device
authorJan Kara <jack@suse.cz>
Wed, 21 Feb 2024 17:30:50 +0000 (18:30 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 26 Feb 2024 08:47:05 +0000 (09:47 +0100)
commit511947e5e5a3eefa4055842aa85ebeced1975414
tree7f8519defa6baf87cac86ff1e1d27a2eff2ff629
parent187bae5140d083d5ee96ba02c639e728ab71d1ff
libmount: don't hold write fd to mounted device

Avoid holding writeable fd to a loop device that is being mounted. In
the hardened configurations (CONFIG_BLK_DEV_WRITE_MOUNTED = n) the
kernel wants to make sure nobody else has the block device writeably
open when mounting so this makes the mount fail.

Reported-by: JunChao Sun <sunjunchao2870@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Acked-by: Christian Brauner <brauner@kernel.org>
(cherry picked from commit 1cde32f323e0970f6c7f35940dcc0aea97b821e5)
libmount/src/hook_loopdev.c