[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111123191249.GB7260@linux-mips.org>
Date: Wed, 23 Nov 2011 19:12:49 +0000
From: Ralf Baechle <ralf@...ux-mips.org>
To: walter harms <wharms@....de>
Cc: Dan Carpenter <dan.carpenter@...cle.com>,
"David S. Miller" <davem@...emloft.net>,
linux-hams@...r.kernel.org, netdev@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: Re: [patch] netrom: check that user string is terminated
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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists