Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Sep 2004 21:13:42 -0700
From:      Julian Elischer <julian@elischer.org>
To:        Don Lewis <truckman@freebsd.org>
Cc:        gerarra@tin.it
Subject:   Re: FreeBSD Kernel buffer overflow
Message-ID:  <414D0776.9010805@elischer.org>
In-Reply-To: <200409181808.i8II8doH002297@gw.catspoiler.org>
References:  <200409181808.i8II8doH002297@gw.catspoiler.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Don Lewis wrote:
> On 18 Sep, gerarra@tin.it wrote:
> 
>>Here i report a patch different from Giorgos' one. The approch is completely
>>different: working on syscall_register() function in kern/kern_syscalls.c
>>file.
>>
>>==============================
>>
>>
>>>cat kern_syscalls.diff
>>
>>--- kern_syscalls.c     Sat Sep 18 14:37:53 2004
>>+++ kern_syscalls2.c    Sat Sep 18 14:37:53 2004
>>@@ -73,6 +73,11 @@
>>                                sysent[*offset].sy_call != (sy_call_t *)lkmressys)
>>                return EEXIST;
>>
>>+#if (__i386__) && (INVARIANTS)
>>+       KASSERT(new_sysent->nargs >= 0 && new_sysent->nargs <= i386_SYS_ARGS,
>>+               "invalid number of syscalls");
>>+#endif
>>+
>>        *old_sysent = sysent[*offset];
>>        sysent[*offset] = *new_sysent;
>>        return 0;
> 
> 
> Why panic the machine at this point?  Just refuse to install the syscall
> and return an error.

and the test for INVARIANTS is un-needed.. KASSERT only compiles to anything
when INVARIANTS is defined.

> 
> _______________________________________________
> 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"




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?414D0776.9010805>