This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug runtime/13546] New: improve map hashing
- From: "fche at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sourceware dot org
- Date: Sat, 31 Dec 2011 01:32:22 +0000
- Subject: [Bug runtime/13546] New: improve map hashing
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=13546
Bug #: 13546
Summary: improve map hashing
Product: systemtap
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: runtime
AssignedTo: systemtap@sourceware.org
ReportedBy: fche@redhat.com
Classification: Unclassified
The runtime/map* functions have several weaknesses w.r.t. hashing
that we should improve.
1) HASH_TABLE_BITS/SIZE should probably be a function of MAXMAPENTRIES.
2) str_hash() should be more hashy. It looks rather wimpy.
3) With deliberate hash-collision-inducing data conceivably fed to stap,
we should investigate salting the map FOO_hash functions with some
runtime-random value, such as a few bytes collected at startup time with
get_random_bytes(), as in
static unsigned long stap_hash_seed; /* init during module startup */
static unsigned int int64_hash (const int64_t v)
{
return (unsigned int)hash_long (((unsigned long)v) ^ stap_hash_seed,
HASH_TABLE_BITS);
}
/* and similarly for str_hash */
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.