aboutsummaryrefslogtreecommitdiff
path: root/fs/ext4/namei.c
diff options
context:
space:
mode:
authorGravatar Darrick J. Wong <djwong@us.ibm.com> 2011-10-25 09:18:41 -0400
committerGravatar Theodore Ts'o <tytso@mit.edu> 2011-10-25 09:18:41 -0400
commitcf8039036a6e9c5f7144841925f212a957faf1aa (patch)
tree660c82cd18b64ba27d84edd13336ac42efc04040 /fs/ext4/namei.c
parentext4: update EOFBLOCKS flag on fallocate properly (diff)
downloadlinux-cf8039036a6e9c5f7144841925f212a957faf1aa.tar.gz
linux-cf8039036a6e9c5f7144841925f212a957faf1aa.tar.bz2
linux-cf8039036a6e9c5f7144841925f212a957faf1aa.zip
ext4: prevent stack overrun in ext4_file_open
In ext4_file_open, the filesystem records the mountpoint of the first file that is opened after mounting the filesystem. It does this by allocating a 64-byte stack buffer, calling d_path() to grab the mount point through which this file was accessed, and then memcpy()ing 64 bytes into the superblock's s_last_mounted field, starting from the return value of d_path(), which is stored as "cp". However, if cp > buf (which it frequently is since path components are prepended starting at the end of buf) then we can end up copying stack data into the superblock. Writing stack variables into the superblock doesn't sound like a great idea, so use strlcpy instead. Andi Kleen suggested using strlcpy instead of strncpy. Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/namei.c')
0 files changed, 0 insertions, 0 deletions