~axino/redis/+git/trunk:5.0

Last commit made on 2022-01-20
Get this branch:
git clone -b 5.0 https://git.launchpad.net/~axino/redis/+git/trunk

Branch merges

Branch information

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

Recent commits

0582733... by Oran Agra <email address hidden>

remove doc in redis.conf merged by mistake to 5.0 (#10138)

704ba5f... by Oran Agra <email address hidden>

Redis 5.0.14

6facfb7... by Oran Agra <email address hidden>

Fix ziplist and listpack overflows and truncations (CVE-2021-32627, CVE-2021-32628)

- fix possible heap corruption in ziplist and listpack resulting by trying to
  allocate more than the maximum size of 4GB.
- prevent ziplist (hash and zset) from reaching size of above 1GB, will be
  converted to HT encoding, that's not a useful size.
- prevent listpack (stream) from reaching size of above 1GB.
- XADD will start a new listpack if the new record may cause the previous
  listpack to grow over 1GB.
- XADD will respond with an error if a single stream record is over 1GB
- List type (ziplist in quicklist) was truncating strings that were over 4GB,
  now it'll respond with an error.

(cherry picked from commit 68e221a3f98a427805d31c1760b4cdf37ba810ab)

a4b813d... by "<email address hidden>" <email address hidden>

Fix invalid memory write on lua stack overflow {CVE-2021-32626}

When LUA call our C code, by default, the LUA stack has room for 20
elements. In most cases, this is more than enough but sometimes it's not
and the caller must verify the LUA stack size before he pushes elements.

On 3 places in the code, there was no verification of the LUA stack size.
On specific inputs this missing verification could have lead to invalid
memory write:
1. On 'luaReplyToRedisReply', one might return a nested reply that will
   explode the LUA stack.
2. On 'redisProtocolToLuaType', the Redis reply might be deep enough
   to explode the LUA stack (notice that currently there is no such
   command in Redis that returns such a nested reply, but modules might
   do it)
3. On 'ldbRedis', one might give a command with enough arguments to
   explode the LUA stack (all the arguments will be pushed to the LUA
   stack)

This commit is solving all those 3 issues by calling 'lua_checkstack' and
verify that there is enough room in the LUA stack to push elements. In
case 'lua_checkstack' returns an error (there is not enough room in the
LUA stack and it's not possible to increase the stack), we will do the
following:
1. On 'luaReplyToRedisReply', we will return an error to the user.
2. On 'redisProtocolToLuaType' we will exit with panic (we assume this
   scenario is rare because it can only happen with a module).
3. On 'ldbRedis', we return an error.

(cherry picked from commit d32a3f74f2a343846b50920e95754a955c1a10a9)

f621c0a... by "<email address hidden>" <email address hidden>

Fix protocol parsing on 'ldbReplParseCommand' (CVE-2021-32672)

The protocol parsing on 'ldbReplParseCommand' (LUA debugging)
Assumed protocol correctness. This means that if the following
is given:
*1
$100
test
The parser will try to read additional 94 unallocated bytes after
the client buffer.
This commit fixes this issue by validating that there are actually enough
bytes to read. It also limits the amount of data that can be sent by
the debugger client to 1M so the client will not be able to explode
the memory.

(cherry picked from commit 4f95e6809902665ced50646107d174dd8137bcaa)

71be972... by Oran Agra <email address hidden>

Prevent unauthenticated client from easily consuming lots of memory (CVE-2021-32675)

This change sets a low limit for multibulk and bulk length in the
protocol for unauthenticated connections, so that they can't easily
cause redis to allocate massive amounts of memory by sending just a few
characters on the network.
The new limits are 10 arguments of 16kb each (instead of 1m of 512mb)

(cherry picked from commit 3d221e81f3b680543e34942579af190b049ff283)

34f447f... by Oran Agra <email address hidden>

Fix redis-cli / redis-sential overflow on some platforms (CVE-2021-32762)

The redis-cli command line tool and redis-sentinel service may be vulnerable
to integer overflow when parsing specially crafted large multi-bulk network
replies. This is a result of a vulnerability in the underlying hiredis
library which does not perform an overflow check before calling the calloc()
heap allocation function.

This issue only impacts systems with heap allocators that do not perform their
own overflow checks. Most modern systems do and are therefore not likely to
be affected. Furthermore, by default redis-sentinel uses the jemalloc allocator
which is also not vulnerable.

(cherry picked from commit dbb5d95046e6a415fbd32c721c56e9ea32632898)

c043ba7... by Oran Agra <email address hidden>

Fix Integer overflow issue with intsets (CVE-2021-32687)

The vulnerability involves changing the default set-max-intset-entries
configuration parameter to a very large value and constructing specially
crafted commands to manipulate sets

(cherry picked from commit 4cb7075edaaf0584c74eb080d838ca8f56c190e3)

2b0ac74... by YiyuanGUO <email address hidden>

Fix integer overflow in _sdsMakeRoomFor (CVE-2021-41099)

021af76... by Oran Agra <email address hidden>

Redis 5.0.13