[PATCH] shmem: init on stack vmas

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We were hitting a weird bug with our cgroup stuff because shmem uses on stack
vmas.  These aren't properly init'ed so we'd have garbage in vma->mm and bad
things would happen.  Fix this by just init'ing to empty structs.  Thanks,

Signed-off-by: Josef Bacik <jbacik@xxxxxx>
---
 mm/shmem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/shmem.c b/mm/shmem.c
index 902a148..ee6b834 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -911,7 +911,7 @@ static struct mempolicy *shmem_get_sbmpol(struct shmem_sb_info *sbinfo)
 static struct page *shmem_swapin(swp_entry_t swap, gfp_t gfp,
 			struct shmem_inode_info *info, pgoff_t index)
 {
-	struct vm_area_struct pvma;
+	struct vm_area_struct pvma = {};
 	struct page *page;
 
 	/* Create a pseudo vma that just contains the policy */
@@ -932,7 +932,7 @@ static struct page *shmem_swapin(swp_entry_t swap, gfp_t gfp,
 static struct page *shmem_alloc_page(gfp_t gfp,
 			struct shmem_inode_info *info, pgoff_t index)
 {
-	struct vm_area_struct pvma;
+	struct vm_area_struct pvma = {};
 	struct page *page;
 
 	/* Create a pseudo vma that just contains the policy */
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux