Eric Dumazet c7c49b8fde net: add pfmemalloc check in sk_add_backlog()
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-10-17 05:01:11 -07:00
..
2015-06-14 12:55:49 -07:00
2015-09-09 08:33:31 -07:00
2014-09-18 10:54:36 +02:00
2015-03-04 00:23:23 -05:00
2015-06-28 16:55:44 -07:00
2015-03-06 21:50:02 -05:00
2015-08-18 14:17:21 -07:00
2015-08-31 21:23:42 -07:00
2013-11-07 19:28:58 -05:00
2014-09-30 01:02:26 -04:00
2015-03-12 14:39:40 -04:00
2014-01-03 20:56:48 -05:00
2015-07-21 10:39:05 -07:00
2014-06-02 11:00:41 -07:00
2015-03-12 22:58:12 -04:00
2014-05-22 14:57:15 -04:00
2015-09-01 14:32:44 -07:00
2015-08-11 12:41:35 +02:00