summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* HyperLogLog: fix the fix of a corruption bug.4.0antirez2019-07-311-2/+1
|
* Fix HLL corruption bugJohn Sully2019-07-301-0/+1
|
* Redis 4.0.14.4.0.14antirez2019-03-182-1/+15
|
* HyperLogLog: handle wrong offset in the base case.antirez2019-03-181-6/+2
|
* Fix hyperloglog corruptionJohn Sully2019-03-181-0/+6
|
* redis-check-aof: fix potential overflow.antirez2019-03-181-2/+2
| | | | Bug signaled by @vattezhang in PR #5940 but fixed differently.
* Fix mismatching keyspace notification classesGuy Benoish2019-03-142-2/+2
|
* Fix zlexrangespec mem-leak in genericZrangebylexCommandGuy Benoish2019-03-141-1/+4
|
* Make comment in #5911 stay inside 80 cols.antirez2019-03-101-1/+2
|
* Replicas aren't allowed to run the replicaof commandJohn Sully2019-03-101-0/+8
|
* Redis 4.0.13.4.0.13antirez2019-02-202-1/+10
|
* Merge pull request #5822 from soloestoy/rewrite-brpoplpush-4.0Salvatore Sanfilippo2019-01-313-1/+5
|\ | | | | rewrite BRPOPLPUSH as RPOPLPUSH to propagate
| * rewrite BRPOPLPUSH as RPOPLPUSH to propagatezhaozhao.zz2019-01-313-1/+5
|/
* Don't treat unsupported protocols as fatal errorsChris Lamb2018-12-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | If we encounter an unsupported protocol in the "bind" list, don't ipso-facto consider it a fatal error. We continue to abort startup if there are no listening sockets at all. This ensures that the lack of IPv6 support does not prevent Redis from starting on Debian where we try to bind to the ::1 interface by default (via "bind 127.0.0.1 ::1"). A machine with IPv6 disabled (such as some container systems) would simply fail to start Redis after the initiall call to apt(8). This is similar to the case for where "bind" is not specified: https://github.com/antirez/redis/issues/3894 ... and was based on the corresponding PR: https://github.com/antirez/redis/pull/4108 ... but also adds EADDRNOTAVAIL to the list of errors to catch which I believe is missing from there. This issue was raised in Debian as both <https://bugs.debian.org/900284> & <https://bugs.debian.org/914354>.
* Redis 4.0.124.0.12antirez2018-12-112-1/+25
|
* asyncCloseClientOnOutputBufferLimitReached(): don't free fake clients.antirez2018-12-111-0/+1
| | | | | | | | | | | | | | | Fake clients are used in special situations and are not linked to the normal clients list, freeing them will always result in Redis crashing in one way or the other. It's not common to send replies to fake clients, but we have one usage in the modules API. When a client is blocked, we associate to the blocked client object (that is safe to manipulate in a thread), a fake client that accumulates replies. So because of this bug there was the problem described in issue #5443. The fix was verified to work with the provided example module. To write a regression is very hard and unlikely to be triggered in the future.
* Don't call sdscmp() with shared.maxstring or shared.minstringGuy Benoish2018-12-112-9/+23
|
* Fix stringmatchlen() read past buffer bug.antirez2018-12-111-1/+1
| | | | See #5632.
* Merge pull request #5569 from maximebedard/backport-4497Salvatore Sanfilippo2018-11-223-5/+19
|\ | | | | Backport #4497 to redis 4
| * add linkClient(): adds the client and caches the list node.antirez2018-11-133-8/+14
| | | | | | | | | | | | | | | | | | | | We have this operation in two places: when caching the master and when linking a new client after the client creation. By having an API for this we avoid incurring in errors when modifying one of the two places forgetting the other. The function is also a good place where to document why we cache the linked list node. Related to #4497 and #4210.
| * networking: optimize unlinkClient() in freeClient()zhaozhao.zz2018-11-133-4/+12
| |
* | When replica kills a pending RDB save during SYNC, log it.antirez2018-10-311-0/+6
| | | | | | | | This logs what happens in the context of the fix in PR #5367.
* | Move child termination to readSyncBulkPayloadAndrey Bugaevskiy2018-10-311-7/+6
| |
* | Prevent RDB autosave from overwriting full resync resultsAndrey Bugaevskiy2018-10-311-0/+7
| | | | | | | | | | | | During the full database resync we may still have unsaved changes on the receiving side. This causes a race condition between synced data rename/load and the rename of rdbSave tempfile.
* | aof.c: improve indentation and change warning message.antirez2018-10-101-4/+11
| | | | | | | | | | | | | | | | | | | | Related to #5201. I removed the !!! Warning part since compared to the other errors, a missing EXEC is in theory a normal happening in the AOF file, at least in theory: may happen in a differnet number of situations, and it's probably better to don't give the user the feeling that something really bad happened.
* | AOF: discard if we lost EXEC when loading aofzhaozhao.zz2018-10-102-3/+14
| |
* | Fix AOF comment to report the current behavior.antirez2018-10-101-1/+3
|/ | | | Realted to #5201.
* Really bump version number to 4.0.11.4.0.11antirez2018-08-041-1/+1
|
* Redis 4.0.11.antirez2018-08-031-0/+50
|
* Set repl_down_since to zero on state change.antirez2018-08-031-1/+2
| | | | | | | | | | | | | | PR #5081 fixes an "interesting" bug about Redis Cluster failover but in general about the updating of repl_down_since, that is used in order to count the time a slave was left disconnected from its master. While the fix provided resolves the specific issue, in general the validity of repl_down_since is limited to states that are different than the state CONNECTED, and the disconnected time is set when the state is DISCONNECTED. However from CONNECTED to other states, the state machine must always go to DISCONNECTED first. So it makes sense to set the field to zero (since it is meaningless in that context) when the state is set to CONNECTED.
* fix server.repl_down_since resetting, so that slaves could failoverWuYunlong2018-08-031-1/+1
| | | | automatically as expected.
* fix rare replication stream corruption with disk-based replicationOran Agra2018-07-233-9/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The slave sends \n keepalive messages to the master while parsing the rdb, and later sends REPLCONF ACK once a second. rarely, the master recives both a linefeed char and a REPLCONF in the same read, \n*3\r\n$8\r\nREPLCONF\r\n... and it tries to trim two chars (\r\n) from the query buffer, trimming the '*' from *3\r\n$8\r\nREPLCONF\r\n... then the master tries to process a command starting with '3' and replies to the slave a bunch of -ERR and one +OK. although the slave silently ignores these (prints a log message), this corrupts the replication offset at the slave since the slave increases the replication offset, and the master did not. other than the fix in processInlineBuffer, i did several other improvments while hunting this very rare bug. - when redis replies with "unknown command" it includes a portion of the arguments, not just the command name. so it would be easier to understand what was recived, in my case, on the slave side, it was -ERR, but the "arguments" were the interesting part (containing info on the error). - about a year ago i added code in addReplyErrorLength to print the error to the log in case of a reply to master (since this string isn't actually trasmitted to the master), now changed that block to print a similar log message to indicate an error being sent from the master to the slave. note that the slave is marked as CLIENT_SLAVE only after PSYNC was received, so this will not cause any harm for REPLCONF, and will only indicate problems that are gonna corrupt the replication stream anyway. - two places were c->reply was emptied, and i wanted to reset sentlen this is a precaution (i did not actually see such a problem), since a non-zero sentlen will cause corruption to be transmitted on the socket.
* fix exists command on slavezhaozhao.zz2018-06-291-2/+1
|
* Fix infinite loop in dbRandomKey().antirez2018-06-291-0/+13
| | | | | | | Thanks to @kevinmcgehee for signaling the issue and reasoning about the consequences and potential fixes. Issue #5015.
* Sentinel: add an option to deny online script reconfiguration.antirez2018-06-292-0/+41
| | | | | | | | | | | | The ability of "SENTINEL SET" to change the reconfiguration script at runtime is a problem even in the security model of Redis: any client inside the network may set any executable to be ran once a failover is triggered. This option adds protection for this problem: by default the two SENTINEL SET subcommands modifying scripts paths are denied. However the user is still able to rever that using the Sentinel configuration file in order to allow such a feature.
* Redis 4.0.10.4.0.10antirez2018-06-132-1/+124
|
* Security: fix redis-cli buffer overflow.antirez2018-06-131-11/+16
| | | | | | | Thanks to Fakhri Zulkifli for reporting it. The fix switched to dynamic allocation, copying the final prompt in the static buffer only at the end.
* Security: fix Lua struct package offset handling.antirez2018-06-131-2/+6
| | | | | | | | | | 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.
* Security: more cmsgpack fixes by @soloestoy.antirez2018-06-131-0/+7
| | | | | | | @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.
* Security: update Lua struct package for security.antirez2018-06-131-23/+23
| | | | | | | | | | | | 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.
* Security: fix Lua cmsgpack library stack overflow.antirez2018-06-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 90b6337c1, 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.
* Fix dictScan(): It can't scan all buckets when dict is shrinking.赵磊2018-06-011-11/+14
|
* Fix redis-cli memory leak when sending set preference command.dejun.xdj2018-05-291-0/+2
|
* Check if the repeat value is positive in while loop of cliSendCommand().dejun.xdj2018-05-291-1/+1
| | | | | In case that the incoming repeat parameter is negative and causes a deadless loop.
* Change the type of repeat argument to long for function cliSendCommand.dejun.xdj2018-05-291-1/+1
| | | | To be in consistent with the original definition.
* Fix negtive repeat command value issue.dejun.xdj2018-05-291-3/+11
| | | | If command like "-1 set a b" is sent with redis-cli, it will cause a deadless loop. So some repeat value checking logic is added to avoid this.
* Detect and stop saving history for auth command with repeat option.dejun.xdj2018-05-291-10/+17
| | | | Put the repeat option checking code a little forward to avoid repeat logic.
* Change the warning message a little bit to avoid trademark issuses.dejun.xdj2018-05-291-1/+1
|
* Stop saving auth command in redis-cli history.dejun.xdj2018-05-291-2/+4
|
* Add warning message when using password on command linedejun.xdj2018-05-291-0/+1
|