lkml.org 
[lkml]   [2005]   [Sep]   [5]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateSun, 04 Sep 2005 21:08:48 -0700 (PDT)
SubjectRe: x86-cache-pollution-aware-__copy_from_user_ll.patch added to -mm tree
From"David S. Miller" <>
From: Dave Jones <davej@redhat.com>
Subject: Re: x86-cache-pollution-aware-__copy_from_user_ll.patch added to -mm tree
Date: Sun, 4 Sep 2005 16:23:33 -0400

> On Sun, Sep 04, 2005 at 01:16:00PM -0700, Andrew Morton wrote:
>  >  unsigned long __copy_to_user_ll(void __user *to, const void *from, unsigned long n)
>  >  {
>  >  	BUG_ON((long) n < 0);
> 
> Ehh? It's unsigned. This will never be true.

It's to catch the user slipping in enormous lengths to
the user copy routines.

Sparc64 makes this check as well.  From U3memcpy.S:

	srlx		%o2, 31, %g2
	cmp		%g2, 0
	tne		%xcc, 5

%o2 is the length, we make sure the upper 33-bits are clear.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-09-05 04:10    [from the cache]
©2003-2008