⬢ DragonFlyBSD Kernel Audit
DF-3126 / fix.diff
← back to finding ↓ download raw
--- a/sys/vfs/isofs/cd9660/cd9660_vfsops.c
+++ b/sys/vfs/isofs/cd9660/cd9660_vfsops.c
@@ -770,11 +770,14 @@ cd9660_vget_internal(struct mount *mp, ino_t ino, struct vnode **vpp, int reloc,
 	if (isodir == NULL) {
 		int lbn, off;
+		off_t xlbn;
 
-		lbn = lblkno(imp, ino);
-		if (lbn >= imp->volume_space_size) {
+		xlbn = ((off_t)ino) >> imp->im_bshift;
+		if (xlbn >= (off_t)imp->volume_space_size || xlbn < 0) {
 			vx_put(vp);
 			kprintf("fhtovp: lbn exceed volume space %d\n", (int)xlbn);
 			return (ESTALE);
 		}
+		lbn = (int)xlbn;