Closed ShuiRuTian closed 7 months ago
I use the same command, but could not reproduce the issue, does anyone know the reason?
I ran cargo clippy --target x86_64-unknown-linux-gnu --all-targets --all-features -- -D warnings -A unknown-lints
Well, it is indeed weird, I didn't reproduce it either...
Will investigate more.
I kinda think this error is a false positive?
My guess on the reason why it is triggered is that we are directly casting a c_long
to a raw pointer, but I think this is fine as the kernel won't treat it as a raw pointer but an unsigned long
, so we can:
#[allow(clippy::not_unsafe_ptr_arg_deref)]
Write a comment stating why the usages of ptrace_other()
within write()
and write_user()
are safe
// Safety:
Thanks for the suggestions, it's past now!
What does this PR do
Fix #2323
Change the signature of
ptrace::write
andptrace::write_user
to make them safeChecklist:
CONTRIBUTING.md