Skip to contentSkip to conversation

iptables + geoip

DISCUSSION Robert Bruce 3 participants 6 messages Feb 11, 2008 – Feb 12, 2008 3 messages not in the archive netfilter

lore
Share & tools
lore
#0 lore raw

Hello

I tried to send this to the developers of geoip, but the email got returned to me. I can't put this on bugzilla as it is down at the moment...

Original Email:

Hi Guys

I've just tried to install geoip with iptables 1.4.0, everything is fine until I try to add a rule which uses the geoip module and I get a Segmentation fault. So I did some digging, compiled with -g for gdb and found that the problem is on line 229 as match is passed in with an address to 0x0.

I dunno how to fix that though..

#1 lore raw

Hello Robert,

Can you tell me the exact rule syntax you used ?

p.s. I'm actually updating geoip so it use the xtables framework,

cheers,

Nicolas Bouliane

Quoted 24 lines · Robert Bruce

Hello

I tried to send this to the developers of geoip, but the email got returned to me. I can't put this on bugzilla as it is down at the moment...

Original Email:

Hi Guys

I've just tried to install geoip with iptables 1.4.0, everything is fine until I try to add a rule which uses the geoip module and I get a Segmentation fault. So I did some digging, compiled with -g for gdb and found that the problem is on line 229 as match is passed in with an address to 0x0.

I dunno how to fix that though..

-
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

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

#3 lore raw

Robert,

1- UK isn't an ISO3166 valid code.

    UNITED KINGDOM -> GB
    UKRAINE -> UA

see:
http://www.iso.org/iso/country_codes/iso_3166_code_lists/english_country_names_and_code_elements.htm#u..

2- Personally I get no segfault.

wyn:/home/acidfu# iptables -A INPUT -p tcp --dport 22 -m geoip !
--src-cc UK -j DROP
iptables v1.4.0: geoip match: sorry, 'UK' isn't in the database

3- what files you have into /var/geoip ?

4- You just tried to patch your kernel and iptables or what ? or its an old patched kernel and you tried to update iptables ?

cheers,

Nicolas Bouliane

Quoted 49 lines · Robert Bruce

I wanted to block everything but the UK from ssh access, so

iptables -A INPUT -p tcp --dport 22 -m geoip ! --src-cc UK -j DROP

I have the 2.6.18-5 kernel

Quoted 38 lines · NICOLAS BOULIANE

Hello Robert,

Can you tell me the exact rule syntax you used ?

p.s. I'm actually updating geoip so it use the xtables framework,

cheers,

Nicolas Bouliane

Quoted 25 lines · Robert Bruce

Hello

I tried to send this to the developers of geoip, but the email got returned to me. I can't put this on bugzilla as it is down at the moment...

Original Email:

Hi Guys

I've just tried to install geoip with iptables 1.4.0, everything is fine until I try to add a rule which uses the geoip module and I get a Segmentation fault. So I did some digging, compiled with -g for gdb and found that the problem is on line 229 as match is passed in with an address to 0x0.

I dunno how to fix that though..

-
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

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

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

#6 lore raw

Robert,

I still get no segfault,

If you could reproduce it and send me the debugging output would be nice.

cheers,

Nicolas

Quoted 118 lines · Robert Bruce

apologies, it was GB I used. I'm not at my PC where I tried it, so that syntax is from what I can remember.

I compiled the csv from maxmind.com using the csv2bin utility.

I patched my kernel and iptables, enabled the option in my kernel and re-compiled for both. When I got the error I re-compiled with debug support and ran the command under gdb, which is how I could tell that the match parameter being passed into the parse function was a pointer 0x0.

I don't believe it's a problem with the kernel as it works for iptables 1.3.6, but not 1.4.0.

here's some system specs, the kernel -dedicated is the suffix I've given to the custom kernel with the ipt_geoip module

Quoted 1 line

uname -a

Linux debian 2.6.18.5-dedicated #1 SMP Thu Feb 7 21:56:01 GMT 2008 x86_64 GNU/Linux

