From owner-freebsd-hackers Mon Dec 4 1:17:33 2000 From owner-freebsd-hackers@FreeBSD.ORG Mon Dec 4 01:17:31 2000 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from oltrelinux.com (redazione.oltrelinux.com [194.244.171.254]) by hub.freebsd.org (Postfix) with SMTP id 0E07437B400 for ; Mon, 4 Dec 2000 01:17:30 -0800 (PST) Received: (qmail 11793 invoked by uid 3017); 4 Dec 2000 09:17:19 -0000 Date: Mon, 4 Dec 2000 10:17:19 +0100 From: vecna To: freebsd-hackers@freebsd.org Subject: problem whit kld and write(2) ... Message-ID: <20001204101719.A1333@karma> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-Organization: Linux & C. (http://www.oltrelinux.com) Sender: vecna@oltrelinux.com Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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