On Wed, Feb 17, 2016 at 11:27:29AM -0700, Todd C. Miller wrote:
> On Wed, 17 Feb 2016 10:22:04 +0100, Martin Natano wrote:
> 
> > Casting the result of ext2fs_size() and DIP(ip, size) to int potentially
> > truncates the result. Issue found by Stefan Kempf, see
> > https://marc.info/?l=openbsd-tech&m=145495905416536 .
> > 
> > While there I also removed the cast in the ext2fs_chmod() call, because
> > the function expects a mode_t argument anyway.
> 
> There is currently code that checks for mnt_maxsymlinklen <= 0.
> Removing the cast will cause other problems for ffs if the maxsymlinklen
> value is negative.  I don't think it is safe to make this change
> unless mnt_maxsymlinklen is made unsigned in struct mount and a
> check is added to the assignment of mnt_maxsymlinklen from
> fs_maxsymlinklen in ufs/ffs/ffs_vfsops.c to avoid assigning a
> negative value.

Thank you for your input, I somehow missed that mnt_maxsymlinklen might
be negative. This will need more work.

natano

Reply via email to