path: root/arch/alpha/lib
AgeCommit message (Collapse)AuthorFilesLines
2016-03-13ipv4: Update parameters for csum_tcpudp_magic to their original typesAlexander Duyck1-6/+2
This patch updates all instances of csum_tcpudp_magic and csum_tcpudp_nofold to reflect the types that are usually used as the source inputs. For example the protocol field is populated based on nexthdr which is actually an unsigned 8 bit value. The length is usually populated based on skb->len which is an unsigned integer. This addresses an issue in which the IPv6 function csum_ipv6_magic was generating a checksum using the full 32b of skb->len while csum_tcpudp_magic was only using the lower 16 bits. As a result we could run into issues when attempting to adjust the checksum as there was no protocol agnostic way to update it. With this change the value is still truncated as many architectures use "(len + proto) << 8", however this truncation only occurs for values greater than 16776960 in length and as such is unlikely to occur as we stop the inner headers at ~64K in size. I did have to make a few minor changes in the arm, mn10300, nios2, and score versions of the function in order to support these changes as they were either using things such as an OR to combine the protocol and length, or were using ntohs to convert the length which would have truncated the value. I also updated a few spots in terms of whitespace and type differences for the addresses. Most of this was just to make sure all of the definitions were in sync going forward. Signed-off-by: Alexander Duyck <> Signed-off-by: David S. Miller <>
2015-09-17alpha: lib: export __delaySudip Mukherjee1-0/+1
__delay was not exported as a result while building with allmodconfig we were getting build error of undefined symbol. __delay is being used by: drivers/net/phy/mdio-octeon.c Signed-off-by: Sudip Mukherjee <> Cc: Richard Henderson <> Cc: Ivan Kokshaysky <> Cc: Matt Turner <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2014-01-31alpha: fix broken network checksumMikulas Patocka1-2/+7
The patch 3ddc5b46a8e90f3c9251338b60191d0a804b0d92 breaks networking on alpha (there is a follow-up fix 5cfe8f1ba5eebe6f4b6e5858cdb1a5be4f3272a6, but networking is still broken even with the second patch). The patch 3ddc5b46a8e90f3c9251338b60191d0a804b0d92 makes csum_partial_copy_from_user check the pointer with access_ok. However, csum_partial_copy_from_user is called also from csum_partial_copy_nocheck and csum_partial_copy_nocheck is called on kernel pointers and it is supposed not to check pointer validity. This bug results in ssh session hangs if the system is loaded and bulk data are printed to ssh terminal. This patch fixes csum_partial_copy_nocheck to call set_fs(KERNEL_DS), so that access_ok in csum_partial_copy_from_user accepts kernel-space addresses. Cc: Signed-off-by: Mikulas Patocka <> Signed-off-by: Matt Turner <>
2013-11-16alpha: Prevent a NULL ptr dereference in csum_partial_copy.Jay Estabrook1-5/+5
Introduced by 3ddc5b46a8e90f3c92 ("kernel-wide: fix missing validations on __get/__put/__copy_to/__copy_from_user()"). Also fix some other places which could be problematic in a similar way, although they hadn't been proved so, as far as I can tell. Cc: Michael Cree <> Signed-off-by: Matt Turner <>
2013-11-16alpha: Eliminate compiler warning from memset macroRichard Henderson2-9/+14
Compiling with GCC 4.8 yields several instances of crypto/vmac.c: In function ‘vmac_final’: crypto/vmac.c:616:9: warning: value computed is not used [-Wunused-value] memset(&mac, 0, sizeof(vmac_t)); ^ arch/alpha/include/asm/string.h:31:25: note: in definition of macro ‘memset’ ? __builtin_memset((s),0,(n)) \ ^ Converting the macro to an inline function eliminates this problem. However, doing only that causes problems with the GCC 3.x series. The inline function cannot be named "memset", as otherwise we wind up with recursion via __builtin_memset. Solve this by adjusting the symbols such that __memset is the inline, and ___memset is the real function. Signed-off-by: Richard Henderson <>
2013-09-11kernel-wide: fix missing validations on __get/__put/__copy_to/__copy_from_user()Mathieu Desnoyers1-0/+5
I found the following pattern that leads in to interesting findings: grep -r "ret.*|=.*__put_user" * grep -r "ret.*|=.*__get_user" * grep -r "ret.*|=.*__copy" * The __put_user() calls in compat_ioctl.c, ptrace compat, signal compat, since those appear in compat code, we could probably expect the kernel addresses not to be reachable in the lower 32-bit range, so I think they might not be exploitable. For the "__get_user" cases, I don't think those are exploitable: the worse that can happen is that the kernel will copy kernel memory into in-kernel buffers, and will fail immediately afterward. The alpha csum_partial_copy_from_user() seems to be missing the access_ok() check entirely. The fix is inspired from x86. This could lead to information leak on alpha. I also noticed that many architectures map csum_partial_copy_from_user() to csum_partial_copy_generic(), but I wonder if the latter is performing the access checks on every architectures. Signed-off-by: Mathieu Desnoyers <> Cc: Richard Henderson <> Cc: Ivan Kokshaysky <> Cc: Matt Turner <> Cc: Jens Axboe <> Cc: Oleg Nesterov <> Cc: David Miller <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2012-08-19alpha: Use new generic strncpy_from_user() and strnlen_user()Michael Cree5-963/+0
Similar to x86/sparc/powerpc implementations except: 1) we implement an extremely efficient has_zero()/find_zero() sequence with both prep_zero_mask() and create_zero_mask() no-operations. 2) Our output from prep_zero_mask() differs in that only the lowest eight bits are used to represent the zero bytes nevertheless it can be safely ORed with other similar masks from prep_zero_mask() and forms input to create_zero_mask(), the two fundamental properties prep_zero_mask() must satisfy. Tests on EV67 and EV68 CPUs revealed that the generic code is essentially as fast (to within 0.5% of CPU cycles) of the old Alpha specific code for large quadword-aligned strings, despite the 30% extra CPU instructions executed. In contrast, the generic code for unaligned strings is substantially slower (by more than a factor of 3) than the old Alpha specific code. Signed-off-by: Michael Cree <> Acked-by: Matt Turner <> Signed-off-by: Linus Torvalds <>
2012-03-28Disintegrate asm/system.h for AlphaDavid Howells1-1/+0
Disintegrate asm/system.h for Alpha. Signed-off-by: David Howells <> cc:
2011-07-26atomic: use <linux/atomic.h>Arun Sharma1-1/+1
This allows us to move duplicated code in <asm/atomic.h> (atomic_inc_not_zero() for now) to <linux/atomic.h> Signed-off-by: Arun Sharma <> Reviewed-by: Eric Dumazet <> Cc: Ingo Molnar <> Cc: David Miller <> Cc: Eric Dumazet <> Acked-by: Mike Frysinger <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2011-03-31Fix common misspellingsLucas De Marchi3-3/+3
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <>
2011-01-17alpha: change to new Makefile flag variablesmatt mooney1-2/+2
Signed-off-by: matt mooney <> Signed-off-by: Matt Turner <>
2008-01-28remove __attribute_used__Adrian Bunk1-2/+1
Remove the deprecated __attribute_used__. [Introduce __section in a few places to silence checkpatch /sam] Signed-off-by: Adrian Bunk <> Signed-off-by: Sam Ravnborg <>
2007-12-17alpha: strncpy/strncat fixesIvan Kokshaysky3-15/+15
First of all, thanks to Bob Tracy <> and Michael Cree <> for testing. Especially to Bob, as he has done titanic multi-day git-bisect work that finally helped to reproduce and nail down the bug ( [ev6-]stxncpy.S: it's t12, not t2 register that is supposed to contain the last byte offset upon return. As a result of wrong register use (which was my fault back in 2003, IIRC), under some circumstances extra terminating zero bytes were added to destination string. This particularly led to incorrect DEVPATH strings generated in uevent and therefore to udev problems. strncpy.S: unrelated bug I found while testing the above fix - destination is not properly zero-padded then a byte count exceeds source length. Actually this is addition to strncpy fix from last year. Signed-off-by: Ivan Kokshaysky <> Cc: Richard Henderson <> Cc: Bob Tracy <> Cc: Michael Cree <> Cc: Kay Sievers <> Cc: "Rafael J. Wysocki" <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2007-10-20spelling fixes: arch/alpha/Simon Arlott2-2/+2
Spelling fixes in arch/alpha/. Signed-off-by: Simon Arlott <> Signed-off-by: Adrian Bunk <>
2007-10-19remove asm/bitops.h includesJiri Slaby1-1/+1
remove asm/bitops.h includes including asm/bitops directly may cause compile errors. don't include it and include linux/bitops instead. next patch will deny including asm header directly. Cc: Adrian Bunk <> Signed-off-by: Jiri Slaby <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2007-10-14kbuild: enable 'make CFLAGS=...' to add additional options to CCSam Ravnborg1-1/+1
The variable CFLAGS is a wellknown variable and the usage by kbuild may result in unexpected behaviour. On top of that several people over time has asked for a way to pass in additional flags to gcc. This patch replace use of CFLAGS with KBUILD_CFLAGS all over the tree and enabling one to use: make CFLAGS=... to specify additional gcc commandline options. One usecase is when trying to find gcc bugs but other use cases has been requested too. Patch was tested on following architectures: alpha, arm, i386, x86_64, mips, sparc, sparc64, ia64, m68k Test was simple to do a defconfig build, apply the patch and check that nothing got rebuild. Signed-off-by: Sam Ravnborg <>
2007-07-17missing exports of csum_...Al Viro1-0/+1
Signed-off-by: Al Viro <> Acked-by: David S. Miller <> Acked-by: Geert Uytterhoeven <> Signed-off-by: Linus Torvalds <>
2007-06-24alpha: fix alignment problem in csum_ipv6_magic()Ivan Kokshaysky2-23/+70
Hopefully this fixes The struct in6_addr passed to csum_ipv6_magic() is 4 byte aligned, so we can't use the regular 64-bit loads. Since the cost of handling of 4 byte and 1 byte aligned 64-bit data is roughly the same, this code can cope with any src/dst [mis]alignment. Signed-off-by: Ivan Kokshaysky <> Cc: Richard Henderson <> Cc: Dustin Marquess <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2007-05-30alpha: cleanup in bitops.hRichard Henderson2-1/+40
Remove 2 functions private to the alpha implemetation, in favor of similar functions in <linux/log2.h>. Provide a more efficient version of the fls64 function for pre-ev67 alphas. Signed-off-by: Richard Henderson <> Signed-off-by: Linus Torvalds <>
2007-04-26[STRING]: Move strcasecmp/strncasecmp to lib/string.cDavid S. Miller2-27/+0
We have several platforms using local copies of identical code. Signed-off-by: David S. Miller <>
2006-12-02[NET]: Alpha checksum annotations and cleanups.Al Viro2-42/+26
* sanitize prototypes and annotate * kill useless access_ok() in csum_partial_copy_from_user() (the only caller checks it already). * do_csum_partial_copy_from_user() is not needed now * replace htons(len) with len << 8 - they are the same wrt checksums on little-endian. Signed-off-by: Al Viro <> Signed-off-by: David S. Miller <>
2006-10-03fix file specification in commentsUwe Zeisberger3-3/+3
Many files include the filename at the beginning, serveral used a wrong one. Signed-off-by: Uwe Zeisberger <> Signed-off-by: Adrian Bunk <>
2006-06-30Remove obsolete #include <linux/config.h>Jörn Engel2-2/+0
Signed-off-by: Jörn Engel <> Signed-off-by: Adrian Bunk <>
2006-04-25[PATCH] Alpha: strncpy() fixIvan Kokshaysky1-4/+4
As it turned out after recent SCSI changes, strncpy() was broken - it mixed up the return values from __stxncpy() in registers $24 and $27. Thanks to Mathieu Chouquet-Stringer for tracking down the problem and providing an excellent test case. Signed-off-by: Ivan Kokshaysky <> Signed-off-by: Linus Torvalds <>
2006-03-26[PATCH] bitops: alpha: use config options instead of __alpha_fix__ and ↵Akinobu Mita2-5/+5
__alpha_cix__ Use config options instead of gcc builtin definition to tell the use of instruction set extensions (CIX and FIX). This is introduced to tell the kbuild system the use of opmized hweight*() routines on alpha architecture. Signed-off-by: Akinobu Mita <> Cc: Richard Henderson <> Cc: Ivan Kokshaysky <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2005-09-09kbuild: alpha,x86_64 use generic asm-offsets.h supportSam Ravnborg2-2/+2
Delete obsolete stuff from arch makefiles Rename .h file to asm-offsets.h Signed-off-by: Sam Ravnborg <>
2005-04-16Linux-2.6.12-rc2Linus Torvalds53-0/+7901
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!