From: David Miller <davem@davemloft.net>
To: da-x@monatomic.org
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] tcp_sendpage(): fix broken page iteration
Date: Sun, 18 Mar 2007 14:49:27 -0700 (PDT) [thread overview]
Message-ID: <20070318.144927.78708843.davem@davemloft.net> (raw)
In-Reply-To: <20070318124346.GA6396@localdomain>
From: Dan Aloni <da-x@monatomic.org>
Date: Sun, 18 Mar 2007 14:43:46 +0200
> do_tcp_sendpages() should not iterate 'pages' as an array since
> it is not an array of 'struct page *', but a pointer to a single
> entity of 'struct page *' passed on the stack as a parameter to
> tcp_send_page() (hence it would crash if poffset + psize > PAGE_SIZE,
> because pages[1] and beyond most probably not constitutes a valid
> 'struct page *').
do_tcp_sendpages() should never get passed poffset+psize>PAGE_SIZE,
that would be a bug.
Feel free to add a BUG() check for that if you wish, and a fix for any
caller which violates this.
The code is perfectly fine as-is. It was originally written to accept
page arrays, but once it was decided that ->sendpage() would only pass
in one page, we simply modified to caller of do_tcp_sendpages() to
accomodate this argument passing change, instead of changing
do_tcp_sendpages() which is totally unnecessary.
next prev parent reply other threads:[~2007-03-18 21:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-18 12:43 [PATCH] tcp_sendpage(): fix broken page iteration Dan Aloni
2007-03-18 12:50 ` Dan Aloni
2007-03-18 21:49 ` David Miller [this message]
2007-03-18 22:40 ` Dan Aloni
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=20070318.144927.78708843.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=da-x@monatomic.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).