Subject: Re: systrace broken in -current?
To: None <firstname.lastname@example.org>
From: Jeff Ito <email@example.com>
Date: 05/25/2004 20:08:29
On Tue, May 25, 2004 at 01:41:18PM -0400, Niels Provos wrote:
> On Sun, May 23, 2004 at 11:18:25AM -0400, Jeff Ito wrote:
> > I don't know if this suggests an underlying error in systrace that
> > this exposed, or in the sys_process.c diff, but hopefully this will
> > give someone a place to start looking.
> The following diff
> Index: kern_systrace.c
> RCS file: /cvsroot/src/sys/kern/kern_systrace.c,v
> retrieving revision 1.39
> diff -u -r1.39 kern_systrace.c
> --- kern_systrace.c 25 Apr 2004 16:42:41 -0000 1.39
> +++ kern_systrace.c 25 May 2004 16:06:59 -0000
> @@ -1191,7 +1191,7 @@
> iov.iov_len = io->strio_len;
> uio.uio_iov = &iov;
> uio.uio_iovcnt = 1;
> - uio.uio_offset = (off_t)(long)io->strio_offs;
> + uio.uio_offset = (off_t)(unsigned long)io->strio_offs;
> uio.uio_resid = io->strio_len;
> uio.uio_segflg = UIO_USERSPACE;
> uio.uio_procp = p;
> solves the problem, but I have to admin that I do not understand
> the original reason for the casting. But basically, the long is
> signed and then converting to (off_t) extended the signedness.
This patch has fixed the problem, thanks.