Quoted 1 line

gcc -v

Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --enable-checking=release x86_64-linux-gnu
Thread model: posix
gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)

Is there anything else I could do to help?

Quoted 79 lines · NICOLAS BOULIANE

Robert,

1- UK isn't an ISO3166 valid code.

     UNITED KINGDOM -> GB
     UKRAINE -> UA

see:
http://www.iso.org/iso/country_codes/iso_3166_code_lists/english_country_names_and_code_elements.htm#u..

2- Personally I get no segfault.

wyn:/home/acidfu# iptables -A INPUT -p tcp --dport 22 -m geoip !
--src-cc UK -j DROP
iptables v1.4.0: geoip match: sorry, 'UK' isn't in the database

3- what files you have into /var/geoip ?

4- You just tried to patch your kernel and iptables or what ? or its an old patched kernel and you tried to update iptables ?

cheers,

Nicolas Bouliane

Quoted 51 lines · Robert Bruce

I wanted to block everything but the UK from ssh access, so

iptables -A INPUT -p tcp --dport 22 -m geoip ! --src-cc UK -j DROP

I have the 2.6.18-5 kernel

Quoted 4 lines · NICOLAS BOULIANE

Hello Robert,

Can you tell me the exact rule syntax you used ?

Quoted 19 lines

p.s. I'm actually updating geoip so it use the xtables framework,

cheers,

Nicolas Bouliane

Quoted 11 lines · Robert Bruce

Hello

I tried to send this to the developers of geoip, but the email got returned to me. I can't put this on bugzilla as it is down at the moment...

Original Email:

Hi Guys

I've just tried to install geoip with iptables 1.4.0, everything is

fine

Quoted 2 lines
Quoted 2 lines

until I try to add a rule which uses the geoip module and I get a Segmentation fault. So I did some digging, compiled with -g for gdb

and

Quoted 13 lines
Quoted 12 lines

found that the problem is on line 229 as match is passed in with an address to 0x0.

I dunno how to fix that though..

-
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw
In reply to Robert Bruce

I got the same thing using iptables 1.4.0.

I used patch geoip-match-2.6.22.patch.gz that I've
been using for quite awhile ... there is no other patch available.

My kernel version is 2.6.23.13

I went back to iptables 1.3.8 and everything is fine.

             ---( Nick )---
Quoted 23 lines · Robert Bruce

Hello

I tried to send this to the developers of geoip, but the email got returned to me. I can't put this on bugzilla as it is down at the moment...

Original Email:

Hi Guys

I've just tried to install geoip with iptables 1.4.0, everything is fine until I try to add a rule which uses the geoip module and I get a Segmentation fault. So I did some digging, compiled with -g for gdb and found that the problem is on line 229 as match is passed in with an address to 0x0.

I dunno how to fix that though..

-
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#8 lore raw

Hello Nick,

I updated geoip,

now the new pom-ng url is:
http://people.netfilter.org/acidfu/patchlets/

change it manually in your pom-ng/sources.list .... Peejix will send a patch soon so the url will be directly change.

Keep me in touch,
thank you

Nicolas Bouliane

Quoted 45 lines · Nick Pasich

I got the same thing using iptables 1.4.0.

I used patch geoip-match-2.6.22.patch.gz that I've
been using for quite awhile ... there is no other patch available.

My kernel version is 2.6.23.13

I went back to iptables 1.3.8 and everything is fine.

             ---( Nick )---
Quoted 16 lines · Robert Bruce

Hello

I tried to send this to the developers of geoip, but the email got returned to me. I can't put this on bugzilla as it is down at the moment...

Original Email:

Hi Guys

I've just tried to install geoip with iptables 1.4.0, everything is fine until I try to add a rule which uses the geoip module and I get a Segmentation fault. So I did some digging, compiled with -g for gdb and found that the problem is on line 229 as match is passed in with an address to 0x0.

Quoted 7 lines

I dunno how to fix that though..

-
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

-
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html