163 Commits

Author SHA1 Message Date
John Sully
f76a52b957 Fix crash in module tests
Former-commit-id: 37423757b54b2052512dcfeaba72ccbd360d3c1e
2020-05-10 21:06:38 -04:00
John Sully
0725491043 Merge commit 'c609bf3f2c7f0982f632f82623ee4802868b8ef1' into redis_6_merge
Former-commit-id: 320bc3c0329ff9e5a980b79426b719addae381cf
2020-04-14 21:04:42 -04:00
John Sully
d48ea996e7 Merge commit '13fbdf970660b15011c4312f31137e58bbda5b2c' into redis_6_merge
Former-commit-id: cde199a7973ad63317b68f581df607321e12bf46
2020-04-14 19:43:04 -04:00
antirez
317496405a Update linenoise. 2020-03-12 15:53:47 +01:00
lifubang
109296b438 update linenoise to fc9667a81d
Signed-off-by: lifubang <lifubang@acmcoder.com>
2020-03-12 15:53:47 +01:00
Seunghoon Woo
9edd6808c8 [FIX] revisit CVE-2015-8080 vulnerability 2020-02-12 14:17:54 +01:00
John Sully
6193e9ad4f Merge remote-tracking branch 'redis/6.0' into redis_merge
Former-commit-id: ef9a3cadcf94326bf2f163db7698aad9a3c01690
2020-01-27 02:55:48 -05:00
Yossi Gottlieb
85d7f38136 Merge remote-tracking branch 'upstream/unstable' into tls 2019-10-16 17:08:07 +03:00
Yossi Gottlieb
10ffeb03e4 TLS: Connections refactoring and TLS support.
* Introduce a connection abstraction layer for all socket operations and
integrate it across the code base.
* Provide an optional TLS connections implementation based on OpenSSL.
* Pull a newer version of hiredis with TLS support.
* Tests, redis-cli updates for TLS support.
2019-10-07 21:06:13 +03:00
Oran Agra
7737e5814a Merge remote-tracking branch 'antirez/unstable' into jemalloc_purge_bg 2019-10-04 13:53:40 +03:00
antirez
d097eebf06 hiredis udpated (RESP3 WIP). 2019-09-23 17:41:04 +02:00
antirez
a84c87cc95 hiredis updated to master version. 2019-09-20 20:08:38 +02:00
Oran Agra
0e07566591 Jemalloc: Avoid blocking on background thread lock for stats.
Background threads may run for a long time, especially when the # of dirty pages
is high.  Avoid blocking stats calls because of this (which may cause latency
spikes).

see https://github.com/jemalloc/jemalloc/issues/1502

cherry picked from commit 1a71533511027dbe3f9d989659efeec446915d6b
2019-06-02 15:27:38 +03:00
John Sully
397e85befb Merge branch 'unstable' of https://github.com/antirez/redis into MergeRedis
Note: some tests failing

Former-commit-id: 86d7276f24f0cf1a0eceb6cd00a6a0ae2a0fa520
2019-05-11 02:20:34 -04:00
Angus Pearson
285bcac992 Add <strings.h> include to deps/hiredis/read.c to fix Implicit Declaration of strcasecmp warning 2019-05-08 11:36:31 +01:00
John Sully
68bec6f239 Move remaning files dependent on server.h over to C++
Former-commit-id: 8c133b605c65212b023d35b3cb71e63b6a4c443a
2019-04-08 01:00:48 -04:00
John Sully
c04002975d Compile issues at O0 optimization
Former-commit-id: 27a420fbc2ada275376982b880dc8f6da935d53e
2019-03-21 21:57:18 +00:00
John Sully
6914dafd6c Prevent so many copies of sdslen getting added
Former-commit-id: 327bbec981feb0d90df416281575953cd71ef6c2
2019-02-10 19:31:46 -05:00
John Sully
f1fc8edb77 Performance enhancements!
Former-commit-id: 7175a8e4ebee74233702b8e308c0d57661b54bac
2019-02-09 13:05:06 -05:00
John Sully
219b0f7441 complete rebranding with tests passing
Former-commit-id: 3e9b8677098059964f3f7a492394da4ede9bd37d
2019-02-09 10:11:46 -05:00
John Sully
979eb00220 complete malloc memory class work, and pass tests
Former-commit-id: 42d28c9ff6bd0b31ada42bdcbfde3e9fce42fff7
2019-02-04 16:56:13 -05:00
John Sully
bb9f3eeb13 Properly integrate memkind
Former-commit-id: 82372cbce84a009ef162a611bb91c7ed67acc9e9
2019-02-01 15:21:00 -05:00
John Sully
833006226d Merge commit '09a263e6076b3fd0fe3b094a2bfad7f93fc997d6' as 'deps/memkind/src'
Former-commit-id: 69b07c5cc2a8f585a8b34bba0b5f7db51be51848
2019-02-01 14:45:39 -05:00
antirez
93dc3267ca RESP3: hiredis: implement bool type. 2019-01-09 17:00:30 +01:00
antirez
f97457cc23 RESP3: hiredis: save the original double string. 2019-01-09 17:00:30 +01:00
antirez
8d8dd89f1c RESP3: hiredis: implement null type. 2019-01-09 17:00:30 +01:00
antirez
193869c653 RESP3: hiredis: fix double implementation. 2019-01-09 17:00:30 +01:00
antirez
1ba5f3222d RESP3: hiredis: initial double implementation. 2019-01-09 17:00:30 +01:00
antirez
e2f2b355d5 RESP3: hiredis: fix hiredis.c assert for new types. 2019-01-09 17:00:29 +01:00
antirez
e3c3c6ce40 RESP3: hiredis: free map and set replies. 2019-01-09 17:00:29 +01:00
antirez
2543ce8ad8 RESP3: hiredis: fix read.c assert for new types. 2019-01-09 17:00:29 +01:00
antirez
facef39abd RESP3: hiredis updated with recent version + some RESP3 support. 2019-01-09 17:00:29 +01:00
Uman Shahzad
188b698989 Remove documentation about geohash-int in deps repo. 2019-01-03 19:12:45 +05:00
Oran Agra
36468e1c26 Active defrag fixes for 32bit builds (again)
* overflow in jemalloc fragmentation hint to the defragger
2018-07-11 16:09:00 +03:00
Jack Drogon
bae1d36e5d Fix typo 2018-07-03 18:19:46 +02:00
Oran Agra
ad7a05292e add defrag hint support into jemalloc 5 2018-06-27 10:52:39 +03:00
antirez
af9b47eca8 Security: fix Lua struct package offset handling.
After the first fix to the struct package I found another similar
problem, which is fixed by this patch. It could be reproduced easily by
running the following script:

    return struct.unpack('f', "xxxxxxxxxxxxx",-3)

