From: Gerrit Renker <gerrit@erg.abdn.ac.uk>
To: dccp@vger.kernel.org
Subject: Re: [PATCH 5/8]: Add protection against invalid parameters
Date: Sun, 03 Dec 2006 15:26:20 +0000 [thread overview]
Message-ID: <200612031526.20401@strip-the-willow> (raw)
In-Reply-To: <200612011827.01580@strip-the-willow>
Quoting Ian McDonald:
| The
| reason I say this is good as in the back of my mind I am thinking of
| people looking for DoS vulnerabilities...
|
| However BUG_ON does work and forces the code to get tidied so the
| condition doesn't occur again. So whichever way I'm happy to go ahead
| with it.
What you are saying is very important and I suggest auditing the code against
calling this function with invalid parameters as next to-do.
I would further like to inform you and Arnaldo that I have ironed out an error
of mine in this patch (uploaded), namely the following
--- a/net/dccp/ccids/lib/tfrc_equation.c
+++ b/net/dccp/ccids/lib/tfrc_equation.c
@@ -19,7 +19,7 @@ #include "tfrc.h"
#define TFRC_CALC_X_ARRSIZE 500
#define TFRC_CALC_X_SPLIT 50000 /* 0.05 * 1000000, details below */
-#define TFRC_SMALLEST_P TFRC_CALC_X_SPLIT/TFRC_CALC_X_ARRSIZE
+#define TFRC_SMALLEST_P (TFRC_CALC_X_SPLIT/TFRC_CALC_X_ARRSIZE)
This is required since later on the code calls
index = p/TFRC_SMALLEST_P -1;
which cpp expands as
index = p/TFRC_CALC_X_SPLIT/TFRC_CALC_X_ARRSIZE -1;
= (p/TFRC_CALC_X_SPLIT)/TFRC_CALC_X_ARRSIZE -1;
since `/' associates to the left. This can lead to an index of -1 (boom!).
This is fixed in the uploaded version.
next prev parent reply other threads:[~2006-12-03 15:26 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
2006-12-02 18:37 ` Ian McDonald
2006-12-03 15:26 ` Gerrit Renker [this message]
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=200612031526.20401@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