]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: dont return EINVAL from GETFSUUID when reporting UUID length
authorDarrick J. Wong <djwong@kernel.org>
Thu, 10 Nov 2022 20:16:29 +0000 (12:16 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Jan 2023 10:12:01 +0000 (11:12 +0100)
commit698619d97aefc583eeadd30ae5b9f59d5bd6193d
tree787c967e9764276d6a7bd2a8b4091facc7a74873
parent057b0d927985f34b13e577e5b76c6ea70c6a9bd5
ext4: dont return EINVAL from GETFSUUID when reporting UUID length

commit b76abb5157468756163fe7e3431c9fe32cba57ca upstream.

If userspace calls this ioctl with fsu_length (the length of the
fsuuid.fsu_uuid array) set to zero, ext4 copies the desired uuid length
out to userspace.  The kernel call returned a result from a valid input,
so the return value here should be zero, not EINVAL.

While we're at it, fix the copy_to_user call to make it clear that we're
only copying out fsu_len.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Catherine Hoang <catherine.hoang@oracle.com>
Link: https://lore.kernel.org/r/166811138914.327006.9241306894437166566.stgit@magnolia
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