Subject: Re: systrace broken in -current?
To: None <email@example.com>
From: Christos Zoulas <firstname.lastname@example.org>
Date: 05/25/2004 22:39:10
In article <20040525174118.GA16052@citi.citi.umich.edu>,
Niels Provos <email@example.com> 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
>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.
I don't know the reason for the original cast; it seems wrong to me.