ROMFS: fix length used with romfs_dev_strnlen() function
PATCH 1/1 ROMFS: fix length used with romfs_dev_strnlen() function
From: Bernd Schmidt <[email protected]>
An interestingly corrupted romfs file system exposed a problem with the romfs_dev_strnlen function: it's passing the wrong value to its helpers. Rather than limit the string to the length passed in by the callers, it uses the size of the device as the limit.
Signed-off-by Bernd Schmidt <[email protected]>
Signed-off-by Mike Frysinger <[email protected]>
--- fs/romfs/storage.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
fs/romfs/storage.c +2 -2
@@ -253,11 +253,11 @@ ssize_t romfs_dev_strnlen(struct super_block *sb,#ifdef CONFIG_ROMFS_ON_MTD if (sb->s_mtd) -return romfs_mtd_strnlen (sb, pos, limit); +return romfs_mtd_strnlen (sb, pos, maxlen);#endif #ifdef CONFIG_ROMFS_ON_BLOCK if (sb->s_bdev) -return romfs_blk_strnlen (sb, pos, limit); +return romfs_blk_strnlen (sb, pos, maxlen);#endif return -EIO ; }
Signature · 1 line
1.6.5.rc2
PATCH 1/1 ROMFS: fix length used with romfs_dev_strnlen() function
From: Bernd Schmidt <[email protected]>
An interestingly corrupted romfs file system exposed a problem with the romfs_dev_strnlen function: it's passing the wrong value to its helpers. Rather than limit the string to the length passed in by the callers, it uses the size of the device as the limit.
Signed-off-by Bernd Schmidt <[email protected]>
Signed-off-by Mike Frysinger <[email protected]>
Signed-off-by David Howells <[email protected]>
---
fs/romfs/storage.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
fs/romfs/storage.c +2 -2
@@ -253,11 +253,11 @@ ssize_t romfs_dev_strnlen(struct super_block *sb,#ifdef CONFIG_ROMFS_ON_MTD if (sb->s_mtd) -return romfs_mtd_strnlen (sb, pos, limit); +return romfs_mtd_strnlen (sb, pos, maxlen);#endif #ifdef CONFIG_ROMFS_ON_BLOCK if (sb->s_bdev) -return romfs_blk_strnlen (sb, pos, limit); +return romfs_blk_strnlen (sb, pos, maxlen);#endif return -EIO ; }