From owner-freebsd-hackers@FreeBSD.ORG Sat Sep 18 18:08:48 2004 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 3B06516A4CE for ; Sat, 18 Sep 2004 18:08:48 +0000 (GMT) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id F25AE43D31 for ; Sat, 18 Sep 2004 18:08:47 +0000 (GMT) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.1/8.13.1) with ESMTP id i8II8doH002297; Sat, 18 Sep 2004 11:08:44 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200409181808.i8II8doH002297@gw.catspoiler.org> Date: Sat, 18 Sep 2004 11:08:39 -0700 (PDT) From: Don Lewis To: gerarra@tin.it In-Reply-To: <4146316C0000A4AF@ims3a.cp.tin.it> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii cc: freebsd-hackers@FreeBSD.org Subject: Re: FreeBSD Kernel buffer overflow 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: Sat, 18 Sep 2004 18:08:48 -0000 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.