Page MenuHomeFreeBSD

Implement PTRACE_O_TRACESYSGOOD
ClosedPublic

Authored by trasz on May 8 2019, 1:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 22 2023, 8:38 AM
Unknown Object (File)
Dec 17 2023, 11:26 AM
Unknown Object (File)
Jun 14 2023, 2:24 PM
Unknown Object (File)
Jun 12 2023, 7:55 PM
Unknown Object (File)
Apr 13 2023, 9:22 PM
Unknown Object (File)
Apr 13 2023, 9:21 PM
Unknown Object (File)
Apr 13 2023, 9:20 PM
Unknown Object (File)
Apr 13 2023, 9:20 PM
Subscribers

Details

Summary

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

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 24259
Build 23091: arc lint + arc unit

Event Timeline

sys/amd64/linux/linux_ptrace.c
115

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

323

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

sys/compat/linux/linux_emul.h
35

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

sys/compat/linux/linux_misc.c
927

it will break i386, arm64 Linuxulators

sys/compat/linux/linux_misc.h
152–154

only for amd64?

sys/amd64/linux/linux_ptrace.c
115

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

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

sys/compat/linux/linux_emul.h
35

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

sys/compat/linux/linux_misc.h
152–154

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–154

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.