mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-08 21:06:48 +00:00
Add overflow check for given sigaltstack addr and size
This commit is contained in:
parent
7c249cf0ca
commit
1a5bf7b0ad
@ -106,6 +106,9 @@ impl TryFrom<stack_t> for SigStack {
|
||||
if stack.size < MINSTKSZ {
|
||||
return_errno_with_message!(Errno::ENOMEM, "stack size is less than MINSTKSZ");
|
||||
}
|
||||
if stack.sp.checked_add(stack.size).is_none() {
|
||||
return_errno_with_message!(Errno::EINVAL, "overflow for given stack addr and size");
|
||||
}
|
||||
|
||||
if flags.is_empty() {
|
||||
flags.insert(SigStackFlags::SS_ONSTACK);
|
||||
|
Loading…
x
Reference in New Issue
Block a user