aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/filter.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-08-03 12:59:38 +0200
committerTakashi Iwai <tiwai@suse.de>2012-08-03 12:59:38 +0200
commitd30a0d839a5a282e43353fee53d5dc70db5eceda (patch)
tree189a91615be3174a9ff8b20937359d11298433af /net/core/filter.c
parentALSA: emu10k1: Avoid access to invalid pages when period=1 (diff)
parentALSA: isa: Move snd_legacy_find_free_ioport to initval.h (diff)
downloadlinux-dev-d30a0d839a5a282e43353fee53d5dc70db5eceda.tar.xz
linux-dev-d30a0d839a5a282e43353fee53d5dc70db5eceda.zip
Merge branch 'topic/next' into for-next
Diffstat (limited to 'net/core/filter.c')
-rw-r--r--net/core/filter.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/core/filter.c b/net/core/filter.c
index d4ce2dc712e3..907efd27ec77 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -83,6 +83,14 @@ int sk_filter(struct sock *sk, struct sk_buff *skb)
int err;
struct sk_filter *filter;
+ /*
+ * If the skb was allocated from pfmemalloc reserves, only
+ * allow SOCK_MEMALLOC sockets to use it as this socket is
+ * helping free memory
+ */
+ if (skb_pfmemalloc(skb) && !sock_flag(sk, SOCK_MEMALLOC))
+ return -ENOMEM;
+
err = security_sock_rcv_skb(sk, skb);
if (err)
return err;