From: Christoph Hellwig <hch@infradead.org>
To: Ken Chen <kenchen@google.com>
Cc: Adam Litke <agl@us.ibm.com>,
William Lee Irwin III <wli@holomorphy.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [patch 2/2] hugetlb: add /dev/hugetlb char device
Date: Sat, 24 Mar 2007 07:41:29 +0000 [thread overview]
Message-ID: <20070324074129.GB18408@infradead.org> (raw)
In-Reply-To: <b040c32a0703231545h79d45d0eof1edd225ef3d8ee9@mail.gmail.com>
> +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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2007-03-24 7:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-23 22:45 Ken Chen
2007-03-24 7:41 ` Christoph Hellwig [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070324074129.GB18408@infradead.org \
--to=hch@infradead.org \
--cc=agl@us.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=kenchen@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=wli@holomorphy.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox