diff options
author | Oran Agra <oran@redislabs.com> | 2023-01-16 13:51:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-16 13:51:18 +0200 |
commit | b4123663c31aaf1e97f4dbd630cbd7b8d0e91e31 (patch) | |
tree | e4f5e77cfd93c76cbf7c80bfeb11bc4ac58faea6 /src/dict.c | |
parent | 16f408b1a0121cacd44cbf8aee275d69dc627f02 (diff) | |
download | redis-b4123663c31aaf1e97f4dbd630cbd7b8d0e91e31.tar.gz |
Obuf limit, exit during loop in *RAND* commands and KEYS (#11676)
Related to the hang reported in #11671
Currently, redis can disconnect a client due to reaching output buffer limit,
it'll also avoid feeding that output buffer with more data, but it will keep
running the loop in the command (despite the client already being marked for
disconnection)
This PR is an attempt to mitigate the problem, specifically for commands that
are easy to abuse, specifically: KEYS, HRANDFIELD, SRANDMEMBER, ZRANDMEMBER.
The RAND family of commands can take a negative COUNT argument (which is not
bound to the number of elements in the key), so it's enough to create a key
with one field, and then these commands can be used to hang redis.
For KEYS the caller can use the existing keyspace in redis (if big enough).
Diffstat (limited to 'src/dict.c')
0 files changed, 0 insertions, 0 deletions