Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178404388
D10381.1796678039.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
935 B
Referenced Files
None
Subscribers
None
D10381.1796678039.diff
View Options
Index: sys/boot/zfs/zfsimpl.c
===================================================================
--- sys/boot/zfs/zfsimpl.c
+++ sys/boot/zfs/zfsimpl.c
@@ -929,7 +929,7 @@
{
vdev_t vtmp;
vdev_phys_t *vdev_label = (vdev_phys_t *) zap_scratch;
- vdev_phys_t *tmp_label = zfs_alloc(sizeof(vdev_phys_t));
+ vdev_phys_t *tmp_label;
spa_t *spa;
vdev_t *vdev, *top_vdev, *pool_vdev;
off_t off;
@@ -957,6 +957,12 @@
psize = P2ALIGN(ldi_get_size(read_priv),
(uint64_t)sizeof (vdev_label_t));
+ /* Test for minimum pool size. */
+ if (psize < SPA_MINDEVSIZE)
+ return (EIO);
+
+ tmp_label = zfs_alloc(sizeof(vdev_phys_t));
+
for (l = 0; l < VDEV_LABELS; l++) {
off = vdev_label_offset(psize, l,
offsetof(vdev_label_t, vl_vdev_phys));
@@ -988,6 +994,9 @@
zfs_free(tmp_label, sizeof (vdev_phys_t));
+ if (best_txg == 0)
+ return (EIO);
+
if (vdev_label->vp_nvlist[0] != NV_ENCODE_XDR)
return (EIO);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 7, 9:13 PM (21 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42291957
Default Alt Text
D10381.1796678039.diff (935 B)
Attached To
Mode
D10381: loader: zfs reader vdev_probe should check for minimum device size
Attached
Detach File
Event Timeline