This is the mail archive of the mailing list for the systemtap project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug runtime/13546] New: improve map hashing

             Bug #: 13546
           Summary: improve map hashing
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: runtime
    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,
/* and similarly for str_hash */

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]