Page MenuHomeFreeBSD

Implement PTRACE_O_TRACESYSGOOD
ClosedPublic

Authored by trasz on May 8 2019, 1:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Dec 22, 2:22 AM
Unknown Object (File)
Sep 30 2024, 3:56 AM
Unknown Object (File)
Sep 21 2024, 11:31 AM
Unknown Object (File)
Sep 8 2024, 6:09 PM
Unknown Object (File)
Sep 5 2024, 4:03 PM
Unknown Object (File)
Sep 2 2024, 10:45 AM
Unknown Object (File)
Sep 1 2024, 10:28 PM
Unknown Object (File)
Sep 1 2024, 10:28 PM
Subscribers

Details

Summary

Implement PTRACE_O_TRACESYSGOOD. This makes Linux strace(1) work.

Diff Detail

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

Event Timeline

sys/amd64/linux/linux_ptrace.c
115 ↗(On Diff #57180)

used from MI code, and in my understandig can be MI too,
after you finish we can reuse it and implement the rest

323 ↗(On Diff #57180)

btw, in the Linuxulator we have linux_msg() :)
again, up to you

sys/compat/linux/linux_emul.h
35 ↗(On Diff #57180)

I prefer to include imgact.h in the linux_ptrace.c, again, up to you

sys/compat/linux/linux_misc.c
1019 ↗(On Diff #57180)

it will break i386, arm64 Linuxulators

sys/compat/linux/linux_misc.h
152 ↗(On Diff #57180)

only for amd64?

sys/amd64/linux/linux_ptrace.c
115 ↗(On Diff #57180)

Could be, but it depends on kern_ptrace(), and a Linux-specific ptrace flag.

How about leaving it here, and just wrapping the call (below) with #ifdef amd64?

323 ↗(On Diff #57180)

Good point; I'll change all the printfs here to linux_msg() in a future commit.

sys/compat/linux/linux_emul.h
35 ↗(On Diff #57180)

Thing is, we don't need the entire imgact.h there - it's just a compilation fix.

sys/compat/linux/linux_misc.h
152 ↗(On Diff #57180)

Yeah. I don't see much point in working on 32 bit ptrace; I'm not even sure if CentOS folks still distribute 32 bit strace(1) binary.

dchagin added inline comments.
sys/compat/linux/linux_misc.h
152 ↗(On Diff #57180)

I mean one more #ifdef amd64 )

This revision is now accepted and ready to land.May 15 2019, 5:07 AM

One more ifdef, per dchagin's suggestion.

This revision now requires review to proceed.May 15 2019, 6:00 PM
This revision is now accepted and ready to land.May 16 2019, 7:32 AM

Okay, there's still something wrong. While "kldload linux64" works, the "kldload linux" doesn't due to "link_elf_obj: symbol linux_ptrace_status undefined" error.

This revision now requires review to proceed.May 16 2019, 11:53 AM

:)
as I already say, moving linux_ptrace_status() to MI (linux_util.c or linux.c) solves you problem with ifdefs )

This revision is now accepted and ready to land.May 16 2019, 1:31 PM
This revision was automatically updated to reflect the committed changes.