Project

General

Profile

Bug #6386

Fix function call with uninitialized value in vdev_inuse

Added by Richard Yao almost 4 years ago. Updated almost 4 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

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 <>

History

#1

Updated by Electric Monk almost 4 years ago

  • % Done changed from 0 to 100
  • Status changed from New to Closed

git commit 5bdd995ddb777f538bfbcc5e2d5ff1bed07ae56e

commit  5bdd995ddb777f538bfbcc5e2d5ff1bed07ae56e
Author: Richard Yao <ryao@gentoo.org>
Date:   2015-10-31T00:09:06.000Z

    6386 Fix function call with uninitialized value in vdev_inuse
    Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed by: Matthew Ahrens <mahrens@delphix.com>
    Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
    Approved by: Robert Mustacchi <rm@joyent.com>

Also available in: Atom PDF