From: Greg KH <gregkh@suse•de>
To: linux-kernel@vger•kernel.org, stable@kernel•org,
linuxppc-dev list <linuxppc-dev@ozlabs•org>
Cc: Theodore Ts'o <tytso@mit•edu>,
Zwane Mwaikambo <zwane@arm•linux.org.uk>,
Justin Forbes <jmforbes@linuxtx•org>,
Domenico Andreoli <cavokz@gmail•com>,
Chris Wedgwood <reviews@ml•cw.f00f.org>,
Paul Mackerras <paulus@samba•org>,
Randy Dunlap <rdunlap@xenotime•net>,
Michael Krufky <mkrufky@linuxtv•org>,
Chuck Ebbert <cebbert@redhat•com>, Dave Jones <davej@redhat•com>,
Chuck Wolber <chuckw@quantumlinux•com>,
akpm@linux-foundation•org, torvalds@linux-foundation•org,
alan@lxorguk•ukuu.org.uk
Subject: [patch 07/12] powerpc: Fix size check for hugetlbfs
Date: Tue, 14 Aug 2007 00:29:18 -0700 [thread overview]
Message-ID: <20070814072918.GG15025@kroah.com> (raw)
In-Reply-To: <20070814072813.GA15025@kroah.com>
-stable review patch. If anyone has any objections, please let us know.
------------------
From: Benjamin Herrenschmidt <benh@kernel•crashing.org>
My "slices" address space management code that was added in 2.6.22
implementation of get_unmapped_area() doesn't properly check that the
size is a multiple of the requested page size. This allows userland to
create VMAs that aren't a multiple of the huge page size with hugetlbfs
(since hugetlbfs entirely relies on get_unmapped_area() to do that
checking) which leads to a kernel BUG() when such areas are torn down.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel•crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba•org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse•de>
---
arch/powerpc/mm/slice.c | 2 ++
1 file changed, 2 insertions(+)
--- a/arch/powerpc/mm/slice.c
+++ b/arch/powerpc/mm/slice.c
@@ -405,6 +405,8 @@ unsigned long slice_get_unmapped_area(un
if (len > mm->task_size)
return -ENOMEM;
+ if (len & ((1ul << pshift) - 1))
+ return -EINVAL;
if (fixed && (addr & ((1ul << pshift) - 1)))
return -EINVAL;
if (fixed && addr > (mm->task_size - len))
--
next parent reply other threads:[~2007-08-14 7:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20070814072244.882283903@mini.kroah.org>
[not found] ` <20070814072813.GA15025@kroah.com>
2007-08-14 7:29 ` Greg KH [this message]
2007-08-14 7:56 ` [patch 07/12] powerpc: Fix size check for hugetlbfs David Gibson
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=20070814072918.GG15025@kroah.com \
--to=gregkh@suse$(echo .)de \
--cc=akpm@linux-foundation$(echo .)org \
--cc=alan@lxorguk$(echo .)ukuu.org.uk \
--cc=cavokz@gmail$(echo .)com \
--cc=cebbert@redhat$(echo .)com \
--cc=chuckw@quantumlinux$(echo .)com \
--cc=davej@redhat$(echo .)com \
--cc=jmforbes@linuxtx$(echo .)org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linuxppc-dev@ozlabs$(echo .)org \
--cc=mkrufky@linuxtv$(echo .)org \
--cc=paulus@samba$(echo .)org \
--cc=rdunlap@xenotime$(echo .)net \
--cc=reviews@ml$(echo .)cw.f00f.org \
--cc=stable@kernel$(echo .)org \
--cc=torvalds@linux-foundation$(echo .)org \
--cc=tytso@mit$(echo .)edu \
--cc=zwane@arm$(echo .)linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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