mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-14 14:55:41 +00:00
Apply the same fix to a potential race in the ISDOTDOT code in
cd9660_lookup() that was used to fix an actual race in ufs_lookup.c:1.78. This is not currently a hazard, but the bug would be activated by marking cd9660 as MPSAFE. Requested by: bde
This commit is contained in:
parent
9e4ce0ae8f
commit
d31c91fbcf
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=151392
@ -103,7 +103,7 @@ cd9660_lookup(ap)
|
||||
struct vnode *tdp; /* returned by cd9660_vget_internal */
|
||||
u_long bmask; /* block offset mask */
|
||||
int error;
|
||||
ino_t ino = 0;
|
||||
ino_t ino = 0, saved_ino;
|
||||
int reclen;
|
||||
u_short namelen;
|
||||
int isoflags;
|
||||
@ -348,10 +348,11 @@ cd9660_lookup(ap)
|
||||
* it's a relocated directory.
|
||||
*/
|
||||
if (flags & ISDOTDOT) {
|
||||
saved_ino = dp->i_ino;
|
||||
VOP_UNLOCK(pdp, 0, td); /* race to get the inode */
|
||||
error = cd9660_vget_internal(vdp->v_mount, dp->i_ino,
|
||||
error = cd9660_vget_internal(vdp->v_mount, saved_ino,
|
||||
LK_EXCLUSIVE, &tdp,
|
||||
dp->i_ino != ino, ep);
|
||||
saved_ino != ino, ep);
|
||||
brelse(bp);
|
||||
vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY, td);
|
||||
if (error)
|
||||
|
@ -103,7 +103,7 @@ cd9660_lookup(ap)
|
||||
struct vnode *tdp; /* returned by cd9660_vget_internal */
|
||||
u_long bmask; /* block offset mask */
|
||||
int error;
|
||||
ino_t ino = 0;
|
||||
ino_t ino = 0, saved_ino;
|
||||
int reclen;
|
||||
u_short namelen;
|
||||
int isoflags;
|
||||
@ -348,10 +348,11 @@ cd9660_lookup(ap)
|
||||
* it's a relocated directory.
|
||||
*/
|
||||
if (flags & ISDOTDOT) {
|
||||
saved_ino = dp->i_ino;
|
||||
VOP_UNLOCK(pdp, 0, td); /* race to get the inode */
|
||||
error = cd9660_vget_internal(vdp->v_mount, dp->i_ino,
|
||||
error = cd9660_vget_internal(vdp->v_mount, saved_ino,
|
||||
LK_EXCLUSIVE, &tdp,
|
||||
dp->i_ino != ino, ep);
|
||||
saved_ino != ino, ep);
|
||||
brelse(bp);
|
||||
vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY, td);
|
||||
if (error)
|
||||
|
Loading…
Reference in New Issue
Block a user