Your message dated Thu, 22 Oct 2020 15:04:34 +0000
with message-id <[email protected]>
and subject line Bug#972683: fixed in redis 5:6.0.8-2
has caused the Debian Bug report #972683,
regarding redis-server: crash on AOF file write error
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
972683: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=972683
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: redis-server
Version: 6.0.8-1
Severity: normal
Tags: patch
X-Debbugs-Cc: [email protected]

Dear Maintainer,

The latest get_current_dir_name patch seems to be broken, as it attempts
to free a stack pointer.

The proposed fix also changes zfree() to free() which is technically
more correct, as glibc may or may not use the same heap allocator Redis
uses internally.
diff -Nru redis-6.0.8/debian/changelog redis-6.0.8/debian/changelog
--- redis-6.0.8/debian/changelog        2020-09-16 12:57:22.000000000 +0300
+++ redis-6.0.8/debian/changelog        2020-10-22 16:12:07.000000000 +0300
@@ -1,3 +1,11 @@
+redis (5:6.0.8-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix get_current_dir_name patch issue that could lead to crashes when
+    reporting RDB/AOF file errors.
+
+ -- Yossi Gottlieb <[email protected]>  Thu, 22 Oct 2020 16:12:07 +0300
+
 redis (5:6.0.8-1) unstable; urgency=medium
 
   * New upstream release.
diff -Nru 
redis-6.0.8/debian/patches/0010-Use-get_current_dir_name-over-PATHMAX-etc.patch 
redis-6.0.8/debian/patches/0010-Use-get_current_dir_name-over-PATHMAX-etc.patch
--- 
redis-6.0.8/debian/patches/0010-Use-get_current_dir_name-over-PATHMAX-etc.patch 
    2020-09-16 12:57:22.000000000 +0300
+++ 
redis-6.0.8/debian/patches/0010-Use-get_current_dir_name-over-PATHMAX-etc.patch 
    2020-10-22 16:12:07.000000000 +0300
@@ -7,20 +7,31 @@
  src/rdb.c | 7 ++++---
  2 files changed, 5 insertions(+), 3 deletions(-)
 
-diff --git a/src/aof.c b/src/aof.c
-index cbc0989..d215293 100644
 --- a/src/aof.c
 +++ b/src/aof.c
-@@ -263,6 +263,7 @@ int startAppendOnly(void) {
+@@ -249,13 +249,12 @@ void stopAppendOnly(void) {
+ /* Called when the user switches from "appendonly no" to "appendonly yes"
+  * at runtime using the CONFIG command. */
+ int startAppendOnly(void) {
+-    char cwd[MAXPATHLEN]; /* Current working dir path for error messages. */
+     int newfd;
+ 
+     newfd = open(server.aof_filename,O_WRONLY|O_APPEND|O_CREAT,0644);
+     serverAssert(server.aof_state == AOF_OFF);
+     if (newfd == -1) {
+-        char *cwdp = getcwd(cwd,MAXPATHLEN);
++        char *cwdp = get_current_dir_name();
+ 
+         serverLog(LL_WARNING,
+             "Redis needs to enable the AOF but can't open the "
+@@ -263,6 +262,7 @@ int startAppendOnly(void) {
              server.aof_filename,
              cwdp ? cwdp : "unknown",
              strerror(errno));
-+        zfree(cwdp);
++        free(cwdp);
          return C_ERR;
      }
      if (hasActiveChildProcess() && server.aof_child_pid == -1) {
-diff --git a/src/rdb.c b/src/rdb.c
-index 54a169c..104a666 100644
 --- a/src/rdb.c
 +++ b/src/rdb.c
 @@ -1307,7 +1307,6 @@ werr: /* Write error. */
@@ -31,7 +42,7 @@
      FILE *fp;
      rio rdb;
      int error = 0;
-@@ -1315,13 +1314,14 @@ int rdbSave(char *filename, rdbSaveInfo *rsi) {
+@@ -1315,13 +1314,14 @@ int rdbSave(char *filename, rdbSaveInfo
      snprintf(tmpfile,256,"temp-%d.rdb", (int) getpid());
      fp = fopen(tmpfile,"w");
      if (!fp) {
@@ -43,11 +54,11 @@
              filename,
              cwdp ? cwdp : "unknown",
              strerror(errno));
-+        zfree(cwdp);
++        free(cwdp);
          return C_ERR;
      }
  
-@@ -1344,7 +1344,7 @@ int rdbSave(char *filename, rdbSaveInfo *rsi) {
+@@ -1344,7 +1344,7 @@ int rdbSave(char *filename, rdbSaveInfo
      /* Use RENAME to make sure the DB file is changed atomically only
       * if the generate DB file is ok. */
      if (rename(tmpfile,filename) == -1) {
@@ -56,11 +67,11 @@
          serverLog(LL_WARNING,
              "Error moving temp DB file %s on the final "
              "destination %s (in server root dir %s): %s",
-@@ -1352,6 +1352,7 @@ int rdbSave(char *filename, rdbSaveInfo *rsi) {
+@@ -1352,6 +1352,7 @@ int rdbSave(char *filename, rdbSaveInfo
              filename,
              cwdp ? cwdp : "unknown",
              strerror(errno));
-+        zfree(cwdp);
++        free(cwdp);
          unlink(tmpfile);
          stopSaving(0);
          return C_ERR;

--- End Message ---
--- Begin Message ---
Source: redis
Source-Version: 5:6.0.8-2
Done: Chris Lamb <[email protected]>

We believe that the bug you reported is fixed in the latest version of
redis, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Chris Lamb <[email protected]> (supplier of updated redis package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Thu, 22 Oct 2020 15:50:56 +0100
Source: redis
Built-For-Profiles: nocheck
Architecture: source
Version: 5:6.0.8-2
Distribution: unstable
Urgency: medium
Maintainer: Chris Lamb <[email protected]>
Changed-By: Chris Lamb <[email protected]>
Closes: 972683
Changes:
 redis (5:6.0.8-2) unstable; urgency=medium
 .
   * Apply a patch from Yossi Gottlieb to fix a crash when reporting RDB/AOF
     file errors. (Closes: #972683)
   * Refresh patches.
Checksums-Sha1:
 ac005573a7645a1469aad37e62dc9763d410d08a 2229 redis_6.0.8-2.dsc
 706f900b9ede73a287810f242f8f581b9533f91a 27700 redis_6.0.8-2.debian.tar.xz
 55dc7c8294306d671e81355821bb69bf3c074c97 7332 redis_6.0.8-2_amd64.buildinfo
Checksums-Sha256:
 271a43042e5df3410522e3d5d4b40d025a8a56007b096567f34d0c5419445ba8 2229 
redis_6.0.8-2.dsc
 27f196408934722505337b4a451e7d9725f933663d580e1999f80d4b1ee71a66 27700 
redis_6.0.8-2.debian.tar.xz
 8ed1093a504f1c2a2cf32136f533f3c19ead4741d30e326e5fc686d56227c1ee 7332 
redis_6.0.8-2_amd64.buildinfo
Files:
 672ca1845a15d825341dc41b9d01d41d 2229 database optional redis_6.0.8-2.dsc
 ffb6b85356957b039a73668a36402569 27700 database optional 
redis_6.0.8-2.debian.tar.xz
 b0eff6b2234ac3f9b0f910d2469365e1 7332 database optional 
redis_6.0.8-2_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEwv5L0nHBObhsUz5GHpU+J9QxHlgFAl+RnJoACgkQHpU+J9Qx
Hlh/Ag//VNjajQdlmtgxWRR5j4BdE3L0CXLJ/iNh9wlz8M9rQi8mFtvHSMGyHJNu
Hs92EPcwx/meJWgwLi7DfzoI2/itFZABz3YewGE2zROJVSbn3xaGnwA2FfaYry4i
NjEDbvYuTYUxZMlK/tiiwNMBPyY2WmWHfbE0M6UMM9kNHK3HHzmF+wRg0/7DhnSn
RN6U/LlZZXGhofEEHrmyvxX/EXovPYGI/ebdNs7bmDXs3ewSDE1GnHm0IRHPM4gC
NvJiQcFE/4mdJuVZi9ypdq7Yoe07EzZOI2b/ZMUTQ3uHhLdgZou3pJk0XUoH0z4Q
tW6Iy1ktmuH/GUSSk7CmHOjcjNzeAMeOPANFdE7Ro6e+ebVci2dQdGKu9WkAmntM
jxaJs8d+RlS9/fz6JG+eTy+DQ6R4oDWdnanfOcrnJ6SYAiGn/lRn8zycJEGOKMNv
htDkQwady8Ja+XvBRwljwz7E+IHi7WeMcPGJUQU0Ua/+BYDLDLYbMbBHyffUpzJL
VMkK2EOPUpbb9nQNDSmQ+olY93TqzZsoEAHkgBnU5DqCLb+6+r0sMCS6rrTfcK9t
JOGUXhwucj4uT63VshSR5zk+ygUoE4L8Xr3jvVbeTuyux6jzRwo3c0ojM5D/CP1K
DEo2uYtRn4gA25FfKIhEhTsweDrDIzPGkNoTDVf6rqS6VkzMUcc=
=WI7F
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to