From owner-freebsd-hackers@FreeBSD.ORG Sun Nov 16 13:51:46 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9F86E16A4CE for ; Sun, 16 Nov 2003 13:51:46 -0800 (PST) Received: from web21407.mail.yahoo.com (web21407.mail.yahoo.com [216.136.232.77]) by mx1.FreeBSD.org (Postfix) with SMTP id 0528643FA3 for ; Sun, 16 Nov 2003 13:51:46 -0800 (PST) (envelope-from zkzklj@yahoo.com) Message-ID: <20031116215145.33059.qmail@web21407.mail.yahoo.com> Received: from [129.130.5.229] by web21407.mail.yahoo.com via HTTP; Sun, 16 Nov 2003 13:51:45 PST Date: Sun, 16 Nov 2003 13:51:45 -0800 (PST) From: Kai Zhu To: Murat Balaban In-Reply-To: <20031116201323.GA26716@enderunix.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Content-Filtered-By: Mailman/MimeDel 2.1.1 cc: freebsd-hackers@freebsd.org Subject: Re: Questions on intercepting execve syscall X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2003 21:51:46 -0000 Thanks Murat! I have tried your example, and fixed the problem of my code accordingly. Murat Balaban wrote: Hi, It might be that you have some bad address in the execve index of sysent array. See http://www.enderunix.org/murat/linux_subexec/linux_subexec.c for a simple example. PS: don't mind the naming :). On Sun, Nov 16, 2003 at 07:53:30AM -0800, Kai Zhu wrote: > Hello all, > > I am writing a KLD module to intercept execve() as following: > > static int my_execve(struct thread *td, struct execve_args *uap) > { > return(execve(td,uap)); > } > > As you can see, I first just want to make sure that my_execve won't affect the original execve, then I will add some new logic in my_execve before returning to execve(). > After kldload with this module, I always get "Bad address" error if I use any command like ls, cd, etc. > > Does anyone know where my problem is? Thanks! > > > --------------------------------- > Do you Yahoo!? > Protect your identity with Yahoo! Mail AddressGuard > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" -- "When all else fails, read the instructions -- Murphy's Technology Laws" Murat Balaban http://www.enderunix.org --------------------------------- Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard