Project

General

Profile

Bug #8901

netstack_find_by_stackid() drops-and-reacquires

Added by Dan McDonald over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2017-12-06
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

Related to #8900. SmartOS bug https://smartos.org/bugview/OS-6441

History

#1

Updated by Dan McDonald over 2 years ago

The summary is one case of a generic class of check-without-lock-then-hold problems across netstack.c. This fix addresses them.

OLD WAY:

flag check (should be under mutex)
XXX KEBE SAYS MUCH CAN HAPPEN HERE XXX
if flags don't check, return, else...
XXX AND HERE TOO XXX
mutex_enter
refcount bump
mutex_exit

NEW WAY:

mutex_enter
flag check
if flags don't check, mutex_exit and return, else...
refcount bump
mutex_exit
#2

Updated by Electric Monk over 2 years ago

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

git commit 704ca705399a21dba6e20e147ac68d7a067570e6

commit  704ca705399a21dba6e20e147ac68d7a067570e6
Author: Dan McDonald <danmcd@joyent.com>
Date:   2017-12-12T16:48:53.000Z

    8901 netstack_find_by_stackid() drops-and-reacquires
    Reviewed by: Jason King <jbk@joyent.com>
    Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
    Reviewed by: Robert Mustacchi <rm@joyent.com>
    Reviewed by: Ryan Zezeski <rpz@joyent.com>
    Approved by: Richard Lowe <richlowe@richlowe.net>

Also available in: Atom PDF