Re: [bkpatch] add sys_sendfile64

From: Benjamin LaHaise (bcrl@redhat.com)
Date: Mon Mar 04 2002 - 09:17:28 EST


On Sun, Mar 03, 2002 at 07:10:23PM -0800, Chris Wedgwood wrote:
> We have a problem if off + count >= 2^32 here.
>
> Ideally i think we need to check for 32-bit (31-bit?) overflow here
> and return -EOVERFLOW. I made a similar patch last night for
> sendfile64 which included this check (although I was tired and the
> patch was slightly wrong). Actually, I think wew are missing
> EOVERFLOW checks in a number of paths, ideally I'd like to make one
> function to check and have all other functions reference that if
> people agree that makes sense.

I was just following the semantics of the original code. -EOVERFLOW
checks are certainly doable; I'll post an update in a bit.

> + }
> + ret = common_sendfile(out_fd, in_fd, ppos, count);
> + if (offset)
> + put_user((off_t)pos, offset);
> + return ret;
>
> What is another thread unmapped 'offset' during the system call? Do
> we want to check the result of put_user here and return -EFAULT?
> (If so, there are other system calls to consider such as select).

Again, the original code didn't bother checking. As far as how it
should work, I'd rather send a segv to the app as otherwise it is
impossible to determine how much data was actually transferred.

                -ben
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Mar 07 2002 - 21:00:32 EST