Todd C. Miller wrote: > On Sun, 21 Feb 2016 11:49:55 +0100, Martin Natano wrote: > > > The diff below addresses the issues you mentioned. It converts > > mnt_maxsymlinklen to unsigned and adds a check to ffs_validate() that > > makes sure, that fs_maxsymlinklen is >= 0. That function is called > > during mount and on fsck. This should make sure we won't get a bogus > > fs_maxsymlinklen from the superblock. > > I think it is better to just set fsp->fs_maxsymlinklen to 0 if it > is negative in the superblock. We shouldn't fail to mount the > filesystem in this case.
newfs back to 4.4BSD sets fs_maxsymlinklen to 0 for the "old" format. A negative value should never happen unless this superblock field is corrupted. Should we really mount the FS in that case? If the FS was of the "new" format, then short symlinks would store the destination path in the inode directly. I think we'd not be able to correctly follow these symlinks if we set fs_maxsymlinklen to 0 when encountering a negative value. > - todd