tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Problem with syscall_disestablish() - PR kern/50430



On Wed, Nov 18, 2015 at 11:07 AM, Paul Goyette <paul%vps1.whooppee.com@localhost> wrote:
> Based on earlier comments, I've come up with a much-less-intrusive
> set of changes.  This time around, there are no bit masks and no new
> members in any system structures.  (I'm pretty sure we won't even
> need a kernel version bump for this.)
>
> Instead, I've modified sy_call() to check the current value of
> l_sysent before updating with the new syscall pointer.  If the
> current value is non-NULL then set a new flag bit LP_LOST_SYSENT in
> the lwp's l_pflag member.  This check is the only per-syscall cost:
>
>         if (l->l_sysent != NULL)
>                 l->l_pflag |= LP_LOST_SYSENT;

My understanding is that l_sysent is *always* overriden by syscalls
from within signal handlers, right?

I don't fully understand these things yet, but ... my gut feeling is
that l_sysent should be saved on stack in mi_switch(), like oldspl,
before cpu_switchto(), and restored after that.  In resuming code
path, check if syscall exists, in case syscall was forcibly
disestablished.  If it doesn't exist, forcibly kill self lwp ... maybe
using sigexit()?

(I believe someone from CS department understand such things 100% and
correct me if wrong. ;)


Home | Main Index | Thread Index | Old Index