Fixes a possible memory corruption when the link is larger than MAXPATHLEN and XFS_DEBUG is not enabled. This also uses S_IFLNK to check link not only in DEBUG mode. Signed-off-by: Carlos Maiolino <c
This generally good, but you'll need to fix formatting a bit for both the mail body and the patch itself. Please try to fill up ~ 75 characters for each line in the mail body, e.g. Fix a possible mem
We could get here via xfs_readlink_by_handle, but that tests S_ISLNK(dentry->d_inode->i_mode) before calling xfs_readlink. I'm guessing that we wouldn't get here through normal paths if the inode in
Fixes a possible memory corruption when the link is larger than MAXPATHLEN and XFS_DEBUG is not enabled. This also remove the S_ISLNK assert, since the inode mode is checked previously in xfs_readlin
I know this was discussed to death on IRC. But I didn't get a chance to be a part of that committee so I have a suggested change: use %llu format, not %lld. Just to clarify, this is addressing someth
Looks good. One minor thing for consistency, but consider it: Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx> xfs_alert() is generally used for such messages - it's not a fatal error (yet).... Cheers
Fixes a possible memory corruption when the link is larger than MAXPATHLEN and XFS_DEBUG is not enabled. This also remove the S_ISLNK assert, since the inode mode is checked previously in xfs_readlin
Hey, Alex and Dave I did both changes and sent the path again, so, hopefuly its ok now :-) Alex, if is there anything else you need to change, please, feel free to do. I just read your email and sinc
pathlen is a signed int (32-bit) and di_size has signed 64-bit type. So, even if di_size was verified to be non-negative earlier (is it?)... ...pathlen may be negative here and will pass this check.
I don't konw why, but I *think* the response I thought I sent earlier didn't actually make it out. Just in case, I'm trying to recreate what I had before, below. Sorry if something like this shows up
We should validate that the value isn't negative in xfs_iformat_*, although we currently don't do that. It already verified that it fits into the XFS_DFORK_DSIZE, which should take care of fitting in
That's true, but there are other places where it gets updated, yet not defensively validated. For example, in xfs_dir2_shrink_inode(), if: fsbno > (INT64_MAX >> mp->m_sb.sb_blocklog) then the (signed