DCCP protocol discussions
 help / color / mirror / Atom feed
From: Gerrit Renker <gerrit@erg.abdn.ac.uk>
To: dccp@vger.kernel.org
Subject: Re: [PATCH 5/8]: Add protection against invalid parameters
Date: Sat, 02 Dec 2006 12:38:11 +0000	[thread overview]
Message-ID: <200612021238.11692@strip-the-willow> (raw)
In-Reply-To: <200612011827.01580@strip-the-willow>

Quoting Ian McDonald:
|  On 12/2/06, Gerrit Renker <gerrit@erg.abdn.ac.uk> wrote:
|  
|  > [DCCP]: Add protection against invalid parameters to TFRC routines
|  >
|  > +       BUG_ON(p >  1000000);           /* p must not exceed 100%   */
|  > +       BUG_ON(p = 0);                 /* f(0) = 0, divide by zero */
|  
|  I know I put the original BUG_ONs in but can we change this to a
|  DCCP_BUG or a WARN - just to prevent the possible issues depending on
|  bottom half context...
I thought about this too and initially both were DCCP_BUG_ON(). However,
this just delays the Kerboom! -- as I have had to learn painfully:
	* case `p > 1000000' leads to accessing illegal memory - kernel panics
	* case `p = 0' leads to division by zero

I have had one kernel Oops because of not making them DCCP_BUG_ON. The good
side of using this is safety: if this condition is met, we will know from console
output, and we will also know that there is serious trouble somewhere else.

  parent reply	other threads:[~2006-12-02 12:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-01 18:27 [PATCH 5/8]: Add protection against invalid parameters Gerrit Renker
2006-12-01 22:50 ` Ian McDonald
2006-12-02 12:38 ` Gerrit Renker [this message]
2006-12-02 18:37 ` Ian McDonald
2006-12-03 15:26 ` Gerrit Renker
2006-12-03 15:30 ` Arnaldo Carvalho de Melo

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=200612021238.11692@strip-the-willow \
    --to=gerrit@erg.abdn.ac.uk \
    --cc=dccp@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox