Weird __put_user_asm behavior

Frank Cornelis (fcorneli@elis.rug.ac.be)
Mon, 24 Dec 2001 14:53:08 +0100 (CET)


Hi,

I already posted this question 2 times on this mailing list under the
subject 'Help on __put_user_asm' but seems like the mailing software
doesn't like such subjects (or the person behind it:).
So here it goes: when I patch the macro in include/asm-i386/uaccess.h
named __put_user_asm using the patch below I cannot 'strace ls' anymore.
The ld.so runtime linker just stops when preparing the program displaying
a nice message; the same message as '/lib/ld-linux.so.2' generates when
ran without any parameters.
The kernel messages of __put_user_asm go to: 0xbffffb44; then the program
stops on the ld.so message.
But, 'strace'-ing of a static compiled program does the job as expected.
What am I doing wrong?

Thanks in advance,
Frank

--- linux-2.4.17/include/asm-i386/uaccess.h Sat Dec 22 09:35:17 2001
+++ linux/include/asm-i386/uaccess.h Mon Dec 24 12:43:22 2001
@@ -194,6 +194,10 @@
* aliasing issues.
*/
#define __put_user_asm(x, addr, err, itype, rtype, ltype) \
+do { \
+ if (current->ptrace & PT_PTRACED) { \
+ printk(KERN_DEBUG "__put_user_asm: %#x\n", (unsigned long)(addr)); \
+ } \
__asm__ __volatile__( \
"1: mov"itype" %"rtype"1,%2\n" \
"2:\n" \
@@ -206,7 +210,8 @@
" .long 1b,3b\n" \
".previous" \
: "=r"(err) \
- : ltype (x), "m"(__m(addr)), "i"(-EFAULT), "0"(err))
+ : ltype (x), "m"(__m(addr)), "i"(-EFAULT), "0"(err)); \
+} while (0)


#define __get_user_nocheck(x,ptr,size) \

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/