Page MenuHomeFreeBSD

Fix p_endcopy.
ClosedPublic

Authored by jhb on May 11 2017, 4:42 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 12, 2:35 PM
Unknown Object (File)
Dec 20 2023, 2:15 AM
Unknown Object (File)
Nov 9 2023, 11:43 AM
Unknown Object (File)
Nov 8 2023, 7:47 PM
Unknown Object (File)
Nov 7 2023, 6:34 AM
Unknown Object (File)
Nov 7 2023, 5:58 AM
Unknown Object (File)
Oct 8 2023, 10:40 AM
Unknown Object (File)
Oct 7 2023, 6:45 PM
Subscribers

Details

Reviewers
kib
Commits
rS318360: Fix p_endcopy.
Summary

Fix p_endcopy.

For p_endcopy to work correctly, it must be the name of the next element
in struct proc after the end of the copy region, not the name of the
last element in the copy region. Currently, the last element
(p_elf_flags) is not being copied.

This appears to have been broken in r285670 (I think it should have been
set to p_klist instead), and I perpetuated the bug in r313407. I only
noticed it when merging r313407 to stable/10.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.May 11 2017, 8:20 AM

Yes, I think it was broken in r285670, but into the other direction. Both p_xexit and p_xsig are valid only in situations where fork() cannot be called by the process: it is either stopped (in debugger) or exited. Pre-r285670 correctly kept p_xstat out of the copied area, I mistakenly put p_xexit into the copied area.

More complete fix would be to move p_xexit and p_xsig out.

jhb edited edge metadata.

Move p_xexit and p_xsig out of the p_endcopy section.

This revision now requires review to proceed.May 11 2017, 6:00 PM

The MFC to 11 would be similar and would not disturb the ABI as it would just "shrink" p_endcopy by a bit.

This revision is now accepted and ready to land.May 11 2017, 6:06 PM
This revision was automatically updated to reflect the committed changes.