Linux bluetooth development
 help / color / mirror / Atom feed
From: Jean Tourrilhes <jt@bougret.hpl.hp.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: Max Krasnyansky <maxk@qualcomm.com>,
	BlueZ mailing list <bluez-devel@lists.sourceforge.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [BUG] BlueTooth socket busted in 2.6.0-test5
Date: Thu, 11 Sep 2003 13:32:49 -0700	[thread overview]
Message-ID: <20030911203249.GA15575@bougret.hpl.hp.com> (raw)
In-Reply-To: <1063237174.28890.6.camel@pegasus>

On Thu, Sep 11, 2003 at 01:39:28AM +0200, Marcel Holtmann wrote:
> 
> yesterday David Woodhouse sent a patch which should fix this.
> 
> Regards
> 
> Marcel

	My testing was too light :
------------------------------------------------------
kernel BUG at include/linux/module.h:296!
invalid operand: 0000 [#1]
CPU:    0
EIP:    0060:[<d087b72d>]    Not tainted
EFLAGS: 00010246
EIP is at bnep_sock_create+0x69/0xb2 [bnep]
eax: 00000000   ebx: cf46cd00   ecx: 00000020   edx: d087d860
esi: ceac3120   edi: 00000004   ebp: ffffffa3   esp: c4031f2c
ds: 007b   es: 007b   ss: 0068
Process pand (pid: 1945, threadinfo=c4030000 task=ccee20a0)
Stack: 00000010 d08ac544 d08a10f4 ceac3120 00000004 ceac3120 0000007c c033ecc0 
       ffffff9f c01e1236 ceac3120 00000004 0000001f bffff934 c4031fa8 00000001 
       c01e1325 0000001f 00000003 00000004 c4031f84 00000000 c4031fa8 c01e216c 
Call Trace:
 [<d08a10f4>] bt_sock_create+0x8c/0xd0 [bluetooth]
 [<c01e1236>] sock_create+0x12e/0x200
 [<c01e1325>] sys_socket+0x1d/0x50
 [<c01e216c>] sys_socketcall+0xbc/0x260
 [<c010973d>] error_code+0x2d/0x38
 [<c0108cd3>] syscall_call+0x7/0xb

Code: 0f 0b 28 01 7c bf 87 d0 b8 00 e0 ff ff 21 e0 8b 40 10 c1 e0 
 
------------------------------------------------------

	On top of the previous patch, I've now added :
--------------------------------------------
diff -u -p linux/net/bluetooth/bnep/sock.m1.c linux/net/blueto
oth/bnep/sock.c 
--- linux/net/bluetooth/bnep/sock.m1.c  Thu Sep 11 13:12:02 2003
+++ linux/net/bluetooth/bnep/sock.c     Thu Sep 11 13:22:23 2003
@@ -173,6 +173,13 @@ static int bnep_sock_create(struct socke
        if (sock->type != SOCK_RAW)
                return -ESOCKTNOSUPPORT;
 
+       /* sk_set_owner() will use __module_get(), that require
+        * the module to have *some* refcount... I would have though the
+        * code in bt_sock_create() would do that, but it seems to
+        * increase the refcount of bluetooth.o. Jean II */
+       if(!try_module_get(THIS_MODULE))
+               return -EPROTONOSUPPORT;
+
        if (!(sk = bt_sock_alloc(sock, PF_BLUETOOTH, 0, GFP_KERNEL)))
                return -ENOMEM;
 
@@ -184,6 +191,7 @@ static int bnep_sock_create(struct socke
 
        sk->sk_destruct = NULL;
        sk->sk_protocol = protocol;
+       module_put(THIS_MODULE);
        return 0;
 }
 
--------------------------------------------
	This is of course a very gross hack, but with both patches I
now can use BNEP properly. Well, you get the idea...

	Have fun...

	Jean

  parent reply	other threads:[~2003-09-11 20:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-10 22:58 [BUG] BlueTooth socket busted in 2.6.0-test5 Jean Tourrilhes
2003-09-10 23:39 ` [Bluez-devel] " Marcel Holtmann
2003-09-10 23:47   ` Jean Tourrilhes
2003-09-11 20:32   ` Jean Tourrilhes [this message]
2003-09-12  5:21     ` [Bluez-devel] " David Woodhouse
2003-09-12  8:19       ` David Woodhouse
2003-09-12 21:34         ` Jean Tourrilhes

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=20030911203249.GA15575@bougret.hpl.hp.com \
    --to=jt@bougret.hpl.hp.com \
    --cc=bluez-devel@lists.sourceforge.net \
    --cc=jt@hpl.hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=maxk@qualcomm.com \
    /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