From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Paul Bolle <pebolle@tiscali.nl>
Cc: Arnd Bergmann <arnd@arndb.de>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] raw: test against runtime value of max_raw_minors
Date: Tue, 4 Feb 2014 14:34:19 -0800 [thread overview]
Message-ID: <20140204223419.GB2696@kroah.com> (raw)
In-Reply-To: <1391552592.13156.15.camel@x220>
On Tue, Feb 04, 2014 at 11:23:12PM +0100, Paul Bolle wrote:
> bind_get() checks the device number it is called with. It uses
> MAX_RAW_MINORS for the upper bound. But MAX_RAW_MINORS is set at compile
> time while the actual number of raw devices can be set at runtime. This
> means the test can either be too strict or too lenient. And if the test
> ends up being too lenient bind_get() might try to access memory beyond
> what was allocated for "raw_devices".
>
> So check against the runtime value (max_raw_minors) in this function.
>
> Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
> ---
> drivers/char/raw.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/char/raw.c b/drivers/char/raw.c
> index f3223aa..6e8d65e 100644
> --- a/drivers/char/raw.c
> +++ b/drivers/char/raw.c
> @@ -190,7 +190,7 @@ static int bind_get(int number, dev_t *dev)
> struct raw_device_data *rawdev;
> struct block_device *bdev;
>
> - if (number <= 0 || number >= MAX_RAW_MINORS)
> + if (number <= 0 || number >= max_raw_minors)
Are you sure? For some reason, I thought this was changed to be this
way a long time ago, can you please dig through the git archives, and
even the history.git tree, to verify that this is correct and you aren't
just making this be as it was before?
thanks,
greg k-h
next prev parent reply other threads:[~2014-02-04 22:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-04 22:23 Paul Bolle
2014-02-04 22:34 ` Greg Kroah-Hartman [this message]
2014-02-04 22:50 ` Paul Bolle
2014-02-05 20:11 ` Jan Kara
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=20140204223419.GB2696@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=arnd@arndb.de \
--cc=linux-kernel@vger.kernel.org \
--cc=pebolle@tiscali.nl \
/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
all inboxes | Powered by JetHome®