From: Tom Leete <tleete@mountain.net>
To: linux-kernel@vger.kernel.org
Subject: Race in fs/proc/generic.c:make_inode_number()
Date: Thu, 05 Apr 2001 01:14:52 -0400 [thread overview]
Message-ID: <3ACBFF4C.97AA345F@mountain.net> (raw)
Hello,
The proc_alloc_map bitfield is unprotected by any lock, and
find_first_zero_bit() is not atomic. Concurrent module loading can race
here.
static unsigned char proc_alloc_map[PROC_NDYNAMIC / 8];
static int make_inode_number(void)
{
int i = find_first_zero_bit((void *) proc_alloc_map, PROC_NDYNAMIC);
if (i<0 || i>=PROC_NDYNAMIC)
return -1;
set_bit(i, (void *) proc_alloc_map);
return PROC_DYNAMIC_FIRST + i;
}
Cheers,
Tom
--
The Daemons lurk and are dumb. -- Emerson
next reply other threads:[~2001-04-05 5:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-05 5:14 Tom Leete [this message]
2001-04-05 14:36 ` [PATCH] Re: Race in fs/proc/generic.c:make_inode_number() Tom Leete
2001-04-06 12:01 ` Maneesh Soni
2001-04-06 15:47 ` Tom Leete
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=3ACBFF4C.97AA345F@mountain.net \
--to=tleete@mountain.net \
--cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.