Print this page
NEX-4878 CIFS assertion failed on common/fs/smbsrv/smb_sd.c, line: 57
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
NEX-1635 Codenomicon: SMB2 TC: 157974 Panic in smb2_create/smb_decode_sd
SMB-11 SMB2 message parse & dispatch
SMB-12 SMB2 Negotiate Protocol
SMB-13 SMB2 Session Setup
SMB-14 SMB2 Logoff
SMB-15 SMB2 Tree Connect
SMB-16 SMB2 Tree Disconnect
SMB-17 SMB2 Create
SMB-18 SMB2 Close
SMB-19 SMB2 Flush
SMB-20 SMB2 Read
SMB-21 SMB2 Write
SMB-22 SMB2 Lock/Unlock
SMB-23 SMB2 Ioctl
SMB-24 SMB2 Cancel
SMB-25 SMB2 Echo
SMB-26 SMB2 Query Dir
SMB-27 SMB2 Change Notify
SMB-28 SMB2 Query Info
SMB-29 SMB2 Set Info
SMB-30 SMB2 Oplocks
SMB-53 SMB2 Create Context options
(SMB2 code review cleanup 1, 2, 3)

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/smbsrv/smb_nt_transact_security.c
          +++ new/usr/src/uts/common/fs/smbsrv/smb_nt_transact_security.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  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  /*
  23   23   * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  24      - * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
       24 + * Copyright 2016 Nexenta Systems, Inc.  All rights reserved.
  25   25   */
  26   26  
  27   27  #include <smbsrv/smb_kproto.h>
  28   28  
  29   29  static void smb_encode_sacl(mbuf_chain_t *, smb_acl_t *);
  30   30  static void smb_encode_dacl(mbuf_chain_t *, smb_acl_t *);
  31   31  static smb_acl_t *smb_decode_acl(mbuf_chain_t *, uint32_t);
  32   32  
  33   33  /*
  34   34   * smb_nt_transact_query_security_info
↓ open down ↓ 329 lines elided ↑ open up ↑
 364  364   * smb_sd_term().
 365  365   */
 366  366  uint32_t
 367  367  smb_decode_sd(mbuf_chain_t *mbc, smb_sd_t *sd)
 368  368  {
 369  369          struct mbuf_chain sdbuf;
 370  370          uint32_t owner_offs;
 371  371          uint32_t group_offs;
 372  372          uint32_t sacl_offs;
 373  373          uint32_t dacl_offs;
      374 +        int rc;
 374  375  
 375  376          smb_sd_init(sd, SECURITY_DESCRIPTOR_REVISION);
 376  377  
 377  378          (void) MBC_SHADOW_CHAIN(&sdbuf, mbc,
 378  379              mbc->chain_offset,
 379  380              mbc->max_bytes - mbc->chain_offset);
 380  381  
 381      -        if (smb_mbc_decodef(&sdbuf, "b.wllll",
      382 +        rc = smb_mbc_decodef(&sdbuf, "b.wllll",
 382  383              &sd->sd_revision, &sd->sd_control,
 383      -            &owner_offs, &group_offs, &sacl_offs, &dacl_offs))
 384      -                goto decode_error;
      384 +            &owner_offs, &group_offs, &sacl_offs, &dacl_offs);
 385  385  
      386 +        /* Prevent disallowed flags in smb_sd_term. */
 386  387          sd->sd_control &= ~SE_SELF_RELATIVE;
      388 +        if (rc != 0)
      389 +                goto decode_error;
 387  390  
 388  391          if (owner_offs != 0) {
 389  392                  if (owner_offs < SMB_SD_HDRSIZE)
 390  393                          goto decode_error;
 391  394  
 392  395                  sd->sd_owner = smb_decode_sid(mbc, owner_offs);
 393  396                  if (sd->sd_owner == NULL)
 394  397                          goto decode_error;
 395  398          }
 396  399  
↓ open down ↓ 154 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX