Skip to content

Commit 981567b

Browse files
Ronnie Sahlbergsmfrench
authored andcommitted
cifs: use the correct max-length for dentry_path_raw()
RHBZ: 1972502 PATH_MAX is 4096 but PAGE_SIZE can be >4096 on some architectures such as ppc and would thus write beyond the end of the actual object. Cc: <[email protected]> Reported-by: Xiaoli Feng <[email protected]> Suggested-by: Brian foster <[email protected]> Reviewed-by: Paulo Alcantara (SUSE) <[email protected]> Signed-off-by: Ronnie Sahlberg <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 7d3fc01 commit 981567b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/cifs/dir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ build_path_from_dentry_optional_prefix(struct dentry *direntry, void *page,
100100
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_USE_PREFIX_PATH)
101101
pplen = cifs_sb->prepath ? strlen(cifs_sb->prepath) + 1 : 0;
102102

103-
s = dentry_path_raw(direntry, page, PAGE_SIZE);
103+
s = dentry_path_raw(direntry, page, PATH_MAX);
104104
if (IS_ERR(s))
105105
return s;
106106
if (!s[1]) // for root we want "", not "/"

0 commit comments

Comments
 (0)