mirror of
https://github.com/torvalds/linux.git
synced 2024-12-29 06:12:08 +00:00
orangefs: Avoid symlink upcall if target is too long.
Previously the client-core detected this condition by sheer luck! Since we used strncpy, no NUL byte would be included on the name. The client-core would call strlen, which would read past the end of its buffer, but return a number large enough that the client-core would return ENAMETOOLONG. Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
This commit is contained in:
parent
162ada7764
commit
c62da5853d
@ -269,6 +269,9 @@ static int orangefs_symlink(struct inode *dir,
|
||||
if (!symname)
|
||||
return -EINVAL;
|
||||
|
||||
if (strlen(symname)+1 > ORANGEFS_NAME_MAX)
|
||||
return -ENAMETOOLONG;
|
||||
|
||||
new_op = op_alloc(ORANGEFS_VFS_OP_SYMLINK);
|
||||
if (!new_op)
|
||||
return -ENOMEM;
|
||||
|
Loading…
Reference in New Issue
Block a user