Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: 5.8.2-RC1 and mp2: msg#00402

apache.mod-perl.devel

Subject: Re: 5.8.2-RC1 and mp2

I made some progress on making sure that the problem is reproducable. Rasing

#define HV_MAX_LENGTH_BEFORE_SPLIT 14

makes it a much higher trashold for most normal keys to trigger rehashing, but I'm happy that the new test is happily failing to find a previously cached stash, despite the high treshold.

I have two remaining issues on the test side (before trying to fix things):

1) replace the hardcoded attack input (from the original attack report by Scott) to something that's autogenerated. I want a sub that I can ask for N number of hash keys that will collapse into the same list.

2) I need some way to verify that the attack has been successfully performed, so if in the future the hashing algorithm or the threshold change this test won't be misleadingly successful even though the problem may exist. Since Nick added a special flag to HVs that were re-hashed, can we get a B:: function that can check for this flag?

At the moment I do a visual check, by looking for the debug print I've planted into hv.c, so error_log looks like:

==> starting
We are under attack. But Do Not Panic
==> ending
[Thu Oct 30 16:37:08 2003] [error] lookup of 'TestPerl::hash_attack::handler' failed

Here is the test:

package TestPerl::hash_attack;

use strict;
use warnings FATAL => 'all';

use Apache::Test;
use Apache::TestUtil;
use Apache::TestTrace;

use Apache::Const -compile => 'OK';

my $input = <<EOI;
benniefubenniefubenniefu
benniefubenniefubeoppifu
benniefubenniefubheuoalp
benniefubenniefubheyppdl
benniefubenniefubxifmbwv
benniefubenniefucdsuauht
benniefubenniefucrphalzb
benniefubenniefufdesinvt
benniefubenniefufhbalgiw
benniefubenniefufkqidvqy
benniefubenniefufwlfnorp
benniefubenniefugbuocxbt
benniefubenniefugkcdnowo
benniefubenniefugzpjjakt
benniefubenniefuiwzmsjwx
benniefubenniefujeozrmvb
benniefubenniefujevvfjsf
benniefubenniefujlomraai
benniefubenniefujlyzcvrw
benniefubenniefujptanaai
benniefubenniefujwnieayi
benniefubenniefulpvzqpqq
benniefubenniefunwtftrcn
benniefubenniefunwtjqhgn
benniefubenniefupmuzbpmh
benniefubenniefupwbstdms
benniefubenniefuqdazlxxp
benniefubenniefuqnprevxm
benniefubenniefutbwofcgp
benniefubenniefutgxvpmnc
benniefubenniefutjqfofzs
benniefubenniefutsljwgxt
benniefubenniefutwekfzcc
benniefubenniefutxrmfxhd
benniefubenniefutzdfehma
benniefubenniefuubulupaw
benniefubenniefuupychihz
benniefubenniefuvanvqkid
benniefubenniefuvcakywsm
benniefubenniefuveliggml
EOI

# create conditions which will trigger a rehash on the current stash
# (__PACKAGE)
sub fixup {
my $r = shift;
no strict 'refs';
debug "starting attack";
for (split /\n/, $input) {
my $symbol = __PACKAGE__ . "::$_";
#autovivify
$$symbol++;
}
debug "ending attack";

return Apache::DECLINED;
}

# if the rehashing of the keys in the stash happens due to the hash attack,
# mod_perl must not fail to find the previously cached stash (response
# handler in this case)
sub handler {
my $r = shift;
plan $r, tests => 1;
ok 1;
return Apache::OK;
}

1;
__END__
PerlModule TestPerl::hash_attack
PerlFixupHandler TestPerl::hash_attack::fixup

__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@xxxxxxxxxx http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
drivers.mtd/200...    security.firewa...    java.openamf.cv...    rpm.yum/2003-08...    telephony.sipp....    file-systems.oc...    qnx.openqnx.dev...    voip.linphone.u...    hardware.sony/2...    network.simulat...    boot-loaders.gr...    ietf.usenet.for...    culture.languag...    emacs.latex.pre...    music.jamiroqua...    xfree86.neomagi...    user-groups.lin...    ltp/2006-08/msg...    kde.kst/2005-08...    programming.too...    os.freebsd.deve...    window-managers...    audio.cd-record...    gnu.fiasco.bugs...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation