From: "H. Peter Anvin" <hpa@zytor.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Ulrich Drepper <drepper@redhat.com>, Andi Kleen <ak@suse.de>,
"Viro, Al" <viro@ftp.linux.org.uk>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Limit sendfile() to 2^31-PAGE_CACHE_SIZE bytes without error
Date: Wed, 04 Jan 2006 10:58:00 -0800 [thread overview]
Message-ID: <43BC1AB8.3050801@zytor.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0601041033040.3668@g5.osdl.org>
Linus Torvalds wrote:
>
> On Wed, 4 Jan 2006, Linus Torvalds wrote:
>
>>On Tue, 3 Jan 2006, H. Peter Anvin wrote:
>>
>>>(I set the limit to 2^31-PAGE_CACHE_SIZE so that a transfer that starts at the
>>>beginning of the file will continue to be page-aligned.)
>>
>>Ok, this patch looks ok, if it's confirmed to unbreak apache.
>
> Actually, looking closer, this patch does the wrong thing for a size_t
> that is negative in ssize_t (which is technically "undefined behaviour" in
> POSIX, but turning it into a big positive number is objectively worse than
> returning -EINVAL).
>
OK, that's a fair cop. I agree. In fact, for readv/writev(), POSIX
does specify:
"If the sum of the iov_len values is greater than {SSIZE_MAX}, the
operation shall fail and no data shall be tranferred."
... which is good precedence for doing so for all values.
So, what system calls are affected? sendfile, [p]read[v], [p]write[v],
send*, recv*, any others?
-hpa
next prev parent reply other threads:[~2006-01-04 18:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <43BB348F.3070108@zytor.com>
[not found] ` <200601040451.20411.ak@suse.de>
[not found] ` <Pine.LNX.4.64.0601032051300.3668@g5.osdl.org>
[not found] ` <43BB5646.2040504@zytor.com>
2006-01-04 5:33 ` [PATCH] Limit sendfile() to 2^31-PAGE_CACHE_SIZE bytes without error H. Peter Anvin
2006-01-04 17:02 ` Linus Torvalds
2006-01-04 17:16 ` Ulrich Drepper
2006-01-04 18:41 ` H. Peter Anvin
2006-01-04 18:40 ` Linus Torvalds
2006-01-04 18:58 ` H. Peter Anvin [this message]
2006-01-04 19:28 ` Linus Torvalds
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=43BC1AB8.3050801@zytor.com \
--to=hpa@zytor.com \
--cc=ak@suse.de \
--cc=drepper@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
--cc=viro@ftp.linux.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox