From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <20070221144843.132373000@taijtu.programming.kicks-ass.net> References: <20070221144304.512721000@taijtu.programming.kicks-ass.net> Date: Wed, 21 Feb 2007 15:43:20 +0100 From: Peter Zijlstra Subject: [PATCH 16/29] netvm: filter emergency skbs. Content-Disposition: inline; filename=netvm-sk_filter.patch Sender: owner-linux-mm@kvack.org Return-Path: To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org Cc: Peter Zijlstra , Trond Myklebust , Thomas Graf , David Miller List-ID: Toss all emergency packets not for a SOCK_VMIO socket. This ensures our precious memory reserve doesn't get stuck waiting for user-space. Signed-off-by: Peter Zijlstra --- include/net/sock.h | 3 +++ 1 file changed, 3 insertions(+) Index: linux-2.6-git/include/net/sock.h =================================================================== --- linux-2.6-git.orig/include/net/sock.h 2007-02-14 16:15:49.000000000 +0100 +++ linux-2.6-git/include/net/sock.h 2007-02-14 16:16:27.000000000 +0100 @@ -926,6 +926,9 @@ static inline int sk_filter(struct sock { int err; struct sk_filter *filter; + + if (skb_emergency(skb) && !sk_has_vmio(sk)) + return -EPERM; err = security_sock_rcv_skb(sk, skb); if (err) -- -- 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: email@kvack.org