Skip to contentSkip to conversation

libipt_multiport: getsockopt failed strangely: Invalid argument

DISCUSSION Applied Arnaud Fontaine 3 participants 5 messages Dec 1, 2006 – Dec 2, 2006

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

Hello,

When I try to use the '-m multiport' argument, I have the following error message:

# /sbin/iptables -A INPUT -p tcp -m multiport --sports \
                 ssh,www,imap2,pop3,domain,https,smtp,auth -m state \
                  --state NEW,ESTABLISHED,RELATED -j ACCEPT
getsockopt failed strangely: Invalid argument

strace results:

munmap(0xf7fde000, 8192) = 0
open("/lib/iptables/libipt_multiport.so", O_RDONLY) = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\2\0\0\0\1\0\0\10"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=9208, ...}) = 0
mmap(NULL, 73704, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xf7dc0000 mprotect(0xf7dc2000, 65512, PROT_NONE) = 0
mmap(0xf7dd0000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0xf7dd0000
close(3) = 0
socket(PF_INET, SOCK_RAW, IPPROTO_RAW) = 3
getsockopt(3, SOL_IP, 0x42 /* IP_??? */, 0xff565346, 0xff565364) = -1 EINVAL (Invalid argument) write(2, "getsockopt failed strangely: Inv"..., 46getsockopt failed strangely: Invalid argument) = 46

This error happens only with 2.6.17 and 2.6.18, using 2.6.15 it works fine. I don't know at all how I could identify the problem. I'm using Debian GNU/Linux with sparc64-smp Linux kernel and iptables 1.3.6. I hope that i have sent this mail to the proper mailing list.

Regards,
Arnaud Fontaine

#1 lore raw
Quoted 24 lines · Arnaud Fontaine

Hello,

When I try to use the '-m multiport' argument, I have the following error message:

# /sbin/iptables -A INPUT -p tcp -m multiport --sports \
                 ssh,www,imap2,pop3,domain,https,smtp,auth -m state \
                  --state NEW,ESTABLISHED,RELATED -j ACCEPT
getsockopt failed strangely: Invalid argument

strace results:

munmap(0xf7fde000, 8192) = 0
open("/lib/iptables/libipt_multiport.so", O_RDONLY) = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\2\0\0\0\1\0\0\10"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=9208, ...}) = 0
mmap(NULL, 73704, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xf7dc0000 mprotect(0xf7dc2000, 65512, PROT_NONE) = 0
mmap(0xf7dd0000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0xf7dd0000
close(3) = 0
socket(PF_INET, SOCK_RAW, IPPROTO_RAW) = 3
getsockopt(3, SOL_IP, 0x42 /* IP_??? */, 0xff565346, 0xff565364) = -1 EINVAL (Invalid argument) write(2, "getsockopt failed strangely: Inv"..., 46getsockopt failed strangely: Invalid argument) = 46

Quoted 4 lines

This error happens only with 2.6.17 and 2.6.18, using 2.6.15 it works fine. I don't know at all how I could identify the problem. I'm using Debian GNU/Linux with sparc64-smp Linux kernel and iptables 1.3.6. I hope that i have sent this mail to the proper mailing list.

I *think* this should be fixed in 2.6.19. The 32 bit compat code didn't implement the SO_GET_REVISION_MATCH/TARGET options and returned an error.

maintainer
#2 lore raw

From: Patrick McHardy <[email protected]>
Date: Fri, 01 Dec 2006 17:24:39 +0100

Quoted 3 lines

I *think* this should be fixed in 2.6.19. The 32 bit compat code didn't implement the SO_GET_REVISION_MATCH/TARGET options and returned an error.

Agreed.

Once I have the fix I'll push it around to the -stable branches for you Patrick.

#3 lore raw
Quoted 9 lines · David Miller

From: Patrick McHardy <[email protected]>
Date: Fri, 01 Dec 2006 17:24:39 +0100

Quoted 3 lines

I *think* this should be fixed in 2.6.19. The 32 bit compat code didn't implement the SO_GET_REVISION_MATCH/TARGET options and returned an error.

Quoted 5 lines

Agreed.

Once I have the fix I'll push it around to the -stable branches for you Patrick.

Its already in 2.6.19, but I didn't expect it to really fix something. I've attached it again, it applies all the way back to 2.6.17 when the compat code was introduced.

[NETFILTER]: ip_tables: revision support for compat code

---
commit 79030ed07de673e8451a03aecb9ada9f4d75d491
tree 4ba8bd843c8bc95db0ea6877880b73d06da620e5
parent bec71b162747708d4b45b0cd399b484f52f2901a
author Patrick McHardy <[email protected]> Wed, 20 Sep 2006 12:05:08 -0700 committer David S. Miller <[email protected]> Fri, 22 Sep 2006 15:20:00 -0700

 net/ipv4/netfilter/ip_tables.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
net/ipv4/netfilter/ip_tables.c +3 -2
index 3d5d4a4..673581d 100644
@@ -1994,6 +1994,8 @@ compat_get_entries(struct compat_ipt_get
 	return ret;
 }
 
+static int do_ipt_get_ctl(struct sock *, int, void __user *, int *);
+
 static int
 compat_do_ipt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
 {
@@ -2007,8 +2009,7 @@ compat_do_ipt_get_ctl(struct sock *sk, i
 		ret = compat_get_entries(user, len);
 		break;
 	default:
-		duprintf("compat_do_ipt_get_ctl: unknown request %i\n", cmd);
-		ret = -EINVAL;
+		ret = do_ipt_get_ctl(sk, cmd, user, len);
 	}
 	return ret;
 }
maintainer Applied
#4 lore raw

From: Patrick McHardy <[email protected]>
Date: Sat, 02 Dec 2006 00:51:20 +0100

Quoted 3 lines

Its already in 2.6.19, but I didn't expect it to really fix something. I've attached it again, it applies all the way back to 2.6.17 when the compat code was introduced.

Pushed to -stable, thanks Patrick.