diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-30 20:33:33 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-30 20:33:33 -0500 |
| commit | 14eeee88bfb439a3dc9449f94c23a21930cbe35b (patch) | |
| tree | 9c87086c2836c475040cb2b6f94421cb92d79014 | |
| parent | 5b8f258758494315b69d568661a2823e24d4ad6f (diff) | |
| parent | d69e83d99cf87e3328c47bb54684360e32aef17d (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6:
jfs: ensure symlinks are NUL-terminated
| -rw-r--r-- | fs/jfs/inode.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/jfs/inode.c b/fs/jfs/inode.c index 210339784b56..b00ee9f05a06 100644 --- a/fs/jfs/inode.c +++ b/fs/jfs/inode.c | |||
| @@ -59,8 +59,14 @@ struct inode *jfs_iget(struct super_block *sb, unsigned long ino) | |||
| 59 | if (inode->i_size >= IDATASIZE) { | 59 | if (inode->i_size >= IDATASIZE) { |
| 60 | inode->i_op = &page_symlink_inode_operations; | 60 | inode->i_op = &page_symlink_inode_operations; |
| 61 | inode->i_mapping->a_ops = &jfs_aops; | 61 | inode->i_mapping->a_ops = &jfs_aops; |
| 62 | } else | 62 | } else { |
| 63 | inode->i_op = &jfs_symlink_inode_operations; | 63 | inode->i_op = &jfs_symlink_inode_operations; |
| 64 | /* | ||
| 65 | * The inline data should be null-terminated, but | ||
| 66 | * don't let on-disk corruption crash the kernel | ||
| 67 | */ | ||
| 68 | JFS_IP(inode)->i_inline[inode->i_size] = '\0'; | ||
| 69 | } | ||
| 64 | } else { | 70 | } else { |
| 65 | inode->i_op = &jfs_file_inode_operations; | 71 | inode->i_op = &jfs_file_inode_operations; |
| 66 | init_special_inode(inode, inode->i_mode, inode->i_rdev); | 72 | init_special_inode(inode, inode->i_mode, inode->i_rdev); |
