public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "miyuki at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/55815] switch hash function of libstdc++ hash tables to siphash
Date: Wed, 23 Sep 2015 03:29:00 -0000	[thread overview]
Message-ID: <bug-55815-4-1m0OlbFn2g@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-55815-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55815

Mikhail Maltsev <miyuki at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |miyuki at gcc dot gnu.org

--- Comment #6 from Mikhail Maltsev <miyuki at gcc dot gnu.org> ---
SipHash is not very slow, BTW. I remember doing some benchmarks (there was some
discussion about changing the hash function used for incremental hash in GCC),
https://gcc.gnu.org/ml/gcc-patches/2015-03/msg00179.html

Result for small strings (1-20 bytes) on x86_64, elapsed time (i.e. less is
better):

function  | gcc -O3 | clang -O3
----------|---------|----------
murmur32  |   0.91  |   0.95 
murmur128 |   1.33  |   1.24 
sip24     |   1.88  |   1.45 
sip13     |   1.66  |   1.22 
lookup3   |   1.18  |   0.90 
spooky    |   1.24  |   0.90 

I don't remember all the details about the workload used and which
implementation of SipHash I used (but most likely my own one).

(In reply to felix-gcc from comment #0)
> It may even make sense to replace the hash code gcc itself uses, as there
> are now web pages where you can paste code and see which code gcc generates
> for it, turning this problem into a security issue if someone pastes code
> with colliding symbols to exploit this problem.

There is a much more efficient way to attack them: search GCC bugzilla for open
bugs of type "compile time hog" or "memory hog" and simply use the code
provided there.


  parent reply	other threads:[~2015-09-23  3:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-26 21:39 [Bug libstdc++/55815] New: " felix-gcc at fefe dot de
2013-01-05 13:29 ` [Bug libstdc++/55815] " redi at gcc dot gnu.org
2013-01-05 14:35 ` redi at gcc dot gnu.org
2013-01-05 14:48 ` paolo.carlini at oracle dot com
2015-09-22 22:11 ` gpike at google dot com
2015-09-23  2:08 ` felix-glibc at fefe dot de
2015-09-23  3:29 ` miyuki at gcc dot gnu.org [this message]
2015-09-23  9:56 ` redi at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-55815-4-1m0OlbFn2g@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).