From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 20 18:37:53 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 7B94216A4CE for ; Mon, 20 Sep 2004 18:37:53 +0000 (GMT) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 659A243D1F for ; Mon, 20 Sep 2004 18:37:52 +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 i8KIbgWj008174; Mon, 20 Sep 2004 11:37:47 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200409201837.i8KIbgWj008174@gw.catspoiler.org> Date: Mon, 20 Sep 2004 11:37:42 -0700 (PDT) From: Don Lewis To: gerarra@tin.it In-Reply-To: <4146316C0000C7E2@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: Mon, 20 Sep 2004 18:37:53 -0000 On 20 Sep, gerarra@tin.it wrote: >> cat kern_syscalls.diff > --- kern_syscalls.c Sat Sep 18 13:42:21 2004 > +++ kern_syscalls2.c Mon Sep 20 14:18:45 2004 > @@ -58,6 +58,16 @@ > syscall_register(int *offset, struct sysent *new_sysent, > struct sysent *old_sysent) > { > +#ifndef __ia64__ > + if (new_sysent->sy_narg < 0 || new_sysent->sy_narg > MAX_SYSCALL_ARGS) > + { > + printf("Invalid sy_narg for syscall: boundary is [0 - %d]\n", > + MAX_SYSCALL_ARGS); > + return EINVAL; > + } > +#endif > + > + It would probably be better to change the #ifndef to #ifdef MAX_SYSCALL_ARGS I would also add new_sysent->sy_narg to the printf().