* [patch] net: get rid of redundant access_ok() call in checksum calculation.
@ 2005-01-06 23:35 Jesper Juhl
0 siblings, 0 replies; only message in thread
From: Jesper Juhl @ 2005-01-06 23:35 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-net, netdev, Jorge Cwik, Arnt Gulbrandsen
Hi,
in include/net/checksum.h::csum_and_copy_to_user it would seem that the
access_ok() call before attempting to call copy_to_user() is redundant
since copy_to_user() calls access_ok() internally.
If that is indeed the case then please consider applying the patch below
(if that access_ok() does make sense I'd apreciate to be told why).
Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
diff -up linux-2.6.10-bk9-orig/include/net/checksum.h linux-2.6.10-bk9/include/net/checksum.h
--- linux-2.6.10-bk9-orig/include/net/checksum.h 2004-12-24 22:34:26.000000000 +0100
+++ linux-2.6.10-bk9/include/net/checksum.h 2005-01-07 00:27:05.000000000 +0100
@@ -46,10 +46,9 @@ static __inline__ unsigned int csum_and_
{
sum = csum_partial(src, len, sum);
- if (access_ok(VERIFY_WRITE, dst, len)) {
- if (copy_to_user(dst, src, len) == 0)
- return sum;
- }
+ if (copy_to_user(dst, src, len) == 0)
+ return sum;
+
if (len)
*err_ptr = -EFAULT;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-01-06 23:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-06 23:35 [patch] net: get rid of redundant access_ok() call in checksum calculation Jesper Juhl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®