Skip to content

Commit 9ee3b0c

Browse files
committed
check that futures are reasonably sized
1 parent 0bc4e03 commit 9ee3b0c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tee/kernel/src/user/syscall/traits.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ impl SyscallHandlers {
133133
self.future_size = return_size;
134134
}
135135

136+
// Make sure that the future is not too big. There's no technical
137+
// reason why large futures can't work, but we should avoid them if
138+
// possible.
139+
assert!(return_size < 2048, "future is very big");
140+
136141
/// Returns the alignment of the return type of `T::execute`.
137142
const fn return_align<'a, T>(
138143
_: fn(thread: &'a Arc<Thread>, syscall_args: SyscallArgs) -> T,

0 commit comments

Comments
 (0)