Print this page
12694 race between write() and shutdown() for unix sockets

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/os/space.c
          +++ new/usr/src/uts/common/os/space.c
↓ open down ↓ 15 lines elided ↑ open up ↑
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   * Copyright 2016 Nexenta Systems, Inc.
       26 + * Copyright 2020 Joyent, Inc.
  26   27   */
  27   28  
  28   29  /*
  29   30   * The intent of this file is to contain any data that must remain
  30   31   * resident in the kernel.
  31   32   *
  32   33   * space_store(), space_fetch(), and space_free() have been added to
  33   34   * easily store and retrieve kernel resident data.
  34   35   * These functions are recommended rather than adding new variables to
  35   36   * this file.
↓ open down ↓ 99 lines elided ↑ open up ↑
 135  136  /*
 136  137   * Data from arp.c that must be resident.
 137  138   */
 138  139  #include <net/if_arp.h>
 139  140  #include <netinet/in.h>
 140  141  #include <netinet/in_var.h>
 141  142  #include <netinet/if_ether.h>
 142  143  
 143  144  ether_addr_t etherbroadcastaddr = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
 144  145  
 145      -
 146      -/*
 147      - * Data from timod that must be resident
 148      - */
 149      -
 150      -/*
 151      - * state transition table for TI interface
 152      - */
 153      -#include <sys/tihdr.h>
 154      -
 155      -#define nr      127             /* not reachable */
 156      -
 157      -char ti_statetbl[TE_NOEVENTS][TS_NOSTATES] = {
 158      -                                /* STATES */
 159      -        /* 0  1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16 */
 160      -
 161      -        { 1, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 162      -        {nr, nr, nr,  2, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 163      -        {nr, nr, nr,  4, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 164      -        {nr,  3, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 165      -        {nr, nr, nr, nr,  3, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 166      -        {nr,  0,  3, nr,  3,  3, nr, nr,  7, nr, nr, nr,  6,  7,  9, 10, 11},
 167      -        {nr, nr,  0, nr, nr,  6, nr, nr, nr, nr, nr, nr,  3, nr,  3,  3,  3},
 168      -        {nr, nr, nr, nr, nr, nr, nr, nr,  9, nr, nr, nr, nr,  3, nr, nr, nr},
 169      -        {nr, nr, nr, nr, nr, nr, nr, nr,  3, nr, nr, nr, nr,  3, nr, nr, nr},
 170      -        {nr, nr, nr, nr, nr, nr, nr, nr,  7, nr, nr, nr, nr,  7, nr, nr, nr},
 171      -        {nr, nr, nr,  5, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 172      -        {nr, nr, nr, nr, nr, nr, nr,  8, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 173      -        {nr, nr, nr, nr, nr, nr, 12, 13, nr, 14, 15, 16, nr, nr, nr, nr, nr},
 174      -        {nr, nr, nr, nr, nr, nr, nr, nr, nr,  9, nr, 11, nr, nr, nr, nr, nr},
 175      -        {nr, nr, nr, nr, nr, nr, nr, nr, nr,  9, nr, 11, nr, nr, nr, nr, nr},
 176      -        {nr, nr, nr, nr, nr, nr, nr, nr, nr, 10, nr,  3, nr, nr, nr, nr, nr},
 177      -        {nr, nr, nr,  7, nr, nr, nr,  7, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 178      -        {nr, nr, nr, nr, nr, nr,  9, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 179      -        {nr, nr, nr, nr, nr, nr, nr, nr, nr,  9, 10, nr, nr, nr, nr, nr, nr},
 180      -        {nr, nr, nr, nr, nr, nr, nr, nr, nr,  9, 10, nr, nr, nr, nr, nr, nr},
 181      -        {nr, nr, nr, nr, nr, nr, nr, nr, nr, 11,  3, nr, nr, nr, nr, nr, nr},
 182      -        {nr, nr, nr, nr, nr, nr,  3, nr, nr,  3,  3,  3, nr, nr, nr, nr, nr},
 183      -        {nr, nr, nr, nr, nr, nr, nr,  3, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 184      -        {nr, nr, nr, nr, nr, nr, nr,  7, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 185      -        {nr, nr, nr,  9, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 186      -        {nr, nr, nr,  3, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 187      -        {nr, nr, nr,  3, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 188      -        {nr, nr, nr,  3, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 189      -};
 190      -
 191      -
 192  146  #include <sys/tty.h>
 193  147  #include <sys/ptyvar.h>
 194  148  
 195  149  static void store_fetch_initspace();
 196  150  
 197  151  /*
 198  152   * Allocate tunable structures at runtime.
 199  153   */
 200  154  void
 201  155  space_init(void)
↓ open down ↓ 184 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX