Bug 211867
Summary: | The order of the last two arguments of ptrace is not right when request is PPC_PTRACE_GETREGS, GETFPREGS and SETFPREGS | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | IBM Bug Proxy <bugproxy> | ||||||
Component: | kernel | Assignee: | David Woodhouse <dwmw2> | ||||||
Status: | CLOSED INSUFFICIENT_DATA | QA Contact: | Brian Brock <bbrock> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | medium | ||||||||
Version: | 7 | CC: | cagney, jonstanley, wtogami | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | powerpc | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2008-04-25 03:48:30 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Bug Depends On: | |||||||||
Bug Blocks: | 173278, 217057 | ||||||||
Attachments: |
|
Description
IBM Bug Proxy
2006-10-23 16:10:38 UTC
Created attachment 139141 [details]
Test case
Test caseCompile this case in 64-bit mode.
Created attachment 139142 [details]
Patch against FC6 kernel
Patch against FC6 kernel
----- Additional Comments From skannery.com 2006-10-25 07:04 EDT ------- Patch submitted in LKML: http://lkml.org/lkml/2006/10/25/69 Patch didn't receive much comment. Have forwarded to linux-ppc list. FRYSK (and GDB) doesn't use PTRACE_GET* (it's implementation was missing), except for the altivec registers and there the correct parameter order appears to be used: ret = ptrace (PTRACE_GETVRREGS, tid, 0, ®s); ----- Additional Comments From qiyao.com 2006-11-23 06:59 EDT ------- Hi, Andrew, The reason I find this bug and code this patch is that I find PTRACE_{GET,SET}REGS, PTRACE_{GET,SET}FPREGS is used in frysk/sys/cni/Ptrace.cxx, 69 /* There structures and constants are x86-specific. */ 70 static RegisterSetParams regSetParams[] = 71 { 72 #if defined(__i386__)|| defined(__x86_64__) 73 {sizeof(user_regs_struct), PTRACE_GETREGS, PTRACE_SETREGS}, 74 {sizeof(user_fpregs_struct), PTRACE_GETFPREGS, PTRACE_SETFPREGS}, 75 #if defined(__i386__) 76 {sizeof(user_fpxregs_struct), PTRACE_GETFPXREGS, PTRACE_SETFPXREGS}, 77 #endif 78 #endif 79 }; And, peekRegisters and pokeRegisers read/write data via "data", instead of "address". 223 void 224 frysk::sys::Ptrace::peekRegisters(jint registerSet, jint pid, jbyteArray data) 225 { 226 _callPtrace(regSetParams[registerSet].peekRequest, pid, 0, 227 (long)elements(data), "ptrace.peekRegisters"); 228 } 229 230 void 231 frysk::sys::Ptrace::pokeRegisters(jint registerSet, jint pid, jbyteArray data) 232 { 233 _callPtrace(regSetParams[registerSet].pokeRequest, pid, 0, 234 (long)elements(data), "ptrace.pokeRegisters"); 235 } If we do not fix this defect in kernel, {peek,poke}Registers may not be implemented consistently on x86,x86-64, and ppc64. We need to swtich the order of the last two arguments explictly in {peek,poke}Registers if the platform is ppc64. Oop, so thats how IBM did it. Don't worry about that, fix the bug. (In reply to comment #7) > Oop, so thats how IBM did it. Don't worry about that, fix the bug. > Sorry, ignore my last comment. Yes the bug should just be fixed; I checked GDB and it doesn't use that interface on PPC so nothing shipped can break. For frysk, yes it should switch to use GETREGS. I've added two frysk bugs: http://sourceware.org/bugzilla/show_bug.cgi?id=3576 kernel bug http://sourceware.org/bugzilla/show_bug.cgi?id=3577 ppc use SETREGS you might want to grab one or both of them. What happened to the kernel patch to change the order of the arguments? Was it rejected? 2.6.22-rc5 still has the wrong order... Since FC6 is no longer maintained and this issue is mentioned as applying to 2.6.22 upstream, I'll move this to F7. Is this still an issue or has it been patched upstream? Note that maintenance for Fedora 7 will end 30 days after the GA of Fedora 9. The information we've requested above is required in order to review this problem report further and diagnose/fix the issue if it is still present. Since there have not been any updates to the report since thirty (30) days or more since we requested additional information, we're assuming the problem is either no longer present in the current Fedora release, or that there is no longer any interest in tracking the problem. Setting status to "CLOSED INSUFFICIENT_DATA". If you still experience this problem after updating to our latest Fedora release and can provide the information previously requested, please feel free to reopen the bug report. Thank you in advance. Note that maintenance for Fedora 7 will end 30 days after the GA of Fedora 9. Since FC6 is no longer maintained and this issue is mentioned as applying to 2.6.22 upstream, I'll move this to F7. Is this still an issue or has it been patched upstream? Note that maintenance for Fedora 7 will end 30 days after the GA of Fedora 9. The information we've requested above is required in order to review this problem report further and diagnose/fix the issue if it is still present. Since there have not been any updates to the report since thirty (30) days or more since we requested additional information, we're assuming the problem is either no longer present in the current Fedora release, or that there is no longer any interest in tracking the problem. Setting status to "CLOSED INSUFFICIENT_DATA". If you still experience this problem after updating to our latest Fedora release and can provide the information previously requested, please feel free to reopen the bug report. Thank you in advance. Note that maintenance for Fedora 7 will end 30 days after the GA of Fedora 9. Closing from IBM side too. If any further situation arises where such a code change is needed, will reopen and re-evaluate. |