]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ext4: check if mount_opts is NUL-terminated in ext4_ioctl_set_tune_sb()
authorFedor Pchelkin <pchelkin@ispras.ru>
Sat, 1 Nov 2025 16:04:29 +0000 (19:04 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Jan 2026 11:57:10 +0000 (12:57 +0100)
commitecb7e5603b57e4e0182cd648937b7dbd89122285
tree10684d34f00a6111ae66d79553cc850964029506
parent5bbacbbf1ca4419861dca3c6b82707c10e9c021c
ext4: check if mount_opts is NUL-terminated in ext4_ioctl_set_tune_sb()

commit 3db63d2c2d1d1e78615dd742568c5a2d55291ad1 upstream.

params.mount_opts may come as potentially non-NUL-term string.  Userspace
is expected to pass a NUL-term string.  Add an extra check to ensure this
holds true.  Note that further code utilizes strscpy_pad() so this is just
for proper informing the user of incorrect data being provided.

Found by Linux Verification Center (linuxtesting.org).

Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
Reviewed-by: Baokun Li <libaokun1@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Message-ID: <20251101160430.222297-2-pchelkin@ispras.ru>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/ioctl.c