From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: netdev@vger.kernel.org, gthelen@google.com, mhocko@suse.com,
mgorman@suse.de
Subject: Re: [PATCH net] net: add pfmemalloc check in sk_add_backlog()
Date: Tue, 29 Sep 2015 21:56:07 -0700 (PDT) [thread overview]
Message-ID: <20150929.215607.1418732892830129304.davem@davemloft.net> (raw)
In-Reply-To: <1443577945.32531.10.camel@edumazet-glaptop2.roam.corp.google.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 29 Sep 2015 18:52:25 -0700
> From: Eric Dumazet <edumazet@google.com>
>
> Greg reported crashes hitting the following check in __sk_backlog_rcv()
>
> BUG_ON(!sock_flag(sk, SOCK_MEMALLOC));
>
> The pfmemalloc bit is currently checked in sk_filter().
>
> This works correctly for TCP, because sk_filter() is ran in
> tcp_v[46]_rcv() before hitting the prequeue or backlog checks.
>
> For UDP or other protocols, this does not work, because the sk_filter()
> is ran from sock_queue_rcv_skb(), which might be called _after_ backlog
> queuing if socket is owned by user by the time packet is processed by
> softirq handler.
>
> Fixes: b4b9e35585089 ("netvm: set PF_MEMALLOC as appropriate during SKB processing")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Reported-by: Greg Thelen <gthelen@google.com>
Applied, thanks Eric.
next prev parent reply other threads:[~2015-09-30 4:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-30 1:52 [PATCH net] net: add pfmemalloc check in sk_add_backlog() Eric Dumazet
2015-09-30 4:56 ` David Miller [this message]
2015-10-02 9:38 ` Eric Dumazet
2015-10-16 15:38 ` Eric Dumazet
2015-10-17 12:02 ` David Miller
2015-10-17 16:04 ` Eric Dumazet
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=20150929.215607.1418732892830129304.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=gthelen@google.com \
--cc=mgorman@suse.de \
--cc=mhocko@suse.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).