Skip to contentSkip to conversation

PAN and kernel 2.4.26

Bluez-devel Bastian Ballmann 2 participants 10 messages Jun 26, 2004 – Jun 28, 2004 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hello,
I've got a little problem using PAN with a kernel 2.4.26. If I start pand I'll get the error:
pand[698]: Bluetooth PAN daemon
pand[698]: Failed to get L2CAP options. Invalid argument(22) I tried the same using kernel 2.6.7. and it works, but I have to use kernel 2.4, because of a wlan driver, which is not supported for kernel 2.6.
I tried to l2ping the bluetooth adapter, that works and I can also open a l2cap socket on that host, so l2cap works.
I've installed the newest bluez packages and also patched the kernel using patch-2.4.26-mh1.gz. No effect.
Any suggestions?
Thx & Greets

Basti

maintainer
#1 lore raw

Hi Bastian,

Quoted 11 lines

I've got a little problem using PAN with a kernel 2.4.26. If I start pand I'll get the error:
pand[698]: Bluetooth PAN daemon
pand[698]: Failed to get L2CAP options. Invalid argument(22) I tried the same using kernel 2.6.7. and it works, but I have to use kernel 2.4, because of a wlan driver, which is not supported for kernel 2.6.
I tried to l2ping the bluetooth adapter, that works and I can also open a l2cap socket on that host, so l2cap works.
I've installed the newest bluez packages and also patched the kernel using patch-2.4.26-mh1.gz. No effect.

this should actually not fail. Do you had any 2.4 version working? What bluez-utils version is installed?

Regards

Marcel

-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Bluez-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#2 lore raw

Hi Marcel,

Quoted 1 line · Marcel Holtmann

this should actually not fail.

I've got a 2.4.26 on my laptop and PAN is working without any problems, therefore it cannot be a problem with this kernel version, but I wonder, that it's working togehter with 2.6.7.
I've absolutly no idea why this could fail on my 2.4.26er kernel...

Quoted 1 line

What bluez-utils version is installed?

It's bluez-utils-2.7. Same result using version 2.3. Greets

Basti

maintainer
#3 lore raw

Hi Bastian,

Quoted 6 lines
Quoted 1 line

this should actually not fail.

I've got a 2.4.26 on my laptop and PAN is working without any problems, therefore it cannot be a problem with this kernel version, but I wonder, that it's working togehter with 2.6.7.
I've absolutly no idea why this could fail on my 2.4.26er kernel...

so about what kernel version are we talking that fails? I am little bit lost.

Regards

Marcel

-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Bluez-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#4 lore raw

Hi Marcel,

Quoted 2 lines · Marcel Holtmann

so about what kernel version are we talking that fails? I am little bit lost.

PAN on 2.4.26 fails with "Failed to get L2CAP options. Invalid argument(22)", but it cannot be a problem with that kernel version, because I am now using the same kernel version on my laptop and PAN is working. Greets

Basti

maintainer
#5 lore raw

Hi Bastian,

Quoted 6 lines
Quoted 2 lines

so about what kernel version are we talking that fails? I am little bit lost.

PAN on 2.4.26 fails with "Failed to get L2CAP options. Invalid argument(22)", but it cannot be a problem with that kernel version, because I am now using the same kernel version on my laptop and PAN is working.

now I understand it. Is this a vanilla 2.4.26 from kernel.org?

Regards

Marcel

-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Bluez-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#6 lore raw

Hi Marcel,

Quoted 1 line · Marcel Holtmann

Is this a vanilla 2.4.26 from kernel.org?

Yes it is. Including the security patch from openwall.com. Greets

Basti

maintainer
#7 lore raw

Hi Bastian,

Quoted 3 lines
Quoted 1 line

Is this a vanilla 2.4.26 from kernel.org?

Yes it is. Including the security patch from openwall.com.

remove the security patch and try again.

Regards

Marcel

-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Bluez-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

A message that is not in the archive (sent off-list or not yet received): [email protected]

maintainer
#9 lore raw

Hi Bastian,

Quoted 3 lines
Quoted 1 line

remove the security patch and try again.

Same effect.

I don't think so, because I looked at the patch and this seems to introducing the problem:

net/socket.c Sat Apr 17 02:13:55 2004 renamed from net/socket.c Fri Feb 20 10:07:45 2004 +8 -0
diff -urPX nopatch linux-2.4.26/net/socket.c linux/net/socket.c
@@ -1307,10 +1307,18 @@
 asmlinkage long sys_getsockopt(int fd, int level, int optname, char *optval, int *optlen)
 {
        int err;
+       int len;
        struct socket *sock;
 
        if ((sock = sockfd_lookup(fd, &err))!=NULL)
        {
+               /* XXX: insufficient for SMP, but should be redundant anyway */
+               if (get_user(len, optlen))
+                       err = -EFAULT;
+               else
+               if (len < 0)
+                       err = -EINVAL;
+               else
                if (level == SOL_SOCKET)
                        err=sock_getsockopt(sock,level,optname,optval,optlen);
                else

And here is the fix for pand to also work with the patch:

main.c 28 Jun 2004 10:56:35 -0000 renamed from main.c 31 May 2004 22:21:42 -0000 1.4 +2 -0
diff -u -r1.4 main.c
@@ -136,6 +136,7 @@
        }
 
        /* Setup L2CAP options according to BNEP spec */
+       olen = sizeof(l2o);
        if (getsockopt(sk, SOL_L2CAP, L2CAP_OPTIONS, &l2o, &olen) < 0) {
                syslog(LOG_ERR, "Failed to get L2CAP options. %s(%d)",
                                strerror(errno), errno);
@@ -257,6 +258,7 @@
        }
 
        /* Setup L2CAP options according to BNEP spec */
+       olen = sizeof(l2o);
        getsockopt(sk, SOL_L2CAP, L2CAP_OPTIONS, &l2o, &olen);
        l2o.imtu = l2o.omtu = BNEP_MTU;
        setsockopt(sk, SOL_L2CAP, L2CAP_OPTIONS, &l2o, sizeof(l2o));

I committed this one already to CVS, because it is an obvious fix.

Regards

Marcel

-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Bluez-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#10 lore raw

Hi Marcel,

Quoted 2 lines · Marcel Holtmann

I don't think so, because I looked at the patch and this seems to introducing the problem:

I thought it would be enough to disable all patches in my .config and recompile the kernel, but that seems to be wrong...

Quoted 1 line

And here is the fix for pand to also work with the patch:

Yes, that works. Thanks a lot! :P
Greets

Basti