lkml.org 
[lkml]   [2003]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH - RFC] [1/2] 2.6 must-fix list - kernel error reporting
On Thu, 10 Jul 2003, Jim Keniston wrote:

> James Morris wrote:
> >
> > On Tue, 8 Jul 2003, Jim Keniston wrote:
> >
> > + kerror_nl = netlink_kernel_create(NETLINK_KERROR, kerror_netlink_rcv);
> > + if (kerror_nl == NULL)
> > + panic("kerror_init: cannot initialize kerror_nl\n");
> >
> > You can simply use NULL instead of passing the dummy kerror_netlink_rcv
> > function.
>
> That begs the question: do we trust that nobody but the kernel will send
> packets to a NETLINK_KERROR socket? Ordinary users can't, but any root
> application can. Without kerror_netlink_rcv(), such packets don't get
> dequeued.

Indeed, the kernel socket buffer fills up.

I think this needs to be addressed in the netlink code, per the patch
below.

Comments?


- James
--
James Morris
<jmorris@intercode.com.au>

diff -NurX dontdiff linux-2.5.75.orig/net/netlink/af_netlink.c linux-2.5.75.w1/net/netlink/af_netlink.c
--- linux-2.5.75.orig/net/netlink/af_netlink.c 2003-06-26 12:43:45.000000000 +1000
+++ linux-2.5.75.w1/net/netlink/af_netlink.c 2003-07-12 01:23:49.708254261 +1000
@@ -430,6 +430,10 @@
goto no_dst;
nlk = nlk_sk(sk);

+ /* Don't bother queuing skb if kernel socket has no input function */
+ if (nlk->pid == 0 && !nlk->data_ready)
+ goto no_dst;
+
#ifdef NL_EMULATE_DEV
if (nlk->handler) {
skb_orphan(skb);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:46    [W:0.209 / U:1.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site