From: Ralf Baechle <ralf@linux-mips.org>
To: walter harms <wharms@bfs.de>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
"David S. Miller" <davem@davemloft.net>,
linux-hams@vger.kernel.org, netdev@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [patch] netrom: check that user string is terminated
Date: Wed, 23 Nov 2011 19:12:49 +0000 [thread overview]
Message-ID: <20111123191249.GB7260@linux-mips.org> (raw)
In-Reply-To: <4ECCAD38.9090309@bfs.de>
On Wed, Nov 23, 2011 at 09:22:16AM +0100, walter harms wrote:
> I am not sure that it does what you intends.
> mnemonic is an array and a malicious use may fill it upto the last char
> causing strlen go beyond. perhaps this may help:
Correct, it makes thigs worse. I'm going to reply in detail later tonight,
have to bail out now.
> > if ((dev = nr_ax25_dev_get(nr_route.device)) == NULL)
> > return -EINVAL;
> while you are here:
>
> dev = nr_ax25_dev_get(nr_route.device);
> if ( dev == NULL )
> return -EINVAL;
>
> > if (nr_route.ndigis < 0 || nr_route.ndigis > AX25_MAX_DIGIS) {
>
> if guess "nr_route.ndigis >= AX25_MAX_DIGIS" is intended ?
No, values of 0 .. AX25_MAX_DIGIS are permitted with zero meaning no
digipeater at all.
The actual bug if you want to call it that in this line is cosmetic -
nr_route.ndigis is an unsigned int so nr_route.ndigis < 0 will never become
true. There are other simplifications possible to the error checking
here. I've whipped a cleanup patch for this part of the code.
Ralf
next prev parent reply other threads:[~2011-11-23 19:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-23 6:52 [patch] netrom: check that user string is terminated Dan Carpenter
2011-11-23 8:22 ` walter harms
2011-11-23 19:12 ` Ralf Baechle [this message]
2011-11-23 19:54 ` Dan Carpenter
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=20111123191249.GB7260@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-hams@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=wharms@bfs.de \
/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;
as well as URLs for NNTP newsgroup(s).