--- a/Misc/python.man Fri Jan 20 11:23:02 2012 +0000 +++ b/Misc/python.man Sun Jan 29 20:19:11 2012 -0500 @@ -34,6 +34,9 @@ .B \-OO ] [ +.B \-R +] +[ .B -Q .I argument ] @@ -145,6 +148,18 @@ .B \-OO Discard docstrings in addition to the \fB-O\fP optimizations. .TP +.B \-R +Turn on "hash randomization", so that the hash() values of str, bytes and +datetime objects are "salted" with an unpredictable pseudo-random value. +Although they remain constant within an individual Python process, they are +not predictable between repeated invocations of Python. +.IP +This is intended to provide protection against a denial of service +caused by carefully-chosen inputs that exploit the worst case performance +of a dict lookup, O(n^2) complexity. See +http://www.ocert.org/advisories/ocert-2011-003.html +for details. +.TP .BI "\-Q " argument Division control; see PEP 238. The argument must be one of "old" (the default, int/int and long/long return an int or long), "new" (new @@ -403,6 +418,17 @@ If this is set to a non-empty string it is equivalent to specifying the \fB\-v\fP option. If set to an integer, it is equivalent to specifying \fB\-v\fP multiple times. +.IP PYTHONHASHRANDOMIZATION +If this is set to a non-empty string it is equivalent to specifying the +\fB\-R\fP option. +.IP PYTHONHASHSEED +If this is set, it is used as a fixed seed for generating the hash() of +the types covered by the \fB\-R\fP (or its equivalent environment variable, +\fB\PYTHONHASHRANDOMIZATION\fP). +It is primarily intended for use in selftests for the interpreter, but +may perhaps be of use for reproducing a specific dict ordering. +It should be a decimal number in the range [0; 4294967295]. Specifying +the value 0 overrides the other setting, disabling the hash random salt. .SH AUTHOR The Python Software Foundation: http://www.python.org/psf .SH INTERNET RESOURCES