lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