DynamoRIO / DynamoRIO/drmemory

Missing safe_read before pointer dereference in drsyscall_linux.c

Open
#2,547 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
2.7k
Forks
290
PR merge metrics
No merged PRs in 30d

Description

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.

```c
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;
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.