Date: Mon, 20 Sep 2004 11:37:42 -0700 (PDT) From: Don Lewis <truckman@FreeBSD.org> To: gerarra@tin.it Cc: freebsd-hackers@FreeBSD.org Subject: Re: FreeBSD Kernel buffer overflow Message-ID: <200409201837.i8KIbgWj008174@gw.catspoiler.org> In-Reply-To: <4146316C0000C7E2@ims3a.cp.tin.it>
next in thread | previous in thread | raw e-mail | index | archive | help
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().
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200409201837.i8KIbgWj008174>