Skip to contentSkip to conversation

ia64: csum_partial_copy_nocheck(): don't abuse csum_partial_copy_from_user()

RFC PATCH Guenter Roeck 1 participant 1 message Jun 3, 2020 Generic include/asm header files

lore
Share & tools
lore

Guenter Roeck

author Tested-by
#0 lore raw
Quoted 11 lines · Al Viro
Quoted 10 lines · Guenter Roeck
Quoted 6 lines · Al Viro

From: Al Viro <[email protected]>

Just inline the call and use memcpy() instead of __copy_from_user() and note that the tail is precisely ia64 csum_partial().

This patch results in:

Quoted 8 lines
Quoted 4 lines

arch/ia64/lib/csum_partial_copy.c: In function 'csum_partial_copy_nocheck':
arch/ia64/lib/csum_partial_copy.c:110:9: error: implicit declaration of function 'csum_partial'

for ia64:{defconfig, allnoconfig, tinyconfig}.

Argh...

Yes, that does the trick.

Quoted 14 lines

---

arch/ia64/lib/csum_partial_copy.c +1 -1
index 5d147a33d648..6e82e0be8040 100644
@@ -12,7 +12,7 @@
 #include <linux/types.h>
 #include <linux/string.h>
 
-#include <linux/uaccess.h>
+#include <net/checksum.h>
 
 /*
  * XXX Fixme: those 2 inlines are meant for debugging and will go away