<feed xmlns='http://www.w3.org/2005/Atom'>
<title>python.git/Python/sysmodule.c, branch 3.8</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Python/sysmodule.c?h=3.8</id>
<link rel='self' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Python/sysmodule.c?h=3.8'/>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/'/>
<updated>2023-01-20T22:20:09Z</updated>
<entry>
<title>[3.8] Correct CVE-2020-10735 documentation (GH-100306) (#100698)</title>
<updated>2023-01-20T22:20:09Z</updated>
<author>
<name>Gregory P. Smith</name>
<email>greg@krypto.org</email>
</author>
<published>2023-01-20T22:20:09Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=594ba1901cd0ad49e353bc10a031be439856ccbf'/>
<id>urn:sha1:594ba1901cd0ad49e353bc10a031be439856ccbf</id>
<content type='text'>
(cherry picked from commit 1cf3d78c92eb07dc09d15cc2e773b0b1b9436825)
(cherry picked from commit 88fe8d701af3316c8869ea18ea1c7acec6f68c04)

Co-authored-by: Jeremy Paige &lt;ucodery@gmail.com&gt;
Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt;</content>
</entry>
<entry>
<title>[3.8] gh-87604: Avoid publishing list of active per-interpreter audit hooks via the gc module (GH-99373) (GH-99661)</title>
<updated>2022-11-21T21:06:01Z</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2022-11-21T21:06:01Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=b50b6f95a1afacf76cc6ec3da4229cdeb33a7cf6'/>
<id>urn:sha1:b50b6f95a1afacf76cc6ec3da4229cdeb33a7cf6</id>
<content type='text'>
(cherry picked from commit 7b98207aa46bd637d07a7c4a84e998726b74acde)

Co-authored-by: Steve Dower &lt;steve.dower@python.org&gt;
</content>
</entry>
<entry>
<title>[3.8] gh-95778: CVE-2020-10735: Prevent DoS by very large int() (#96503)</title>
<updated>2022-09-05T20:26:09Z</updated>
<author>
<name>Gregory P. Smith</name>
<email>greg@krypto.org</email>
</author>
<published>2022-09-05T20:26:09Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=b5e331fdb38684808ffc540d53e8595bdc408b89'/>
<id>urn:sha1:b5e331fdb38684808ffc540d53e8595bdc408b89</id>
<content type='text'>
* Correctly pre-check for int-to-str conversion

Converting a large enough `int` to a decimal string raises `ValueError` as expected. However, the raise comes _after_ the quadratic-time base-conversion algorithm has run to completion. For effective DOS prevention, we need some kind of check before entering the quadratic-time loop. Oops! =)

The quick fix: essentially we catch _most_ values that exceed the threshold up front. Those that slip through will still be on the small side (read: sufficiently fast), and will get caught by the existing check so that the limit remains exact.

The justification for the current check. The C code check is:
```c
max_str_digits / (3 * PyLong_SHIFT) &lt;= (size_a - 11) / 10
```

In GitHub markdown math-speak, writing $M$ for `max_str_digits`, $L$ for `PyLong_SHIFT` and $s$ for `size_a`, that check is:
$$\left\lfloor\frac{M}{3L}\right\rfloor \le \left\lfloor\frac{s - 11}{10}\right\rfloor$$

From this it follows that
$$\frac{M}{3L} &lt; \frac{s-1}{10}$$
hence that
$$\frac{L(s-1)}{M} &gt; \frac{10}{3} &gt; \log_2(10).$$
So
$$2^{L(s-1)} &gt; 10^M.$$
But our input integer $a$ satisfies $|a| \ge 2^{L(s-1)}$, so $|a|$ is larger than $10^M$. This shows that we don't accidentally capture anything _below_ the intended limit in the check.

&lt;!-- gh-issue-number: gh-95778 --&gt;
* Issue: gh-95778
&lt;!-- /gh-issue-number --&gt;

Co-authored-by: Gregory P. Smith [Google LLC] &lt;greg@krypto.org&gt;
Co-authored-by: Christian Heimes &lt;christian@python.org&gt;
Co-authored-by: Mark Dickinson &lt;dickinsm@gmail.com&gt;</content>
</entry>
<entry>
<title>bpo-38410: Properly handle PySys_Audit() failures (GH-18658)</title>
<updated>2020-03-02T07:58:48Z</updated>
<author>
<name>Serhiy Storchaka</name>
<email>storchaka@gmail.com</email>
</author>
<published>2020-03-02T07:58:48Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=87a4cd5fbebdd0e6166b421d2c3706bc2f2e5a11'/>
<id>urn:sha1:87a4cd5fbebdd0e6166b421d2c3706bc2f2e5a11</id>
<content type='text'>
_PyEval_SetAsyncGenFinalizer() and _PyEval_SetAsyncGenFirstiter()
didn't include proper error handling for their PySys_Audit() calls.

Co-authored-by: Zackery Spytz &lt;zspytz@gmail.com&gt;
</content>
</entry>
<entry>
<title>bpo-39008: Require Py_ssize_t for PySys_Audit formats rather than raise a deprecation warning (GH-17540)</title>
<updated>2019-12-09T19:22:30Z</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2019-12-09T19:22:30Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=c93d68bbb986ee0879f5627223e0bd2bb91f63dd'/>
<id>urn:sha1:c93d68bbb986ee0879f5627223e0bd2bb91f63dd</id>
<content type='text'>
(cherry picked from commit b8cbe74c3498c617f0e73fd0cdc5c07f2c532092)

Co-authored-by: Steve Dower &lt;steve.dower@python.org&gt;</content>
</entry>
<entry>
<title>bpo-38920: Add audit hooks for when sys.excepthook and sys.unraisablehook are invoked (GH-17392)</title>
<updated>2019-11-28T16:46:23Z</updated>
<author>
<name>Steve Dower</name>
<email>steve.dower@python.org</email>
</author>
<published>2019-11-28T16:46:23Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=b74a6f14b94d36fb72b1344663e81776bf450847'/>
<id>urn:sha1:b74a6f14b94d36fb72b1344663e81776bf450847</id>
<content type='text'>
Also fixes some potential segfaults in unraisable hook handling.</content>
</entry>
<entry>
<title>bpo-38317: Fix PyConfig.warnoptions priority (GH-16478)</title>
<updated>2019-09-29T23:58:57Z</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2019-09-29T23:58:57Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=c9ed9e6fc76323ed537fb79d4232bcd27d82c57e'/>
<id>urn:sha1:c9ed9e6fc76323ed537fb79d4232bcd27d82c57e</id>
<content type='text'>
Fix warnings options priority: PyConfig.warnoptions has the highest
priority, as stated in the PEP 587.

* Document options order in PyConfig.warnoptions documentation.
* Make PyWideStringList_INIT macro private: replace "Py" prefix
  with "_Py".
* test_embed: add test_init_warnoptions().
(cherry picked from commit fb4ae152a9930f0e00cae8b2807f534058cf341a)

Co-authored-by: Victor Stinner &lt;vstinner@redhat.com&gt;</content>
</entry>
<entry>
<title>[3.8] bpo-37206: Unrepresentable default values no longer represented as None. (GH-13933) (GH-16141)</title>
<updated>2019-09-14T10:31:50Z</updated>
<author>
<name>Serhiy Storchaka</name>
<email>storchaka@gmail.com</email>
</author>
<published>2019-09-14T10:31:50Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=d322abbb83eb751045246a70f39d040d13a6108b'/>
<id>urn:sha1:d322abbb83eb751045246a70f39d040d13a6108b</id>
<content type='text'>
In ArgumentClinic, value "NULL" should now be used only for unrepresentable default values
(like in the optional third parameter of getattr). "None" should be used if None is accepted
as argument and passing None has the same effect as not passing the argument at all.
(cherry picked from commit 279f44678c8b84a183f9eeb85e0b086228154497)

Co-authored-by: Serhiy Storchaka &lt;storchaka@gmail.com&gt;</content>
</entry>
<entry>
<title>bpo-38096: Clean up the "struct sequence" / "named tuple" docs (GH-15895) (GH-15961)</title>
<updated>2019-09-12T02:50:29Z</updated>
<author>
<name>Paul Ganssle</name>
<email>paul@ganssle.io</email>
</author>
<published>2019-09-12T02:50:29Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=2bb6bf0c8cf863c057027b10751c0fb74189871f'/>
<id>urn:sha1:2bb6bf0c8cf863c057027b10751c0fb74189871f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>[3.8] bpo-37994: Fix silencing all errors if an attribute lookup fails. (GH-15630) (GH-15635)</title>
<updated>2019-09-01T11:01:05Z</updated>
<author>
<name>Serhiy Storchaka</name>
<email>storchaka@gmail.com</email>
</author>
<published>2019-09-01T11:01:05Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=353053d9ad08fea0e205e6c008b8a4350c0188e6'/>
<id>urn:sha1:353053d9ad08fea0e205e6c008b8a4350c0188e6</id>
<content type='text'>
Only AttributeError should be silenced.
(cherry picked from commit 41c57b335330ff48af098d47e379e0f9ba09d233)
</content>
</entry>
</feed>
