Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Dec 2000 10:17:19 +0100
From:      vecna <vecna@nospam.oltrelinux.com>
To:        freebsd-hackers@freebsd.org
Subject:   problem whit kld and write(2) ...
Message-ID:  <20001204101719.A1333@karma>

next in thread | raw e-mail | index | archive | help
Hi :)

I'm coding an kld for fbsd 4.x for using encrypted file (such sfs/cfs/tcfs)
whis some difference ...

but I've got a problem, when I redir the system call write, I must change
his 2nd argument ( int fd, const void *buf, int nbyte) buf point to
buffer whit data to copy, I cannot change it because is declared as const.

I've used my new buffer big nbyte byte, but when i call original write
syscall they return EFAULT (Bad Address) because my pointer isn't
from user space memory related with the process that calling write...

I'm follow the function on write, from:
sys_generic.c: unmodified: line 290 of 972 [29%]

it call getfp for fill struct *file, and after dofilewrite, static func:
sys_generic.c: unmodified: line 329 of 972 [33%]

the error is generated as return value from fo_write, at line 363, I've
search fo_write, I've find it on /usr/src/sys/sys/file.h on struct file,
fo_write is function pointer, on file.h, at line 156, fo_write call
fo_write ... but it don't generate a loop, and return EFAULT ...

anyone has some ideas ?

bye and thanks,
vecna :)



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001204101719.A1333>