Skip to content

Commit

Permalink
Require CLONE_VM for CLONE_SIGHAND and CLONE_SIGHAND for CLONE_THREAD
Browse files Browse the repository at this point in the history
  • Loading branch information
Theodore Dubois committed Jan 22, 2018
1 parent 56f7d13 commit d6a44b6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ dword_t sys_clone(dword_t flags, addr_t stack, addr_t ptid, addr_t tls, addr_t c
if (stack != 0)
TODO("clone with nonzero stack");
// stack = current->cpu.esp;

if (flags & CLONE_SIGHAND_ && !(flags & CLONE_VM_))
return _EINVAL;
if (flags & CLONE_THREAD_ && !(flags & CLONE_SIGHAND_))
return _EINVAL;

struct task *task = task_create(current);
if (task == NULL)
Expand Down

0 comments on commit d6a44b6

Please sign in to comment.