Skip to content

Commit 9d764c5

Browse files
committed
Add FIXME note about variadic syscall().
1 parent 6df54c4 commit 9d764c5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/shims/posix/linux/foreign_items.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
113113

114114
// Dynamically invoked syscalls
115115
"syscall" => {
116+
// FIXME: The libc syscall() function is a variadic function.
117+
// It's valid to call it with more arguments than a syscall
118+
// needs, so none of these syscalls should use check_arg_count.
119+
// However, depending on the calling convention it might depend
120+
// on the type and size of the arguments whether a call with
121+
// the wrong number of arguments (or types) is valid or not.
122+
// So this needs to be researched first.
116123
let sys_getrandom = this
117124
.eval_libc("SYS_getrandom")?
118125
.to_machine_usize(this)?;

0 commit comments

Comments
 (0)