Project

General

Profile

Actions

Bug #6386

closed

Fix function call with uninitialized value in vdev_inuse

Added by Richard Yao almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
High
Assignee:
-
Category:
zfs - Zettabyte File System
Start date:
2015-10-24
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage
Gerrit CR:

Description

LLVM's static analyzer reported that we could pass an uninitialized
pool_guid to spa_by_guid() in vdev_inuse(). Upon review, it is correct.
An attempt to repurpose a spare or L2ARC drive from an exported pool
will cause the pool_guid passed to spa_by_guid() to be unintialized
information from the stack. This will cause non-deterministic behavior.
Since there is no reason why we cannot repurpose such disks, we modify
vdev_inuse() to avoid calling spa_by_guid() when they are detected.

https://github.com/openzfs/openzfs/pull/11
https://github.com/zfsonlinux/zfs/commit/485c581c41c4da15a17f045605ce5a7562b3b8a2

Reviewed-by: Brian Behlendorf <>

Actions

Also available in: Atom PDF