ashmem: fix deadlock when system is low on memory

When system is low on memory, allocating memory while holding the ashmem_mutex may try to directly reclaim memory. Then ashmem_shrink() is called in same thread. It will deadlock at acquiring ashmem_mutex. This change lets ashmem_shrink() return failure if ashmem_mutex is not available. Memory will be reclaimed from others.
cpufreq: Memory leak with sysfs when stats table are freed
Added improved glibc memcpy and memmove functions.
Added optimized ARM RWSEM algorithm.
Added optimized CRC32 algorithm.
LOAD_FREQ (4*HZ+61) avoids loadavg Moire (thx to Klaus Ripke)
finish applying the LOAD_FREQ (4*HZ+61) avoids loadavg Moire patch from http://ripke.com/loadavg/moire
arm/crypto: Add optimized AES and SHA1 routines Add assembler versions of AES and SHA1 for ARM platforms. This has provided up to a 50% improvement in IPsec/TCP throughout for tunnels using AES128/SHA1.

Signed-off-by: David McCullough <ucdevel@gmail.com>
Fix issue with 100Mhz not sticking The use of the 200Mhz CPU frequency when the GPU is running is not really needed at this point. Allow 100Mhz to behave as normal at all times.
iosched: only compile BFQ, ROW and SIO
Revert "Input: Send events one packet at a time"

This reverts commit 1fada82ee1ae938062f76aea9376771d7fa5e338.
Revert "Reduce battery polling interval"

This reverts commit 2b6cd95ec040a4ad5ceff67248b79edf75e5ca35.
added voodoo color
voodoo color step II

Change-Id: Ic083aa8d21d2f8c45931a6a4d501ccdbb7523e06
printk: fix buffer overflow when calling log_prefix function from call_console_drivers

This patch corrects a buffer overflow in kernels from 3.0 to 3.4 when calling
log_prefix() function from call_console_drivers().

This bug existed in previous releases but has been revealed with commit
162a7e7500f9664636e649ba59defe541b7c2c60 (2.6.39 => 3.0) that made changes
about how to allocate memory for early printk buffer (use of memblock_alloc).
It disappears with commit 7ff9554bb578ba02166071d2d487b7fc7d860d62 (3.4 => 3.5)
that does a refactoring of printk buffer management.

In log_prefix(), the access to "p[0]", "p[1]", "p[2]" or
"simple_strtoul(&p[1], &endp, 10)" may cause a buffer overflow as this
function is called from call_console_drivers by passing "&LOG_BUF(cur_index)"
where the index must be masked to do not exceed the buffer's boundary.

The trick is to prepare in call_console_drivers() a buffer with the necessary
data (PRI field of syslog message) to be safely evaluated in log_prefix().

This patch can be applied to stable kernel branches 3.0.y, 3.2.y and 3.4.y.

Without this patch, one can freeze a server running this loop from shell :
  $ export DUMMY=`cat /dev/urandom | tr -dc '12345AZERTYUIOPQSDFGHJKLMWXCVBNazertyuiopqsdfghjklmwxcvbn' | head -c255`
  $ while true do ; echo $DUMMY > /dev/kmsg ; done

The "server freeze" depends on where memblock_alloc does allocate printk buffer :
if the buffer overflow is inside another kernel allocation the problem may not
be revealed, else the server may hangs up.

Signed-off-by: Alexandre SIMON <Alexandre.Simon@univ-lorraine.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3.0.66
Merge remote-tracking branch 'linux-stable/linux-3.0.y' into nutest
Revert "cpufreq: Memory leak with sysfs when stats table are freed"

This reverts commit cb1b2be7b7fab092a92fe62f78385d97f4c40fbd.
Revert "ashmem: fix deadlock when system is low on memory"

This reverts commit ace82b4fa40648aaa887614921d2983133f691fc.