Print this page
Try to remove assumption that zone's root vnode is marked VROOT

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/nfs/nfs_srv.c
          +++ new/usr/src/uts/common/fs/nfs/nfs_srv.c
↓ open down ↓ 403 lines elided ↑ open up ↑
 404  404   * Given mounted "dvp" and "exi", go upper mountpoint
 405  405   * with dvp/exi correction
 406  406   * Return 0 in success
 407  407   */
 408  408  int
 409  409  rfs_climb_crossmnt(vnode_t **dvpp, struct exportinfo **exip, cred_t *cr)
 410  410  {
 411  411          struct exportinfo *exi;
 412  412          vnode_t *dvp = *dvpp;
 413  413  
 414      -        ASSERT(dvp->v_flag & VROOT);
      414 +        ASSERT((dvp->v_flag & VROOT) || VN_IS_CURZONEROOT(dvp));
 415  415  
 416  416          VN_HOLD(dvp);
 417  417          dvp = untraverse(dvp);
 418  418          exi = nfs_vptoexi(NULL, dvp, cr, NULL, NULL, FALSE);
 419  419          if (exi == NULL) {
 420  420                  VN_RELE(dvp);
 421  421                  return (-1);
 422  422          }
 423  423  
 424  424          exi_rele(*exip);
↓ open down ↓ 58 lines elided ↑ open up ↑
 483  483          exi_hold(exi);
 484  484  
 485  485          /*
 486  486           * Not allow lookup beyond root.
 487  487           * If the filehandle matches a filehandle of the exi,
 488  488           * then the ".." refers beyond the root of an exported filesystem.
 489  489           */
 490  490          if (strcmp(da->da_name, "..") == 0 &&
 491  491              EQFID(&exi->exi_fid, (fid_t *)&fhp->fh_len)) {
 492  492                  if ((exi->exi_export.ex_flags & EX_NOHIDE) &&
 493      -                    (dvp->v_flag & VROOT)) {
      493 +                    ((dvp->v_flag & VROOT) || VN_IS_CURZONEROOT(dvp))) {
 494  494                          /*
 495  495                           * special case for ".." and 'nohide'exported root
 496  496                           */
 497  497                          if (rfs_climb_crossmnt(&dvp, &exi, cr) != 0) {
 498  498                                  error = NFSERR_ACCES;
 499  499                                  goto out;
 500  500                          }
 501  501                  } else  {
 502  502                          error = NFSERR_NOENT;
 503  503                          goto out;
↓ open down ↓ 2650 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX