[PATCH 16/29] netvm: filter emergency skbs.

2007-02-21 Thread Peter Zijlstra
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 <[EMAIL PROTECTED]>
---
 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.0 
+0100
+++ linux-2.6-git/include/net/sock.h2007-02-14 16:16:27.0 +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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 16/29] netvm: filter emergency skbs.

2007-02-21 Thread Peter Zijlstra
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 [EMAIL PROTECTED]
---
 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.0 
+0100
+++ linux-2.6-git/include/net/sock.h2007-02-14 16:16:27.0 +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 from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/