The above will access bytes before the 'data' pointer.
2018-06-13 12:40:33 +02:00
antirez
dfa02e19db Security: more cmsgpack fixes by @soloestoy.
@soloestoy sent me this additional fixes, after searching for similar
problems to the one reported in mp_pack(). I'm committing the changes
because it was not possible during to make a public PR to protect Redis
users and give Redis providers some time to patch their systems.
2018-06-13 12:40:33 +02:00
antirez
f98aeb00c2 Security: update Lua struct package for security.
During an auditing Apple found that the "struct" Lua package
we ship with Redis (http://www.inf.puc-rio.br/~roberto/struct/) contains
a security problem. A bound-checking statement fails because of integer
overflow. The bug exists since we initially integrated this package with
Lua, when scripting was introduced, so every version of Redis with
EVAL/EVALSHA capabilities exposed is affected.

Instead of just fixing the bug, the library was updated to the latest
version shipped by the author.
2018-06-13 12:40:33 +02:00
antirez
cbd20a3028 Security: fix Lua cmsgpack library stack overflow.
During an auditing effort, the Apple Vulnerability Research team discovered
a critical Redis security issue affecting the Lua scripting part of Redis.

-- Description of the problem

Several years ago I merged a pull request including many small changes at
the Lua MsgPack library (that originally I authored myself). The Pull
Request entered Redis in commit d29c753f9, in 2014.
Unfortunately one of the changes included a variadic Lua function that
lacked the check for the available Lua C stack. As a result, calling the
"pack" MsgPack library function with a large number of arguments, results
into pushing into the Lua C stack a number of new values proportional to
the number of arguments the function was called with. The pushed values,
moreover, are controlled by untrusted user input.

This in turn causes stack smashing which we believe to be exploitable,
while not very deterministic, but it is likely that an exploit could be
created targeting specific versions of Redis executables. However at its
minimum the issue results in a DoS, crashing the Redis server.

-- Versions affected

Versions greater or equal to Redis 2.8.18 are affected.

-- Reproducing

Reproduce with this (based on the original reproduction script by
Apple security team):

https://gist.github.com/antirez/82445fcbea6d9b19f97014cc6cc79f8a

-- Verification of the fix

The fix was tested in the following way:

1) I checked that the problem is no longer observable running the trigger.
2) The Lua code was analyzed to understand the stack semantics, and that
actually enough stack is allocated in all the cases of mp_pack() calls.
3) The mp_pack() function was modified in order to show exactly what items
in the stack were being set, to make sure that there is no silent overflow
even after the fix.

-- Credits

Thank you to the Apple team and to the other persons that helped me
checking the patch and coordinating this communication.
2018-06-13 12:40:33 +02:00
antirez
6830220c90 Backport hiredis issue 525 fix to compile on FreeBSD.
Close #4947.
2018-05-25 16:33:23 +02:00
antirez
5b1a603cd3 Generate configure for Jemalloc. 2018-05-24 18:21:13 +02:00
antirez
5de964e147 Add --with-version in Jemalloc config script. 2018-05-24 17:50:12 +02:00
antirez
c2430f8571 Specify that Jemalloc configure requires version. 2018-05-24 17:49:36 +02:00
antirez
e3d1823414 Jemalloc upgraded to version 5.0.1. 2018-05-24 17:17:37 +02:00
antirez
9fba9c9701 Update documentation about how to upgrade Jemalloc. 2018-05-24 17:16:12 +02:00
Oran Agra
0bd6e341f5 Active defrag fixes for 32bit builds
problems fixed:
* failing to read fragmentation information from jemalloc
* overflow in jemalloc fragmentation hint to the defragger
* test suite not triggering eviction after population
2018-05-17 09:52:00 +03:00
antirez
412b1733e2 Revert "Jemalloc updated to 4.4.0."
This reverts commit 36c1acc222d29e6e2dc9fc25362e4faa471111bd.
2017-04-22 13:17:07 +02:00
antirez
d69cc12bb3 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.
2017-01-30 09:58:34 +01:00
antirez
e901b0edbf Defrag: activate it only if running modified version of Jemalloc.
This commit also includes minor aesthetic changes like removal of
trailing spaces.
2017-01-10 11:25:39 +01:00