Print this page
curzone reality check and teardown changes to use the RIGHT zone

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/nfs/nfs3_srv.c
          +++ new/usr/src/uts/common/fs/nfs/nfs3_srv.c
↓ open down ↓ 428 lines elided ↑ open up ↑
 429  429                  resp->status = NFS3ERR_NAMETOOLONG;
 430  430                  goto out1;
 431  431          }
 432  432  
 433  433          if (args->what.name == NULL || *(args->what.name) == '\0') {
 434  434                  resp->status = NFS3ERR_ACCES;
 435  435                  goto out1;
 436  436          }
 437  437  
 438  438          fhp = &args->what.dir;
      439 +        ASSERT3P(curzone, ==, exi->exi_zone); /* exi is guaranteed non-NULL. */
 439  440          if (strcmp(args->what.name, "..") == 0 &&
 440  441              EQFID(&exi->exi_fid, FH3TOFIDP(fhp))) {
 441  442                  if ((exi->exi_export.ex_flags & EX_NOHIDE) &&
 442  443                      ((dvp->v_flag & VROOT) || VN_IS_CURZONEROOT(dvp))) {
 443  444                          /*
 444  445                           * special case for ".." and 'nohide'exported root
 445  446                           */
 446  447                          if (rfs_climb_crossmnt(&dvp, &exi, cr) != 0) {
 447  448                                  resp->status = NFS3ERR_ACCES;
 448  449                                  goto out1;
↓ open down ↓ 869 lines elided ↑ open up ↑
1318 1319  
1319 1320          DTRACE_NFSV3_5(op__write__start, struct svc_req *, req,
1320 1321              cred_t *, cr, vnode_t *, vp, struct exportinfo *, exi,
1321 1322              WRITE3args *, args);
1322 1323  
1323 1324          if (vp == NULL) {
1324 1325                  error = ESTALE;
1325 1326                  goto err;
1326 1327          }
1327 1328  
     1329 +        ASSERT3P(curzone, ==, exi->exi_zone); /* exi is guaranteed non-NULL. */
1328 1330          ns = zone_getspecific(rfs3_zone_key, curzone);
1329 1331          if (is_system_labeled()) {
1330 1332                  bslabel_t *clabel = req->rq_label;
1331 1333  
1332 1334                  ASSERT(clabel != NULL);
1333 1335                  DTRACE_PROBE2(tx__rfs3__log__info__opwrite__clabel, char *,
1334 1336                      "got client label from request(1)", struct svc_req *, req);
1335 1337  
1336 1338                  if (!blequal(&l_admin_low->tsl_label, clabel)) {
1337 1339                          if (!do_rfs_label_check(clabel, vp, EQUALITY_CHECK,
↓ open down ↓ 2780 lines elided ↑ open up ↑
4118 4120  
4119 4121          DTRACE_NFSV3_5(op__commit__start, struct svc_req *, req,
4120 4122              cred_t *, cr, vnode_t *, vp, struct exportinfo *, exi,
4121 4123              COMMIT3args *, args);
4122 4124  
4123 4125          if (vp == NULL) {
4124 4126                  error = ESTALE;
4125 4127                  goto out;
4126 4128          }
4127 4129  
     4130 +        ASSERT3P(curzone, ==, exi->exi_zone); /* exi is guaranteed non-NULL. */
4128 4131          ns = zone_getspecific(rfs3_zone_key, curzone);
4129 4132          bva.va_mask = AT_ALL;
4130 4133          error = VOP_GETATTR(vp, &bva, 0, cr, NULL);
4131 4134  
4132 4135          /*
4133 4136           * If we can't get the attributes, then we can't do the
4134 4137           * right access checking.  So, we'll fail the request.
4135 4138           */
4136 4139          if (error)
4137 4140                  goto out;
↓ open down ↓ 314 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX