~axino/redis/+git/trunk:arm

Last commit made on 2017-02-19
Get this branch:
git clone -b arm https://git.launchpad.net/~axino/redis/+git/trunk

Branch merges

Branch information

Name:
arm
Repository:
lp:~axino/redis/+git/trunk

Recent commits

7329cc3... by Salvatore Sanfilippo <email address hidden>

ARM: Avoid fast path for BITOP.

GCC will produce certain unaligned multi load-store instructions
that will be trapped by the Linux kernel since ARM v6 cannot
handle them with unaligned addresses. Better to use the slower
but safer implementation instead of generating the exception which
should be anyway very slow.

4e9cf4c... by Salvatore Sanfilippo <email address hidden>

ARM: Use libc malloc by default.

I'm not sure how much test Jemalloc gets on ARM, moreover
compiling Redis with Jemalloc support in not very powerful
devices, like most ARMs people will build Redis on, is extremely
slow. It is possible to enable Jemalloc build anyway if needed
by using "make MALLOC=jemalloc".

72d6d64... by Salvatore Sanfilippo <email address hidden>

ARM: Avoid memcpy() in MurmurHash64A() if we are using 64 bit ARM.

However note that in architectures supporting 64 bit unaligned
accesses memcpy(...,...,8) is likely translated to a simple
word memory movement anyway.

1e272a6... by Salvatore Sanfilippo <email address hidden>

ARM: Fix 64 bit unaligned access in MurmurHash64A().

f917e0d... by antirez <email address hidden>

Fix MIGRATE closing of cached socket on error.

After investigating issue #3796, it was discovered that MIGRATE
could call migrateCloseSocket() after the original MIGRATE c->argv
was already rewritten as a DEL operation. As a result the host/port
passed to migrateCloseSocket() could be anything, often a NULL pointer
that gets deferenced crashing the server.

Now the socket is closed at an earlier time when there is a socket
error in a later stage where no retry will be performed, before we
rewrite the argument vector. Moreover a check was added so that later,
in the socket_err label, there is no further attempt at closing the
socket if the argument was rewritten.

This fix should resolve the bug reported in #3796.

0dbfb1d... by antirez <email address hidden>

Fix ziplist fix...

c495d09... by antirez <email address hidden>

Ziplist: insertion bug under particular conditions fixed.

Ziplists had a bug that was discovered while investigating a different
issue, resulting in a corrupted ziplist representation, and a likely
segmentation foult and/or data corruption of the last element of the
ziplist, once the ziplist is accessed again.

The bug happens when a specific set of insertions / deletions is
performed so that an entry is encoded to have a "prevlen" field (the
length of the previous entry) of 5 bytes but with a count that could be
encoded in a "prevlen" field of a since byte. This could happen when the
"cascading update" process called by ziplistInsert()/ziplistDelete() in
certain contitious forces the prevlen to be bigger than necessary in
order to avoid too much data moving around.

Once such an entry is generated, inserting a very small entry
immediately before it will result in a resizing of the ziplist for a
count smaller than the current ziplist length (which is a violation,
inserting code expects the ziplist to get bigger actually). So an FF
byte is inserted in a misplaced position. Moreover a realloc() is
performed with a count smaller than the ziplist current length so the
final bytes could be trashed as well.

SECURITY IMPLICATIONS:

Currently it looks like an attacker can only crash a Redis server by
providing specifically choosen commands. However a FF byte is written
and there are other memory operations that depend on a wrong count, so
even if it is not immediately apparent how to mount an attack in order
to execute code remotely, it is not impossible at all that this could be
done. Attacks always get better... and we did not spent enough time in
order to think how to exploit this issue, but security researchers
or malicious attackers could.

3a7410a... by antirez <email address hidden>

ziplist: better comments, some refactoring.

27e29f4... by antirez <email address hidden>

Jemalloc updated to 4.4.0.

The original jemalloc source tree was modified to:

1. Remove the configure error that prevents nested builds.
2. Insert the Redis private Jemalloc API in order to allow the
Redis fragmentation function to work.

713fe0b... by Salvatore Sanfilippo <email address hidden>

Merge pull request #3784 from badboy/dont-divide-by-zero

Don't divide by zero