From: Stephan Mueller The patch ensures that body_size is checked for improper values. Signed-off-by: Stephan Mueller Acked-by: Michael Halcrow Signed-off-by: Andrew Morton --- fs/ecryptfs/keystore.c | 6 ++++++ 1 files changed, 6 insertions(+) diff -puN fs/ecryptfs/keystore.c~ecryptfs-validate-body-size fs/ecryptfs/keystore.c --- 25/fs/ecryptfs/keystore.c~ecryptfs-validate-body-size Tue Jun 27 15:09:33 2006 +++ 25-akpm/fs/ecryptfs/keystore.c Tue Jun 27 15:09:33 2006 @@ -397,6 +397,12 @@ parse_tag_11_packet(unsigned char *data, rc = -EINVAL; goto out; } + if (body_size < 13) { + ecryptfs_printk(KERN_WARNING, "Invalid body size ([%d])\n", + body_size); + rc = -EINVAL; + goto out; + } /* We have 13 bytes of surrounding packet values */ (*tag_11_contents_size) = (body_size - 13); if ((*tag_11_contents_size) > max_contents_bytes) { _