]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
geom_label: Add more validation for NTFS volume tasting
authorMark Johnston <markj@FreeBSD.org>
Mon, 4 Oct 2021 21:48:44 +0000 (17:48 -0400)
committerMark Johnston <markj@FreeBSD.org>
Mon, 4 Oct 2021 22:15:06 +0000 (18:15 -0400)
commitf0a08fa9f532a58f5d7a4814d6eb7ddd49f368da
tree5a9b3d5b89e2f63f2dfe7e51eb8c606e77c3ff26
parentd43fa8ef534ac87a16843d45264f56cf11e0fcbc
geom_label: Add more validation for NTFS volume tasting

- Ensure that the computed MFT record size isn't negative or larger than
  maxphys before trying to read $Volume.
- Guard against truncated records in volume metadata.
- Ensure that the record length is large enough to contain the volume
  name.
- Verify that the (UTF-16-encoded) volume name's length is a multiple of
  two.

PR: 258833, 258914
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
sys/geom/label/g_label_ntfs.c