Project

General

Profile

Bug #9228

zone_getattr(ZONE_ATTR_NETWORK) returns uninitialised value

Added by Andy Fiddaman over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
zones
Start date:
2018-03-04
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

causing problems for consumers such as `ipadm enable-if`

Just to make it fun, running the above command under dtrace or truss, or with a few debug printfs in it masks the underlying problem.


Related issues

Related to illumos gate - Bug #9230: zone_getattr(ZONE_ATTR_NETWORK) doesn't check user-supplied buffer sizeClosed2018-03-04

Actions

History

#1

Updated by Andy Fiddaman over 1 year ago

  • Related to Bug #9230: zone_getattr(ZONE_ATTR_NETWORK) doesn't check user-supplied buffer size added
#2

Updated by Joshua Clulow over 1 year ago

From Andy, provided in the review notes:

I came across this while troubleshooting the allowed-address zone network attribute.
Using a freshly installed exclusive-ip zone with an allowed-address:

bloody# zonecfg -z sparse info net
net:
        address not specified
        allowed-address: 172.16.1.1/24
        defrouter: 172.16.1.254
        physical: sparse0

Before this patch:

During first zone boot, dtrace shows:

  7  24847              zone_getattr:return Returning -72887665

and once all services are started, there is no interface in the zone:

root@sparse:~# ipadm show-if
IFNAME     STATE    CURRENT      PERSISTENT
lo0        ok       -m-v------46 ---

It can be created but attempting to bring it online results in an error:

root@sparse:~# ipadm create-if sparse0
root@sparse:~# ipadm disable-if -t sparse0
root@sparse:~# ipadm enable-if -t sparse0
ipadm: Could not enable sparse0 : Invalid argument provided
root@sparse:~# ipadm show-if
IFNAME     STATE    CURRENT      PERSISTENT
lo0        ok       -m-v------46 ---
sparse0    down     bm-------Z46 -46

and, again, dtrace shows the kernel function returning a negative number.

After patch:

Immediately following zone install, zone boot:

root@sparse:~# ipadm show-if
IFNAME     STATE    CURRENT      PERSISTENT
lo0        ok       -m-v------46 ---
sparse0    ok       bm-------Z4- -4-
root@sparse:~# ipadm show-addr
ADDROBJ           TYPE     STATE        ADDR
lo0/v4            static   ok           127.0.0.1/8
sparse0/_a        from-gz  ok           172.16.1.1/24
lo0/v6            static   ok           ::1/128
#3

Updated by Electric Monk over 1 year ago

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

git commit 66d7818b6a24876c96bdd1a81986c017f368decd

commit  66d7818b6a24876c96bdd1a81986c017f368decd
Author: Andy Fiddaman <omnios@citrus-it.co.uk>
Date:   2018-03-11T06:14:24.000Z

    9228 zone_getattr(ZONE_ATTR_NETWORK) returns uninitialised value
    9230 zone_getattr(ZONE_ATTR_NETWORK) doesn't check user-supplied buffer size
    Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
    Reviewed by: John Levon <john.levon@joyent.com>
    Reviewed by: Dominik Hassler <hadfl@omniosce.org>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Reviewed by: C Fraire <cfraire@me.com>
    Approved by: Joshua M. Clulow <josh@sysmgr.org>

Also available in: Atom PDF