diff options
| author | Florent Revest <revest@chromium.org> | 2025-11-14 12:05:46 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2025-11-14 11:43:32 +0000 |
| commit | e8b93029aa041e365d10718a98ee015f1d72fab6 (patch) | |
| tree | f035a44140205e53e4d779007193c8bf21bd872b /executor | |
| parent | 07e030dea6e6d9ca88b75bb3be2810f47083b328 (diff) | |
executor: disallow O_CREAT in syz_open_dev
I can't think of a valid reason to create nodes under /dev/ if they
don't already exist.
On systems where /dev/ isn't backed by a virtual/temp file system,
O_CREAT lets syzkaller create persistent files on disk and may
unnecessarily clutter or fill the disk with files that have nothing to
do with the intended syscall descriptions.
Diffstat (limited to 'executor')
| -rw-r--r-- | executor/common_linux.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/executor/common_linux.h b/executor/common_linux.h index 5d477a16a..7b35f284f 100644 --- a/executor/common_linux.h +++ b/executor/common_linux.h @@ -2422,7 +2422,7 @@ static long syz_open_dev(volatile long a0, volatile long a1, volatile long a2) *hash = '0' + (char)(nb % 10); // 10 devices should be enough for everyone. nb /= 10; } - return open(buf, a2, 0); + return open(buf, a2 & ~O_CREAT, 0); } } #endif |
