Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Jul 2001 01:35:33 -0500
From:      Alfred Perlstein <bright@sneakerz.org>
To:        "Eugene L. Vorokov" <vel@bugz.infotecs.ru>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Some questions about kernel programming
Message-ID:  <20010713013533.L6664@sneakerz.org>
In-Reply-To: <200107130646.f6D6kPR01837@bugz.infotecs.ru>; from vel@bugz.infotecs.ru on Fri, Jul 13, 2001 at 10:46:25AM %2B0400
References:  <20010712212809.F6664@sneakerz.org> <200107130646.f6D6kPR01837@bugz.infotecs.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
* Eugene L. Vorokov <vel@bugz.infotecs.ru> [010713 01:33] wrote:
> Forgot to Cc: here:
> 
> > You can't call kernel strlen on a userland address, you must do
> > something like this:
> 
> How so ? It seems to work for me. For instance, I used userland
> address space buffer to simulate __getcwd() syscall on the current
> process (I was hacking open() syscall and log full path of the file
> to the syslog). I simulate mmap() with MAP_ANON and fd == -1 on
> that process, then I do __getcwd() to the buffer allocated, and 
> then I'm very well able to call strlen() on that userland buffer, 
> as well as other str* functions. So generally I think it works.

It may work on i386+freebsd right now, but if kernel address != user
address it will break.

Your code is wrong.

-- 
-Alfred Perlstein [alfred@freebsd.org]
Ok, who wrote this damn function called '??'?
And why do my programs keep crashing in it?

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?20010713013533.L6664>