mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Remove "emulation" of clone(CLONE_PARENT | CLONE_THREAD).
On Linux this is supposed to result in EINVAL. Reported by: syzkaller MFC after: 1 week Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
74a796e0fc
commit
d9565182fd
1 changed files with 3 additions and 5 deletions
|
|
@ -244,6 +244,8 @@ linux_clone_thread(struct thread *td, struct linux_clone_args *args)
|
|||
td->td_tid, (unsigned)args->flags,
|
||||
args->parent_tidptr, args->child_tidptr);
|
||||
|
||||
if ((args->flags & LINUX_CLONE_PARENT) != 0)
|
||||
return (EINVAL);
|
||||
if (args->flags & LINUX_CLONE_PARENT_SETTID)
|
||||
if (args->parent_tidptr == NULL)
|
||||
return (EINVAL);
|
||||
|
|
@ -304,13 +306,9 @@ linux_clone_thread(struct thread *td, struct linux_clone_args *args)
|
|||
|
||||
PROC_LOCK(p);
|
||||
p->p_flag |= P_HADTHREADS;
|
||||
thread_link(newtd, p);
|
||||
bcopy(p->p_comm, newtd->td_name, sizeof(newtd->td_name));
|
||||
|
||||
if (args->flags & LINUX_CLONE_PARENT)
|
||||
thread_link(newtd, p->p_pptr);
|
||||
else
|
||||
thread_link(newtd, p);
|
||||
|
||||
thread_lock(td);
|
||||
/* let the scheduler know about these things. */
|
||||
sched_fork_thread(td, newtd);
|
||||
|
|
|
|||
Loading…
Reference in a new issue