* Unable to handle kernel paging request at virtual address 0000000000000418
@ 2001-09-26 8:21 Michael Back
0 siblings, 0 replies; only message in thread
From: Michael Back @ 2001-09-26 8:21 UTC (permalink / raw)
Hallo,
I try to use access_ok in my ioctl like
if ( _IOC_DIR( cmd ) & _IOC_READ )
err = !access_ok( VERIFY_WRITE, ( void* ) arg, _IOC_SIZE( cmd
) );
else if ( _IOC_DIR( cmd ) & _IOC_WRITE )
err = !access_ok( VERIFY_READ, ( void* ) arg, _IOC_SIZE( cmd )
);
if ( err ) return -EFAULT;
But I get this errormessage:
Oops: Unable to handle kernel paging request at virtual address
0000000000000418.
My system is red hat ALPHA 6.2 on a UP2000 board
Kernel 2.4.4 / 2.4.7 / 2.4.8 / 2.4.10 all the same, only the adress
changes form 0000000000000400 to
0000000000000418 between Kernel 2.4.4 / 2.4.7 / 2.4.8 and 2.4.10
I have already inserted many printk in my code and the uaccess.h too.
The error appear by the codefragment current->thread.fs
------------------------------>
That's what I see in <asm/uaccess.h> (<asm-alpha/uaccess.h>):
#define get_fs() (current->thread.fs)
#define get_ds() (KERNEL_DS)
#define set_fs(x) (current->thread.fs = (x))
#define segment_eq(a,b) ((a).seg == (b).seg)
/*
* Is a address valid? This does a straighforward calculation rather
* than tests.
*
* Address valid if:
* - "addr" doesn't have any high-bits set
* - AND "size" doesn't have any high-bits set
* - AND "addr+size" doesn't have any high-bits set
* - OR we are in kernel mode.
*/
#define __access_ok(addr,size,segment) \
(((segment).seg & (addr | size | (addr+size))) == 0)
#define access_ok(type,addr,size) \
__access_ok(((unsigned long)(addr)),(size),get_fs())
<------------------------------------------------------
With compiler option -E my code is
The output is:
------------------------------------------>
if ( ((( cmd ) >> (((0 + 8 ) + 8 ) + 13 ) ) & ((1 << 3 )-1) ) & 2U
)
err = ! ((( (current->thread.fs) ).seg & ( ((unsigned long)(
( void* ) arg )) | ( ((( cmd ) >> (
(0 + 8 ) + 8 ) ) & ((1 << 13 )-1) ) ) | ( ((unsigned long)( (
void* ) arg )) + ( ((( cmd ) >> ((0 + 8 ) + 8 ) ) & ((1 << 13 )-1)
) ) ))) == 0) ;
else if ( ((( cmd ) >> (((0 + 8 ) + 8 ) + 13 ) ) & ((1 << 3 )-1) )
& 4U )
err = ! ((( (current->thread.fs) ).seg & ( ((unsigned long)(
( void* ) arg )) | ( ((( cmd ) >> (
(0 + 8 ) + 8 ) ) & ((1 << 13 )-1) ) ) | ( ((unsigned long)( (
void* ) arg )) + ( ((( cmd ) >> ((0 + 8 )+ 8 ) ) & ((1 << 13 )-1) )
) ))) == 0) ;
<------------------------------------------
This codefragment "(current->thread.fs) ).seg" is the problem.
Could anybody help ?
Thanks
Michael Back
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-09-26 8:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-09-26 8:21 Unable to handle kernel paging request at virtual address 0000000000000418 Michael Back
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox