From: Neil Brown <neilb@cse.unsw.edu.au>
To: Andrew Morton <akpm@digeo.com>
Cc: Felipe Alfaro Solana <felipe_alfaro@linuxmail.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Trond Myklebust <trond.myklebust@fys.uio.no>
Subject: Re: 2.5.69-mm9
Date: Mon, 26 May 2003 09:16:10 +1000 [thread overview]
Message-ID: <16081.20154.686639.275401@notabene.cse.unsw.edu.au> (raw)
In-Reply-To: message from Andrew Morton on Sunday May 25
On Sunday May 25, akpm@digeo.com wrote:
> > EIP is at svc_udp_recvfrom+0x52b/0x560 [sunrpc]
>
> OK, you have CONFIG_DEBUG_PAGEALLOC set. That's the patch which unmaps
> pages from kernel virtual address space when they are freed.
>
> That patch seems quite stable on uniprocessor at least - there are question
> marks over its honesty on SMP.
>
> I would be inclined to say that this is a hitherto undiscovered
> use-after-free bug.
Good inclination. See patch.
As far as I can tell, sock->stamp is only ever used for
SIOCGSTAMP, which probably doesn't need to be support for
these rpc sockets, but I guess it doesn't hurt..
NeilBrown
--------------------------------------------
Extract ->stamp from skb *before* freeing it in svcsock.c
As we sometime copy and free an skb, and sometime us it
in-place, we must be careful to extract information from
it *before* it might be freed, not after.
----------- Diffstat output ------------
./net/sunrpc/svcsock.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletion(-)
diff ./net/sunrpc/svcsock.c~current~ ./net/sunrpc/svcsock.c
--- ./net/sunrpc/svcsock.c~current~ 2003-05-21 13:17:52.000000000 +1000
+++ ./net/sunrpc/svcsock.c 2003-05-26 09:11:32.000000000 +1000
@@ -589,6 +589,8 @@ svc_udp_recvfrom(struct svc_rqst *rqstp)
rqstp->rq_addr.sin_port = skb->h.uh->source;
rqstp->rq_addr.sin_addr.s_addr = skb->nh.iph->saddr;
+ svsk->sk_sk->stamp = skb->stamp;
+
if (skb_is_nonlinear(skb)) {
/* we have to copy */
local_bh_disable();
@@ -629,7 +631,6 @@ svc_udp_recvfrom(struct svc_rqst *rqstp)
serv->sv_stats->netudpcnt++;
/* One down, maybe more to go... */
- svsk->sk_sk->stamp = skb->stamp;
svc_sock_received(svsk);
return len;
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>
next prev parent reply other threads:[~2003-05-25 23:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-25 11:27 2.5.69-mm9 Andrew Morton
2003-05-25 12:50 ` 2.5.69-mm9 Daniele Bellucci
2003-05-25 12:56 ` 2.5.69-mm9 Rudmer van Dijk
2003-05-25 13:58 ` 2.5.69-mm9 Ed Sweetman
2003-05-25 14:07 ` 2.5.69-mm9 Ed Sweetman
2003-05-25 20:06 ` 2.5.69-mm9 Andrew Morton
2003-05-25 20:29 ` 2.5.69-mm9 Adrian Bunk
2003-05-25 16:47 ` 2.5.69-mm9 Nicholas Wourms
2003-05-25 17:06 ` 2.5.69-mm9 Adam Kropelin
2003-05-25 21:56 ` 2.5.69-mm9 Felipe Alfaro Solana
2003-05-25 22:48 ` 2.5.69-mm9 Andrew Morton
2003-05-25 23:16 ` Neil Brown [this message]
2003-05-25 23:19 ` 2.5.69-mm9 Trond Myklebust
2003-05-26 18:30 ` 2.5.69-mm9 Daniele Bellucci
2003-05-26 19:20 ` 2.5.69-mm9 Daniele Bellucci
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=16081.20154.686639.275401@notabene.cse.unsw.edu.au \
--to=neilb@cse.unsw.edu.au \
--cc=akpm@digeo.com \
--cc=felipe_alfaro@linuxmail.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=trond.myklebust@fys.uio.no \
/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