Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 May 1998 17:18:09 -0400 (EDT)
From:      Steve Kiernan <stevek@tis.com>
To:        freebsd-hackers@FreeBSD.ORG
Subject:   Restoring syscall for blocked procs in mod unload
Message-ID:  <Pine.BSF.3.96.980519170800.198A-100000@mufasa.va.tis.com>

next in thread | raw e-mail | index | archive | help

I'm working on a project which uses an LKM that intercepts the syscalls
for specific processes.  The problem I'm trying to solve is that if there
is a process which is blocked in a syscall which is intercepted by the LKM
and you unload the LKM, when the syscall unblocks and the stack frame is
popped, the EIP can be pointing to an invalid address and the kernel will
panic.

I tried setting up a function called via the sv_prepsyscall pointer in the
sysent structure which saves the trapframe and restores it (in
p->p_md.md_regs) on LKM unload with the EIP adjusted to act as an ERESTART
return from syscall would do, but this doesn't seem to work.

Am I heading in the right direction in this solution or should I be doing
something else?  Do I need to do some calls to reschedule the process
and/or fix-up any other pointers?  Anything special that needs to be done
dependent on the process being the currently-running one?

This is on a FreeBSD 2.2.5-RELEASE system, FYI.

Any pointers to RTFM is welcome.

--
Stephen Kiernan
stevek@tis.com
TIS Labs at Network Associates, Inc.



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?Pine.BSF.3.96.980519170800.198A-100000>