]> 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:46:17 +0000 (09:46 +0100)
commit1cde32f323e0970f6c7f35940dcc0aea97b821e5
treef98a4286798a5c1d6df1cd41d419bfa19fd6f2c9
parent7ca98ca6aab919f271a15e40276cbb411e62f0e4
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>
libmount/src/hook_loopdev.c