]> 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, 18 Oct 2021 13:08:32 +0000 (09:08 -0400)
commit116a988f99cd9fcac1a34c17ec0aa81be70d5e4f
tree715278ea6aa7f62261c4076912fe387cf4408167
parent94c3735b74f796a8b271091a8ebc276021345d79
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
Sponsored by: The FreeBSD Foundation

(cherry picked from commit f0a08fa9f532a58f5d7a4814d6eb7ddd49f368da)
sys/geom/label/g_label_ntfs.c