]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: don't crash the vfs on a garbage inline symlink
authorDarrick J. Wong <darrick.wong@oracle.com>
Sat, 29 Sep 2018 03:40:40 +0000 (13:40 +1000)
committerDave Chinner <david@fromorbit.com>
Sat, 29 Sep 2018 03:40:40 +0000 (13:40 +1000)
commit97a7ecd82fb8be2aebcb8c5bc8cf9a07759cc280
tree0e37ce3de3e13f7a2f3c1e00651c25905c70fac6
parentf030a7bb7b1f7de16c1c716a587185e209e25800
xfs: don't crash the vfs on a garbage inline symlink

The VFS routine that calls ->get_link blindly copies whatever's returned
into the user's buffer.  If we return a NULL pointer, the vfs will
crash on the null pointer.  Therefore, return -EFSCORRUPTED instead of
blowing up the kernel.

[dgc: clean up with hch's suggestions]

Reported-by: wen.xu@gatech.edu
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/xfs_iops.c