Skip to content

Commit 5643f99

Browse files
committed
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.
1 parent 07e030d commit 5643f99

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

executor/common_linux.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2422,7 +2422,7 @@ static long syz_open_dev(volatile long a0, volatile long a1, volatile long a2)
24222422
*hash = '0' + (char)(nb % 10); // 10 devices should be enough for everyone.
24232423
nb /= 10;
24242424
}
2425-
return open(buf, a2, 0);
2425+
return open(buf, a2 & ~O_CREAT, 0);
24262426
}
24272427
}
24282428
#endif

0 commit comments

Comments
 (0)