Fixed vnode corruption by undefined case in union_lookup(). When
uerror == 0 && lerror == EACCES, lowervp == NULLVP and union_allocvp doesn't find existing union node and new union node is created. Sicne it is dificult to cover all the case, union_lookup always returns when union_lookup1() returns EACCES. Submitted by: Naofumi Honda <honda@Kururu.math.sci.hokudai.ac.jp> Obtained from: NetBSD/pc98
This commit is contained in:
parent
685cca7da6
commit
f8fc96b551
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=28101
@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)union_vnops.c 8.32 (Berkeley) 6/23/95
|
||||
* $Id: union_vnops.c,v 1.33 1997/05/03 01:55:19 kato Exp $
|
||||
* $Id: union_vnops.c,v 1.34 1997/05/07 14:37:32 kato Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -286,7 +286,9 @@ union_lookup(ap)
|
||||
/*if (uppervp == upperdvp)
|
||||
dun->un_flags |= UN_KLOCK;*/
|
||||
|
||||
if (cnp->cn_consume != 0) {
|
||||
if (cnp->cn_consume != 0 || uerror == EACCES) {
|
||||
if (uerror == EACCES)
|
||||
uppervp = NULLVP;
|
||||
*ap->a_vpp = uppervp;
|
||||
if (!lockparent)
|
||||
cnp->cn_flags &= ~LOCKPARENT;
|
||||
@ -343,7 +345,9 @@ union_lookup(ap)
|
||||
if (lowervp != lowerdvp)
|
||||
VOP_UNLOCK(lowerdvp, 0, p);
|
||||
|
||||
if (cnp->cn_consume != 0) {
|
||||
if (cnp->cn_consume != 0 || lerror == EACCES) {
|
||||
if (lerror == EACCES)
|
||||
lowervp = NULLVP;
|
||||
if (uppervp != NULLVP) {
|
||||
if (uppervp == upperdvp)
|
||||
vrele(uppervp);
|
||||
|
@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)union_vnops.c 8.32 (Berkeley) 6/23/95
|
||||
* $Id: union_vnops.c,v 1.33 1997/05/03 01:55:19 kato Exp $
|
||||
* $Id: union_vnops.c,v 1.34 1997/05/07 14:37:32 kato Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -286,7 +286,9 @@ union_lookup(ap)
|
||||
/*if (uppervp == upperdvp)
|
||||
dun->un_flags |= UN_KLOCK;*/
|
||||
|
||||
if (cnp->cn_consume != 0) {
|
||||
if (cnp->cn_consume != 0 || uerror == EACCES) {
|
||||
if (uerror == EACCES)
|
||||
uppervp = NULLVP;
|
||||
*ap->a_vpp = uppervp;
|
||||
if (!lockparent)
|
||||
cnp->cn_flags &= ~LOCKPARENT;
|
||||
@ -343,7 +345,9 @@ union_lookup(ap)
|
||||
if (lowervp != lowerdvp)
|
||||
VOP_UNLOCK(lowerdvp, 0, p);
|
||||
|
||||
if (cnp->cn_consume != 0) {
|
||||
if (cnp->cn_consume != 0 || lerror == EACCES) {
|
||||
if (lerror == EACCES)
|
||||
lowervp = NULLVP;
|
||||
if (uppervp != NULLVP) {
|
||||
if (uppervp == upperdvp)
|
||||
vrele(uppervp);
|
||||
|
Loading…
Reference in New Issue
Block a user