Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 117712 Details for
Bug 176050
net-fs/openafs-1.4.4 for sparc
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
jmp_buf pointer mangling try2
openafs-1.4.4-ptr-mangle.patch (text/plain), 1.51 KB, created by
Arkadi Shishlov
on 2007-04-30 10:43:38 UTC
(
hide
)
Description:
jmp_buf pointer mangling try2
Filename:
MIME Type:
Creator:
Arkadi Shishlov
Created:
2007-04-30 10:43:38 UTC
Size:
1.51 KB
patch
obsolete
>--- src/lwp/process.c~ 2007-04-30 13:39:40.000000000 +0300 >+++ src/lwp/process.c 2007-04-30 13:35:50.000000000 +0300 >@@ -142,6 +142,31 @@ > static int rc; > static jmp_buf_type *jmpBuffer; > >+/** Starting with Glibc 2.4 pointers in jmp_buf are mangled (XOR) for "protection". >+ * On Sparc ucontext functions are not implemented. >+ */ >+#define ptr_mangle(x) (x) >+#ifdef AFS_LINUX20_ENV >+ >+#ifdef __GLIBC__ >+#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) >+ >+#ifdef AFS_SPARC64_LINUX24_ENV >+#undef ptr_mangle >+static int ptr_mangle(int p) >+{ >+ register char *tls_ptr __asm__("%g7"); >+ return p ^ *(int*)(tls_ptr + 0x18); >+} >+#else >+#error need ptr_mangle support or use UCONTEXT >+#endif >+ >+#endif >+#endif >+#endif >+ >+ > afs_int32 > savecontext(ep, savearea, sp) > char (*ep) (); >@@ -155,7 +180,7 @@ > > code = setjmp(savearea->setjmp_buffer); > jmpBuffer = (jmp_buf_type *) savearea->setjmp_buffer; >- savearea->topstack = (char *)jmpBuffer[LWP_SP]; >+ savearea->topstack = (char *) ptr_mangle(jmpBuffer[LWP_SP]); > > #if defined(DEBUG) > { >@@ -178,9 +203,9 @@ > switch (rc) { > case 0: > jmpBuffer = (jmp_buf_type *) jmp_tmp; >- jmpBuffer[LWP_SP] = (jmp_buf_type) sp; >+ jmpBuffer[LWP_SP] = ptr_mangle((jmp_buf_type) sp); > #if defined(AFS_S390_LINUX20_ENV) || defined(AFS_SPARC_LINUX20_ENV) || (defined(AFS_SPARC64_LINUX20_ENV) && defined(AFS_32BIT_USR_ENV)) >- jmpBuffer[LWP_FP] = (jmp_buf_type) sp; >+ jmpBuffer[LWP_FP] = ptr_mangle((jmp_buf_type) sp); > #endif > longjmp(jmp_tmp, 1); > break;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 176050
:
117280
|
117281
|
117282
|
117283
|
117463
|
117465
| 117712 |
131309
|
134841
|
134845