Print this page
NEX-3672 IDM module panics target when PDU has AHS length between 17 and 49
Reviewed by: Steve Peng <steve.peng@nexenta.com>
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/idm/idm_impl.h
          +++ new/usr/src/uts/common/sys/idm/idm_impl.h
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  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   * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   */
  24   24  /*
  25      - * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
       25 + * Copyright 2014-2015 Nexenta Systems, Inc.  All rights reserved.
  26   26   */
  27   27  
  28   28  #ifndef _IDM_IMPL_H_
  29   29  #define _IDM_IMPL_H_
  30   30  
  31   31  #ifdef  __cplusplus
  32   32  extern "C" {
  33   33  #endif
  34   34  
  35   35  #include <sys/avl.h>
↓ open down ↓ 366 lines elided ↑ open up ↑
 402  402  
 403  403  #define IDM_PDU_ALLOC           0x00000001
 404  404  #define IDM_PDU_ADDL_HDR        0x00000002
 405  405  #define IDM_PDU_ADDL_DATA       0x00000004
 406  406  #define IDM_PDU_LOGIN_TX        0x00000008
 407  407  #define IDM_PDU_SET_STATSN      0x00000010
 408  408  #define IDM_PDU_ADVANCE_STATSN  0x00000020
 409  409  
 410  410  #define OSD_EXT_CDB_AHSLEN      (200 - 15)
 411  411  #define BIDI_AHS_LENGTH         5
      412 +/*
      413 + * Additional Header Segment (AHS)
      414 + * AHS is only valid for SCSI Requests and contains SCSI CDB information
      415 + * which doesn't fit in the standard 16 byte area of the PDU. Commonly
      416 + * this only holds true for OSD device commands.
      417 + *
      418 + * IDM_SORX_CACHE_ASHLEN is the amount of memory which is preallocated in bytes.
      419 + * When used in the header the AHS length is stored as the number of 4-byte
      420 + * words; so IDM_SORX_WIRE_ASHLEN is IDM_SORX_CACHE_ASHLEN in words.
      421 + */
 412  422  #define IDM_SORX_CACHE_AHSLEN \
 413      -        (((OSD_EXT_CDB_AHSLEN + 3) + \
 414      -            (BIDI_AHS_LENGTH + 3)) / sizeof (uint32_t))
      423 +        ((OSD_EXT_CDB_AHSLEN + 3) + (BIDI_AHS_LENGTH + 3))
      424 +#define IDM_SORX_WIRE_AHSLEN (IDM_SORX_CACHE_AHSLEN / sizeof (uint32_t))
 415  425  #define IDM_SORX_CACHE_HDRLEN   (sizeof (iscsi_hdr_t) + IDM_SORX_CACHE_AHSLEN)
 416  426  
 417  427  /*
 418  428   * ID pool
 419  429   */
 420  430  
 421  431  #define IDM_IDPOOL_MAGIC        0x4944504C      /* IDPL */
 422  432  #define IDM_IDPOOL_MIN_SIZE     64      /* Number of IDs to begin with */
 423  433  #define IDM_IDPOOL_MAX_SIZE     64 * 1024
 424  434  
↓ open down ↓ 115 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX