FreeBSD: Ensure that zfs_getattr() initializes the va_rdev field
commit11656234b560c401dec6a16e1bf048b20fd31aac
authorMark Johnston <markjdb@gmail.com>
Thu, 7 Dec 2023 16:20:11 +0000 (7 11:20 -0500)
committerGitHub <noreply@github.com>
Thu, 7 Dec 2023 16:20:11 +0000 (7 08:20 -0800)
treec49f4d9a36659191923557d6c2fecb513051aede
parent9743d09635c7ab7957e00161cc8d4e8697ffa191
FreeBSD: Ensure that zfs_getattr() initializes the va_rdev field

Otherwise the field is left uninitialized, leading to a possible kernel
memory disclosure to userspace or to the network.  Use the same
initialization value we use in zfsctl_common_getattr().

Reported-by: KMSAN
Sponsored-by: The FreeBSD Foundation
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ed Maste <emaste@FreeBSD.org>
Signed-off-by: Mark Johnston <markj@FreeBSD.org>
Closes #15639
module/os/freebsd/zfs/zfs_vnops_os.c