This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/19957] New: clone(CLONE_VM) access invalid parent memory


https://sourceware.org/bugzilla/show_bug.cgi?id=19957

            Bug ID: 19957
           Summary: clone(CLONE_VM) access invalid parent memory
           Product: glibc
           Version: 2.24
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: adhemerval.zanella at linaro dot org
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

As stated in previous bug reports [1] [2] [3], clone(CLONE_VM) reset the
pthread pid/tid to -1 leading to inconsistent internal state.

This has not been an issue since clone itself is a trick syscall when used
along with glibc (since glibc requires consistent pthread internal state),
however recent posix_spawn shown this issue because it using internally
clone(CLONE_VM) in a controlled way (just to spawn the new thread).

In the libc-alpha mailist [4] discussion was raised the question why exactly
clone(CLONE_VM) requires to clear the pthread and it was concluded that in fact
it is wrong to mess with parent's thread structure. The proposed solution is,
like CLONE_THREAD, avoid to clear the pid/tid fields for CLONE_VM.

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=10311
[2] https://sourceware.org/bugzilla/show_bug.cgi?id=18006
[3] https://sourceware.org/bugzilla/show_bug.cgi?id=18862
[4] https://sourceware.org/ml/libc-alpha/2016-04/msg00307.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]