Page MenuHomeFreeBSD

Use the 'traced' variable instead of comparing p->p_flag again
ClosedPublic

Authored by trasz on Sep 28 2020, 11:27 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 11, 11:14 AM
Unknown Object (File)
Tue, Oct 7, 12:01 AM
Unknown Object (File)
Tue, Sep 23, 6:03 PM
Unknown Object (File)
Aug 26 2025, 3:20 PM
Unknown Object (File)
Aug 24 2025, 10:18 PM
Unknown Object (File)
Jul 27 2025, 6:18 PM
Unknown Object (File)
Jul 20 2025, 4:55 PM
Unknown Object (File)
Jul 20 2025, 7:08 AM
Subscribers

Details

Summary

Use the 'traced' variable instead of comparing p->p_flag again.
There's no call to ptracestop() before that, so the 'traced'
variable is still up to date.

Diff Detail

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

Event Timeline

I believe the idea of recheck is because potentially there is a large time gap between first and second use of the flag. For instance, we fetch syscall args in between, which might access user memory, which might fault and cause page in.

Also I do not see how absence of ptracestop() before second use changes anything.

This revision is now accepted and ready to land.Sep 28 2020, 12:24 PM

Yeah, my point about ptracestop would apply more to eg registers being updated by the debugger, not to the fact of being debugged or not.