All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin LaHaise <bcrl@redhat.com>
To: Chris Wedgwood <cw@f00f.org>
Cc: torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: Re: [bkpatch] add sys_sendfile64
Date: Mon, 4 Mar 2002 09:17:28 -0500	[thread overview]
Message-ID: <20020304091727.B18187@redhat.com> (raw)
In-Reply-To: <20020303161818.A18187@redhat.com> <20020304031023.GA14757@tapu.f00f.org>
In-Reply-To: <20020304031023.GA14757@tapu.f00f.org>; from cw@f00f.org on Sun, Mar 03, 2002 at 07:10:23PM -0800

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

  reply	other threads:[~2002-03-04 14:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-03 21:18 [bkpatch] add sys_sendfile64 Benjamin LaHaise
2002-03-04  3:10 ` Chris Wedgwood
2002-03-04 14:17   ` Benjamin LaHaise [this message]
2002-03-04 16:27   ` Benjamin LaHaise

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020304091727.B18187@redhat.com \
    --to=bcrl@redhat.com \
    --cc=cw@f00f.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.