[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTi=K4X3oK2oNVQiysL3FwSv0HtViPfkrgpY4t9YD@mail.gmail.com>
Date: Wed, 17 Nov 2010 12:07:17 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: David Miller <davem@...emloft.net>
Cc: drosenberg@...curity.com, andy.grover@...cle.com,
netdev@...r.kernel.org, security@...nel.org
Subject: Re: [Security] [PATCH] Integer overflow in RDS cmsg handling
On Wed, Nov 17, 2010 at 9:52 AM, David Miller <davem@...emloft.net> wrote:
>
> Applied, thanks Dan.
Why is the cast there? It looks really odd. And it's definitely
pointless, since nr_local is already "uint64_t".
If the issue is that people don't want to worry about the signedness
of nr_local (which isn't obvious in the local scope), then I think it
would be _much_ better to write the code as
if (args->nr_local < 0 || args->nr_local >UIO_MAXIOV)
than to have an illogical cast in there. Maybe we should add a helper
function ("in_range()" or whatever) that does this.
IOW, maybe something like
if (!in_range(args->nr_local, 0, UID_MAXIOV))
would be nicer? With some appropriate macro magic to make it all type-safe?
Linus
--
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