Mercurial > illumos > illumos-gate
diff usr/src/uts/common/fs/nfs/nfs_server.c @ 13985:ad441dd34478
Back out hg changeset 829c00a55a37, bug 2986 -- introduces vulnerability
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Approved by: Dan McDonald <danmcd@nexenta.com>
author | Marcel Telka <marcel.telka@nexenta.com> |
---|---|
date | Thu, 14 Mar 2013 17:58:04 -0400 |
parents | 829c00a55a37 |
children | bcbb822da4dd |
line wrap: on
line diff
--- a/usr/src/uts/common/fs/nfs/nfs_server.c Tue Mar 12 19:31:47 2013 -0400 +++ b/usr/src/uts/common/fs/nfs/nfs_server.c Thu Mar 14 17:58:04 2013 -0400 @@ -21,7 +21,6 @@ /* * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 Bayard G. Bell. All rights reserved. - * Copyright 2012 Nexenta Systems, Inc. All rights reserved. */ /* @@ -2801,8 +2800,8 @@ */ /* Release the reference on the old exi value */ + ASSERT(*exi != NULL); exi_rele(*exi); - *exi = NULL; if (error = nfs_check_vpexi(mc_dvp, *vpp, kcred, exi)) { VN_RELE(*vpp); @@ -2815,9 +2814,6 @@ if (mc_dvp) VN_RELE(mc_dvp); - if (error && *exi != NULL) - exi_rele(*exi); - return (error); } @@ -2963,19 +2959,16 @@ /* * Get the export information for the lookup vnode, and verify its * useable. - * - * Set @exip only in success */ int nfs_check_vpexi(vnode_t *mc_dvp, vnode_t *vp, cred_t *cr, - struct exportinfo **exip) + struct exportinfo **exi) { int walk; int error = 0; - struct exportinfo *exi; - - exi = nfs_vptoexi(mc_dvp, vp, cr, &walk, NULL, FALSE); - if (exi == NULL) + + *exi = nfs_vptoexi(mc_dvp, vp, cr, &walk, NULL, FALSE); + if (*exi == NULL) error = EACCES; else { /* @@ -2984,13 +2977,10 @@ * must not terminate below the * exported directory. */ - if (exi->exi_export.ex_flags & EX_NOSUB && walk > 0) { + if ((*exi)->exi_export.ex_flags & EX_NOSUB && walk > 0) error = EACCES; - exi_rele(exi); - } } - if (error == 0) - *exip = exi; + return (error); }