lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20130201153217.GA27799@kroah.com>
Date:	Fri, 1 Feb 2013 16:32:17 +0100
From:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:	Feng Gao <gfree.wind@...il.com>
Cc:	linux-kernel@...r.kernel.org, stable@...r.kernel.org,
	Pablo Neira Ayuso <pablo@...filter.org>
Subject: Re: [ 82/89] netfilter: xt_hashlimit: fix race that results in
 duplicated entries

On Fri, Feb 01, 2013 at 11:04:36PM +0800, Feng Gao wrote:
> Hi Greg,
> 
> I have a question.
> 
> There are two duplicated lines now.
>                        dh->expires = now + msecs_to_jiffies(hinfo->cfg.expire);
>                        rateinfo_recalc(dh, now, hinfo->cfg.mode);
> 1# case: The dsthash_find return a valid dh;
> 2# case: There is a race. The race is true.
> 
> Why we could not adopt the method I sent before. 
> 
>     dh = dsthash_find(hinfo, &dst);
>     if (dh == NULL) {
>         dh = dsthash_alloc_init(hinfo, &dst, &new_node);
>         if (dh == NULL) {
>             rcu_read_unlock_bh();
>             goto hotdrop;
>         }
>     }
> 
>     if (new_node) {
>         dh->expires = jiffies + msecs_to_jiffies(hinfo->cfg.expire);
>         rateinfo_init(dh, hinfo);
>     } else {
>         /* update expiration timeout */
>         dh->expires = now + msecs_to_jiffies(hinfo->cfg.expire);
>         rateinfo_recalc(dh, now, hinfo->cfg.mode);
>     }
> 
> I think it could avoid the two duplicated lines.

But this patch the same as what is in Linus's tree, right?  If not,
please let me know.  If it is the same, and you want to change it, it
needs to be changed in Linus's tree first before I can do anything in
the stable kernels.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