Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
syscalls/rename10: Test long file name too
Commit 5b706c4 ("Provide a PATH_MAX-long buffer when expecting ENAMETOOLONG") modified rename10 in order to prevent out-of-bound uaccess. However, in so doing, it changed the failure mode of the rename() syscall: instead of the path being rejected by the filesystem, due to the file name being too long, it is now rejected directly by the syscall handler as the path itself is too long. This patch adds a new long_name string that triggers the "file name too long" failure mode, while preserving the "path too long" failure mode for long_path. Unlike the original buffer (before commit 5b706c4), no out-of-bound uaccess occurs when passing long_name to rename(), as long_name is a null-terminated string that is short enough to be interpreted as a valid path. Suggested-by: Cyril Hrubis <[email protected]> Signed-off-by: Kevin Brodsky <[email protected]> Reviewed-by: Cyril Hrubis <[email protected]> Reviewed-by: Petr Vorel <[email protected]>
- Loading branch information