summaryrefslogtreecommitdiffstats
path: root/fs/squashfs/squashfs_fs.h
diff options
context:
space:
mode:
authorPhillip Lougher <phillip@squashfs.org.uk>2013-09-04 02:58:12 +0100
committerPhillip Lougher <phillip@squashfs.org.uk>2013-09-06 04:57:54 +0100
commit9e012423869e1efbae3762b87ceab509027231c9 (patch)
treedd451cda9f1a82f6ea83c645807bb459c51b4bf8 /fs/squashfs/squashfs_fs.h
parentf960cae5357d8e52b8af91e8b1621cae565dffb3 (diff)
downloadblackbird-obmc-linux-9e012423869e1efbae3762b87ceab509027231c9.tar.gz
blackbird-obmc-linux-9e012423869e1efbae3762b87ceab509027231c9.zip
Squashfs: add corruption check for type in squashfs_readdir()
We read the type field from disk. This value should be sanity checked for correctness to avoid an out of bounds access when reading the squashfs_filetype_table array. Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
Diffstat (limited to 'fs/squashfs/squashfs_fs.h')
-rw-r--r--fs/squashfs/squashfs_fs.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/squashfs/squashfs_fs.h b/fs/squashfs/squashfs_fs.h
index 9e2349d07cb1..4b2beda49498 100644
--- a/fs/squashfs/squashfs_fs.h
+++ b/fs/squashfs/squashfs_fs.h
@@ -87,7 +87,7 @@
#define SQUASHFS_COMP_OPTS(flags) SQUASHFS_BIT(flags, \
SQUASHFS_COMP_OPT)
-/* Max number of types and file types */
+/* Inode types including extended types */
#define SQUASHFS_DIR_TYPE 1
#define SQUASHFS_REG_TYPE 2
#define SQUASHFS_SYMLINK_TYPE 3
@@ -103,6 +103,9 @@
#define SQUASHFS_LFIFO_TYPE 13
#define SQUASHFS_LSOCKET_TYPE 14
+/* Max type value stored in directory entry */
+#define SQUASHFS_MAX_DIR_TYPE 7
+
/* Xattr types */
#define SQUASHFS_XATTR_USER 0
#define SQUASHFS_XATTR_TRUSTED 1
OpenPOWER on IntegriCloud