All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: bug list: range checking issues
Date: Mon, 15 Feb 2010 14:04:35 +0000	[thread overview]
Message-ID: <20100215140435.GL14210@bicker> (raw)
In-Reply-To: <20100215134724.GA4107@x200>

On Mon, Feb 15, 2010 at 03:47:24PM +0200, Alexey Dobriyan wrote:
> On Mon, Feb 15, 2010 at 03:40:56PM +0300, Dan Carpenter wrote:
> > kernel/pid_namespace.c +96 create_pid_namespace(26) warn: buffer overflow 'ns->pidmap' 1 <= 1
> 
> What overflows exactly here?

It's a false positive:

smatch thinks the array ns->pidmap[] has ARRAY_SIZE() of 1 and i is 1.

kernel/pid_namespace.c
    95          for (i = 1; i < PIDMAP_ENTRIES; i++)
    96                  atomic_set(&ns->pidmap[i].nr_free, BITS_PER_PAGE);

On my .config PIDMAP_ENTRIES is 0 so that line is never reached.

regards,
dan carpenter

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <error27@gmail.com>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: bug list: range checking issues
Date: Mon, 15 Feb 2010 17:04:35 +0300	[thread overview]
Message-ID: <20100215140435.GL14210@bicker> (raw)
In-Reply-To: <20100215134724.GA4107@x200>

On Mon, Feb 15, 2010 at 03:47:24PM +0200, Alexey Dobriyan wrote:
> On Mon, Feb 15, 2010 at 03:40:56PM +0300, Dan Carpenter wrote:
> > kernel/pid_namespace.c +96 create_pid_namespace(26) warn: buffer overflow 'ns->pidmap' 1 <= 1
> 
> What overflows exactly here?

It's a false positive:

smatch thinks the array ns->pidmap[] has ARRAY_SIZE() of 1 and i is 1.

kernel/pid_namespace.c
    95          for (i = 1; i < PIDMAP_ENTRIES; i++)
    96                  atomic_set(&ns->pidmap[i].nr_free, BITS_PER_PAGE);

On my .config PIDMAP_ENTRIES is 0 so that line is never reached.

regards,
dan carpenter

  reply	other threads:[~2010-02-15 14:04 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-15 12:40 bug list: range checking issues Dan Carpenter
2010-02-15 12:40 ` Dan Carpenter
2010-02-15 13:47 ` Alexey Dobriyan
2010-02-15 13:47   ` Alexey Dobriyan
2010-02-15 14:04   ` Dan Carpenter [this message]
2010-02-15 14:04     ` Dan Carpenter
2010-02-15 22:08 ` Dave Chinner
2010-02-15 22:08   ` Dave Chinner
2010-02-15 22:20 ` [PATCH] drm/nouveau: fix pramdac_table range checking Marcin Slusarz
2010-02-15 22:20   ` Marcin Slusarz
2010-02-15 22:20   ` Marcin Slusarz
2010-02-17 18:36   ` [Nouveau] " Francisco Jerez
2010-02-17 18:36     ` Francisco Jerez
2010-02-17 18:36     ` Francisco Jerez
2010-02-15 22:22 ` [PATCH] drm/nouveau: fix nouveau_i2c_find bounds checking Marcin Slusarz
2010-02-15 22:22   ` Marcin Slusarz
2010-02-15 22:22   ` Marcin Slusarz
2010-02-16  5:42 ` bug list: range checking issues Dan Carpenter
2010-02-16  5:42   ` Dan Carpenter
2010-02-16 10:00 ` Clemens Ladisch
2010-02-16 10:00   ` Clemens Ladisch
2010-02-16 11:02   ` Jaroslav Kysela
2010-02-16 11:02     ` Jaroslav Kysela

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=20100215140435.GL14210@bicker \
    --to=error27@gmail.com \
    --cc=adobriyan@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --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.