NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/56160: Mount ntfs usb disk



The following reply was made to PR kern/56160; it has been noted by GNATS.

From: mlelstv%serpens.de@localhost (Michael van Elst)
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/56160: Mount ntfs usb disk
Date: Sun, 9 May 2021 14:58:49 -0000 (UTC)

 paul%whooppee.com@localhost (Paul Goyette) writes:
 
 > Here's the real stuff from pastebin.com:
 
 > May  9 10:36:23 lancelot /netbsd: [ 2600.5752194] trap type 6 code 0 rip 0xffffffff80869d91 cs 0x8 rflags 0x10206 cr2 0xc0 ilevel 0 rsp 0xffffaf80995628e0
 
 
 > May  9 10:36:23 lancelot /netbsd: [ 2600.5752194] ntfs_findvattr() at netbsd:ntfs_findvattr+0xc8
 > May  9 10:36:23 lancelot /netbsd: [ 2600.5752194] ntfs_ntvattrget() at netbsd:ntfs_ntvattrget+0x266
 > May  9 10:36:23 lancelot /netbsd: [ 2600.5752194] ntfs_loadvnode() at netbsd:ntfs_loadvnode+0xba
 > May  9 10:36:23 lancelot /netbsd: [ 2600.5852243] vcache_get() at netbsd:vcache_get+0x1ef
 > May  9 10:36:23 lancelot /netbsd: [ 2600.5852243] ntfs_vgetex() at netbsd:ntfs_vgetex+0x7a
 > May  9 10:36:23 lancelot /netbsd: [ 2600.5852243] ntfs_mountfs() at netbsd:ntfs_mountfs+0x238
 
 
 
 The code tries to create the system vnodes in ntfs_mountfs():
 
         int pi[3] = { NTFS_MFTINO, NTFS_ROOTINO, NTFS_BITMAPINO };
         for (i = 0; i < 3; i++) {
                 error = VFS_VGET(mp, pi[i], LK_EXCLUSIVE,
                     &(ntmp->ntm_sysvn[pi[i]]));
                 ...
         }
 
 which triggers ntfs_findvattr which calls ntfs_loadntnode() that
 assumes that the system vnodes are alrady fetched:
 
         if (ip->i_number < NTFS_SYSNODESNUM) {
             :
         } else {
                 struct vnode   *vp;
                 vp = ntmp->ntm_sysvn[NTFS_MFTINO];
                 error = ntfs_readattr(ntmp, VTONT(vp), NTFS_A_DATA, NULL,
                 ...
         }
 
 There vp is still NULL and VTONT(vp) dereferences it.
 
 
 This code path seems to be mostly unchanged since netbsd-7 when
 the vnode cache was introduced and that code was refactored.
 


Home | Main Index | Thread Index | Old Index