From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: anton@samba.org, netdev@vger.kernel.org
Subject: Re: [PATCH] net: sock_queue_err_skb() dont mess with sk_forward_alloc
Date: Mon, 31 May 2010 23:44:32 -0700 (PDT) [thread overview]
Message-ID: <20100531.234432.191383736.davem@davemloft.net> (raw)
In-Reply-To: <1275321766.3291.100.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 31 May 2010 18:02:46 +0200
> There is also a problem in ip_recv_error(), not called with socket
> locked, skb freed -> potential corruption.
>
> If current socket is 'owned' by a user thread, then we can still corrupt
> sk_forward_alloc, even if we use bh_lock_sock()
>
> I dont think we need to have another backlog for such case, maybe we
> could account for skb->truesize in sk_rmem_alloc (this is atomic), and
> not account for sk_mem_charge ?
That sounds fine to me.
> [PATCH] net: sock_queue_err_skb() dont mess with sk_forward_alloc
>
> Correct sk_forward_alloc handling for error_queue would need to use a
> backlog of frames that softirq handler could not deliver because socket
> is owned by user thread. Or extend backlog processing to be able to
> process normal and error packets.
>
> Another possibility is to not use mem charge for error queue, this is
> what I implemented in this patch.
>
> Note: this reverts commit 29030374
> (net: fix sk_forward_alloc corruptions), since we dont need to lock
> socket anymore.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Looks good, applied, thanks Eric.
prev parent reply other threads:[~2010-06-01 6:44 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-25 11:58 Warning in net/ipv4/af_inet.c:154 Anton Blanchard
2010-05-25 15:27 ` Eric Dumazet
2010-05-26 3:19 ` Anton Blanchard
2010-05-26 5:18 ` Eric Dumazet
2010-05-26 7:56 ` David Miller
2010-05-26 10:12 ` Eric Dumazet
2010-05-27 3:56 ` Anton Blanchard
2010-05-27 4:06 ` David Miller
2010-05-27 4:21 ` Eric Dumazet
2010-05-27 4:18 ` Eric Dumazet
2010-05-27 4:21 ` David Miller
2010-05-27 5:06 ` [PATCH] net: fix lock_sock_bh/unlock_sock_bh Eric Dumazet
2010-05-27 5:20 ` Eric Dumazet
2010-05-27 5:23 ` David Miller
2010-05-27 6:09 ` Anton Blanchard
2010-05-27 7:29 ` David Miller
2010-05-29 7:21 ` Warning in net/ipv4/af_inet.c:154 David Miller
2010-05-31 16:02 ` [PATCH] net: sock_queue_err_skb() dont mess with sk_forward_alloc Eric Dumazet
2010-06-01 6:44 ` David Miller [this message]
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=20100531.234432.191383736.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=anton@samba.org \
--cc=eric.dumazet@gmail.com \
--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).