lkml.org 
[lkml]   [2015]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: xt_recent broken in kernel 3.19.0 + PATCH
On Thu, 12 Feb 2015 10:26:16 +0000
Chris Vine <chris@cvine.freeserve.co.uk> wrote:
> On Thu, 12 Feb 2015 09:35:33 +0100
> Florian Westphal <fw@strlen.de> wrote:
> > Cong Wang <xiyou.wangcong@gmail.com> wrote:
> > > (Cc'ing netdev and netfilter-devel lists)
> >
> > Thanks for forwarding.
> >
> > > > Chris Vine <chris@cvine.freeserve.co.uk> wrote:
> > > >> iptables -D SSH_CHAIN -m conntrack --ctstate NEW \
> > > >> -m recent --update --seconds $SSH_LOGIN_PERIOD --hitcount
> > > >> $SSH_TRIES -j DROP
> > > > --- linux-3.19.0/net/netfilter/xt_recent.c~ 2015-02-10
> > > > 09:18:44.657376355 +0000 +++
> > > > linux-3.19.0/net/netfilter/xt_recent.c 2015-02-11
> > > > 17:58:33.311608835 +0000 @@ -378,7 +378,7 @@
> > > > mutex_lock(&recent_mutex); t = recent_table_lookup(recent_net,
> > > > info->name); if (t != NULL) {
> > > > - if (info->hit_count > t->nstamps_max_mask) {
> > > > + if (info->hit_count > t->nstamps_max_mask + 1) {
> >
> > Looks good. Chris, could you formally submit this patch to
> > netfilter-devel@vger.kernel.org?
> >
> > Thanks!
>
> Done.

On further testing I see that that patch only solves the problem if
SSH_TRIES is set to a power of two boundary. You still get an error
loading the rule if it is anything else. I think there is something
wrong with the nstamp_mask heuristic which is used here.

Chris


\
 
 \ /
  Last update: 2015-02-12 12:01    [W:0.047 / U:0.852 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site