You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In cmds/live.c, There was stack use after return code. tmp_dirname static char pointer would be not pointed stack allocation after command_live() call ended.
We can use tmp_dirname heap or fix sized array.
staticchar*tmp_dirname; // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<staticvoidcleanup_tempdir(void)
{
if (!tmp_dirname)
return;
remove_directory(tmp_dirname);
tmp_dirname=NULL;
}
This detected when agent tracing on/off with make ASAN=1.
I've checked from valkey
# valkey server on
$ uftrace record --agent --trace=off ./valkey-server
# valkey-server trace on/off
$ uftrace --pid `pidof valkey-server` --trace=on
$ uftrace --pid `pidof valkey-server` --trace=off
This would be stack-use-after- return on x86_64 Cent OS 7.
84462==ERROR: AddressSanitizer: stack-use-after- return on address 0x7f7eaf900020 at pc 0x7f7eb3d0a411 bp 0x7ffcc4a464c0 sp 0x7ffcc4a45c80
READ of size 25 at 0x7f7eaf900020 thread To
#0 0x7f7eb3d0a410 in __interceptor_opendir gcc-releases-gcc-13.2.0/libsanitizer/sanitizer/common/sanitizer_common_interceptors.inc: 3429
#1 0x586693 in remove_directory uftrace/utils/utils.c: 169
#2 0x447f42 in cleanup_tempdir uftrace/cds/live.c: 22
#3 0x7f7eb21bace8 in __run_exit_handlers (/lib64/libc.so.6+0x39ce8) (BuildId: fc4fa58e47a5acc137eadb7689bce4357c557a96)
#4 0x7f7eb21bad36 in exit (/lib64/libc.so.6+0x39d36) (BuildId: fc4fa5847a5acc137eadb7689bce4357c557a96)
#5 0x7f7eb21a355b in libc start main (/lib64/libc.so.6+0x2255b) (BuildId: fc4fa58e47a5acc137eadb7689bce4357c557a96)
In
cmds/live.c
, There was stack use after return code.tmp_dirname
static char pointer would be not pointed stack allocation aftercommand_live()
call ended.We can use
tmp_dirname
heap or fix sized array.The text was updated successfully, but these errors were encountered: