[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20070324074129.GB18408@infradead.org>
Date: Sat, 24 Mar 2007 07:41:29 +0000
From: Christoph Hellwig <hch@...radead.org>
To: Ken Chen <kenchen@...gle.com>
Cc: Adam Litke <agl@...ibm.com>,
William Lee Irwin III <wli@...omorphy.com>,
Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [patch 2/2] hugetlb: add /dev/hugetlb char device
> +int hugetlb_zero_setup(struct file *file, struct vm_area_struct *vma)
> +{
> + file = hugetlb_file_setup(vma->vm_end - vma->vm_start, 0);
> + if (IS_ERR(file))
> + return PTR_ERR(file);
> +
> + if (vma->vm_file)
> + fput(vma->vm_file);
> + vma->vm_file = file;
> + return hugetlbfs_file_mmap(file, vma);
> +}
Setting vma->vm_file to something that is not the file we called mmap
on and even refers to a different inode seems rather dangerous.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists