From: William Lee Irwin III <wli@holomorphy.com>
To: Andrew Morton <akpm@digeo.com>
Cc: lkml <linux-kernel@vger.kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: 2.5.41-mm2
Date: Thu, 10 Oct 2002 01:18:50 -0700 [thread overview]
Message-ID: <20021010081850.GO10722@holomorphy.com> (raw)
In-Reply-To: <3DA512B1.63287C02@digeo.com>
On Wed, Oct 09, 2002 at 10:40:01PM -0700, Andrew Morton wrote:
> url: http://www.zip.com.au/~akpm/linux/patches/2.5/2.5.41/2.5.41-mm2/
hugetlbfs update:
CAP_IPC_LOCK is required to utilize hugetlb shm segments, memory
allocation, and other facilities. The following patch does three things:
(1) check capable(CAP_IPC_LOCK) in ->f_ops->mmap
This may be redundant but it errors out with less state to
clean up and at least clarifies the fact that checks are
being performed at the relevant entry points.
(2) check capable(CAP_IPC_LOCK) in hugetlbfs_zero_setup()
This is called at shmget() time and is an actual potential
security hole. hugetlb_prefault() does not perform this
check itself, so it must be done here.
--- akpm-2.5.41/fs/hugetlbfs/inode.c 2002-10-08 18:43:39.000000000 -0700
+++ wli-2.5.41/fs/hugetlbfs/inode.c 2002-10-10 00:30:15.000000000 -0700
@@ -56,6 +56,9 @@
struct address_space *mapping = inode->i_mapping;
int ret;
+ if (!capable(CAP_IPC_LOCK))
+ return -EPERM;
+
if (vma->vm_start & ~HPAGE_MASK)
return -EINVAL;
@@ -259,6 +262,9 @@
struct qstr quick_string;
char buf[16];
+ if (!capable(CAP_IPC_LOCK))
+ return ERR_PTR(-EPERM);
+
n = atomic_read(&hugetlbfs_counter);
atomic_inc(&hugetlbfs_counter);
--
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/
prev parent reply other threads:[~2002-10-10 8:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-10 5:40 2.5.41-mm2 Andrew Morton
2002-10-10 5:59 ` 2.5.41-mm2 David S. Miller
2002-10-10 6:45 ` 2.5.41-mm2 Ingo Molnar
2002-10-10 6:44 ` 2.5.41-mm2 Dave Hansen
2002-10-11 4:32 ` 2.5.41-mm2 Dave Hansen
2002-10-11 5:30 ` 2.5.41-mm2 Ingo Molnar
2002-10-10 8:18 ` William Lee Irwin III [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=20021010081850.GO10722@holomorphy.com \
--to=wli@holomorphy.com \
--cc=akpm@digeo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/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