Netdev List
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: netdev@vger.kernel.org, bugme-daemon@bugzilla.kernel.org, link@miggy.org
Subject: Re: [Bugme-new] [Bug 8961] New: BUG triggered by oidentd in netlink code
Date: Fri, 31 Aug 2007 13:05:04 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0708311258520.8423@x2> (raw)
In-Reply-To: <20070830180842.7c8414fe.akpm@linux-foundation.org>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1506 bytes --]

On Thu, 30 Aug 2007, Andrew Morton wrote:

> On Thu, 30 Aug 2007 07:41:31 -0700 (PDT) bugme-daemon@bugzilla.kernel.org wrote:
>
>> http://bugzilla.kernel.org/show_bug.cgi?id=8961
>
> This looks serious.
>
>>            Summary: BUG triggered by oidentd in netlink code
>>
>> Aug 29 23:28:44 bowl kernel: [349587.500440] BUG: unable to handle kernel NULL
>> pointer dereference<1>BUG: unable to handle kernel NULL pointer dereference at
>> virtual address 00000054
>> Aug 29 23:28:44 bowl kernel: [349587.500454]  printing eip:
>> Aug 29 23:28:45 bowl kernel: [349587.500457] c03318ae
>> Aug 29 23:28:45 bowl kernel: [349587.500459] *pde = 00000000
>> Aug 29 23:28:45 bowl kernel: [349587.500464] Oops: 0000 [#1]
>> Aug 29 23:28:45 bowl kernel: [349587.500466] PREEMPT SMP
>> Aug 29 23:28:46 bowl kernel: [349587.500474] Modules linked in: w83627hf
>> hwmon_vid i2c_isa
>> Aug 29 23:28:46 bowl kernel: [349587.500483] CPU:    0
>> Aug 29 23:28:47 bowl kernel: [349587.500485] EIP:    0060:[<c03318ae>]    Not
>> tainted VLI
>> Aug 29 23:28:47 bowl kernel: [349587.500487] EFLAGS: 00010246   (2.6.22.3 #1)
>> Aug 29 23:28:47 bowl kernel: [349587.500499] EIP is at netlink_rcv_skb+0xa/0x7e
>> Aug 29 23:28:48 bowl kernel: [349587.500506] eax: 00000000   ebx: 00000000


Seems to be a bug introduced by the netlink_run_queue conversion,
since there is no locking and netlink_run_queue doesn't check
for NULL results from skb_dequeue, it might pass NULL to
netlink_rcv_skb, which crashes.

Does this patch help?

[-- Attachment #2: Type: TEXT/PLAIN, Size: 597 bytes --]

diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index dbeacd8..8e1078d 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -836,12 +836,17 @@ static int inet_diag_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
 	return inet_diag_get_exact(skb, nlh);
 }
 
+static DEFINE_MUTEX(inet_diag_mutex);
+
 static void inet_diag_rcv(struct sock *sk, int len)
 {
 	unsigned int qlen = 0;
 
 	do {
+		if (!mutex_trylock(&inet_diag_mutex))
+			return;
 		netlink_run_queue(sk, &qlen, &inet_diag_rcv_msg);
+		mutex_unlock(&inet_diag_mutex);
 	} while (qlen);
 }
 

  reply	other threads:[~2007-08-31 11:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-8961-10286@http.bugzilla.kernel.org/>
2007-08-31  1:08 ` [Bugme-new] [Bug 8961] New: BUG triggered by oidentd in netlink code Andrew Morton
2007-08-31 11:05   ` Patrick McHardy [this message]
2007-08-31 12:38     ` Athanasius
2007-09-01 16:38       ` Patrick McHardy
2007-09-01 17:39         ` Athanasius
2007-09-01 22:53           ` Patrick McHardy
2007-09-02  4:04         ` Herbert Xu
2007-09-02 10:56           ` Patrick McHardy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0708311258520.8423@x2 \
    --to=kaber@trash.net \
    --cc=akpm@linux-foundation.org \
    --cc=bugme-daemon@bugzilla.kernel.org \
    --cc=link@miggy.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox