All of lore.kernel.org
 help / color / mirror / Atom feed
From: daw@cs.berkeley.edu (David Wagner)
To: linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH] mm: Remove ZERO_SIZE_PTR.
Date: Fri, 26 Feb 2010 18:23:06 +0000 (UTC)	[thread overview]
Message-ID: <hm93ia$15p$1@taverner.cs.berkeley.edu> (raw)
In-Reply-To: 201002260838.o1Q8cfr2068194@www262.sakura.ne.jp

Tetsuo Handa  wrote:
>This patch simplifies error checks of both callers/callees from
>
>	((unsigned long)(x) <= (unsigned long) 16)
>
>to
>
>	!(x)

I don't follow.  If you want to avoid integer overflow, the caller
of kmalloc() must check to make sure that the arithmetic operations
it performs do not overflow.  That's true whether or not your patch
is accepted.  An integer overflow in an arithmetic operation can yield
a non-zero value, so checking "!(x)" does not guarantee that there was
no integer overflow involved in the computation of x.

  parent reply	other threads:[~2010-02-26 18:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-26  6:35 [RFC][PATCH] mm: Remove ZERO_SIZE_PTR Tetsuo Handa
2010-02-26  6:59 ` KOSAKI Motohiro
2010-02-26  8:38   ` Tetsuo Handa
2010-02-26  8:44     ` KOSAKI Motohiro
2010-02-26 18:23     ` David Wagner [this message]
2010-02-26  7:26 ` David Wagner
2010-02-26 16:39 ` Christoph Lameter
2010-02-27  0:59   ` Tetsuo Handa
2010-03-03 21:54     ` Pavel Machek

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='hm93ia$15p$1@taverner.cs.berkeley.edu' \
    --to=daw@cs.berkeley.edu \
    --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.