Print this page
NEX-5260 smbd segfaults while running smbtorture:rpc.lsa.lookupnames
NEX-5261 smbd segfaults while running smbtorture:rpc.winreg
NEX-5262 smbd segfaults while running smbtorture:rpc.samba3
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Matt Barden <matt.barden@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/smbsrv/libmlsvc/common/winreg_svc.c
          +++ new/usr/src/lib/smbsrv/libmlsvc/common/winreg_svc.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) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
       24 + * Copyright 2016 Nexenta Systems, Inc.  All rights reserved.
  24   25   */
  25   26  
  26   27  /*
  27   28   * Windows Registry RPC (WINREG) server-side interface.
  28   29   *
  29   30   * The registry is a database with a hierarchical structure similar to
  30   31   * a file system, with keys in place of directories and values in place
  31   32   * of files.  The top level keys are known as root keys and each key can
  32   33   * contain subkeys and values.  As with directories and sub-directories,
  33   34   * the terms key and subkey are used interchangeably.  Values, analogous
↓ open down ↓ 866 lines elided ↑ open up ↑
 900  901  {
 901  902          struct winreg_QueryValue *param = arg;
 902  903          struct winreg_value *pv;
 903  904          char *name;
 904  905          char *value;
 905  906          DWORD slen;
 906  907          DWORD msize;
 907  908  
 908  909          name = (char *)param->value_name.str;
 909  910  
 910      -        if (strcasecmp(name, "PrimaryModule") == 0) {
      911 +        if (name == NULL ||
      912 +            strcasecmp(name, "PrimaryModule") == 0) {
 911  913                  param->status = ERROR_FILE_NOT_FOUND;
 912  914                  return (NDR_DRC_OK);
 913  915          }
 914  916  
 915  917          if ((value = winreg_lookup_value(name)) == NULL) {
 916  918                  param->status = ERROR_CANTREAD;
 917  919                  return (NDR_DRC_OK);
 918  920          }
 919  921  
 920  922          slen = smb_wcequiv_strlen(value) + sizeof (smb_wchar_t);
↓ open down ↓ 144 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX