Page MenuHomeFreeBSD

Fix p_endcopy.
ClosedPublic

Authored by jhb on May 11 2017, 4:42 AM.
Tags
None
Referenced Files
F105784283: D10677.id28225.diff
Fri, Dec 20, 3:59 PM
F105769571: D10677.diff
Fri, Dec 20, 10:55 AM
Unknown Object (File)
Thu, Dec 5, 1:51 PM
Unknown Object (File)
Nov 17 2024, 7:48 AM
Unknown Object (File)
Oct 2 2024, 4:00 PM
Unknown Object (File)
Sep 29 2024, 11:06 PM
Unknown Object (File)
Sep 26 2024, 11:05 AM
Unknown Object (File)
Sep 25 2024, 9:02 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.