Project

General

Profile

Bug #8481

nvmeadm: nvme_dskname() string handling is buggy

Added by Hans Rosenfeld over 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Start date:
2017-07-10
Due date:
% Done:

100%

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

Description

There are two issues in nvme_dskname(). First, it is assumed that the output of di_dim_path_dev() either returns NULL or a string that is at least 2 chars long. And second, there is an ineffective NULL pointer check following strrchr(path, '/') + 1.

History

#1

Updated by Hans Rosenfeld over 2 years ago

  • Project changed from Graphics/DRM to illumos gate
#2

Updated by Hans Rosenfeld about 2 years ago

Webrev: https://grumpf.hope-2000.org/illumos-8481/

Testing: I verified that the disk names are still resolved correctly by nvmeadm, but I didn't exercise the error handling for when di_dim_path_dev() does something completely unexpected.

This change has been in illumos-joyent since July.

#3

Updated by Electric Monk about 2 years ago

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

git commit e7e9ed12e28c345b730aae97b62991a1b640fc7c

commit  e7e9ed12e28c345b730aae97b62991a1b640fc7c
Author: Hans Rosenfeld <hans.rosenfeld@joyent.com>
Date:   2017-09-12T14:59:24.000Z

    8481 nvmeadm: nvme_dskname() string handling is buggy
    Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
    Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
    Reviewed by: Yuri Pankov <yuripv@gmx.com>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF