drmemory icon indicating copy to clipboard operation
drmemory copied to clipboard

Missing safe_read before pointer dereference in drsyscall_linux.c

Open Egor-OSSRevival opened this issue 9 months ago • 1 comments

Missing safe_read before pointer dereference in drsyscall_linux.c

#2546 #2478

In drsyscall/drsyscall_linux.c, the current code does not include a safe_read before dereferencing arg_ptr. This could lead to potential issues if the pointer is not valid.

int semid;
ASSERT(argnum_semid + 3 < SYSCALL_NUM_ARG_STORE, "index too high");
cmd = (uint) pt->sysarg[argnum_semid + 2];
arg_val = (ptr_int_t) pt->sysarg[argnum_semid + 3];
arg = *(union semun *) &arg_val;
arg_ptr = (union semun *)arg_val;

Egor-OSSRevival avatar Mar 14 '25 15:03 Egor-OSSRevival

Is this still open ?

PiyushPatle26 avatar Jul 10 '25 23:07 PiyushPatle26