Commit 082b2df
committed
Bug #876637, prevent stack corruption when socket descriptor
is larger than FD_SETSIZE.
This can only be acheived with ulimit -n SOME_NUMBER_BIGGER_THAN_FD_SETSIZE
which is typically only available to root. Since this wouldn't normally
be run in a test (ie, run as root), it doesn't seem too worthwhile to
add a normal test. The bug report has one version of a test. I've
written another. Not sure what the best thing to do is.
Do the check before calling internal_select() because we can't set
an error in between Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS.
This seemed the clearest solution, ie handle before calling internal_select()
rather than inside. Plus there is at least one place outside
of internal_select() that needed to be handled.
Will backport.1 parent 19cbcad commit 082b2df
3 files changed
Lines changed: 48 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
219 | 222 | | |
220 | 223 | | |
221 | 224 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| |||
272 | 273 | | |
273 | 274 | | |
274 | 275 | | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
275 | 279 | | |
276 | 280 | | |
277 | 281 | | |
| |||
372 | 376 | | |
373 | 377 | | |
374 | 378 | | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
375 | 383 | | |
376 | 384 | | |
377 | 385 | | |
| |||
409 | 417 | | |
410 | 418 | | |
411 | 419 | | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
412 | 423 | | |
413 | 424 | | |
414 | 425 | | |
| |||
467 | 478 | | |
468 | 479 | | |
469 | 480 | | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
470 | 484 | | |
471 | 485 | | |
472 | 486 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
398 | 408 | | |
399 | 409 | | |
400 | 410 | | |
| |||
1408 | 1418 | | |
1409 | 1419 | | |
1410 | 1420 | | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
1411 | 1424 | | |
1412 | 1425 | | |
1413 | 1426 | | |
| |||
1736 | 1749 | | |
1737 | 1750 | | |
1738 | 1751 | | |
1739 | | - | |
| 1752 | + | |
| 1753 | + | |
1740 | 1754 | | |
1741 | 1755 | | |
1742 | 1756 | | |
| |||
1781 | 1795 | | |
1782 | 1796 | | |
1783 | 1797 | | |
1784 | | - | |
| 1798 | + | |
1785 | 1799 | | |
1786 | 1800 | | |
1787 | 1801 | | |
| |||
2084 | 2098 | | |
2085 | 2099 | | |
2086 | 2100 | | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
2087 | 2104 | | |
2088 | 2105 | | |
2089 | 2106 | | |
| |||
2177 | 2194 | | |
2178 | 2195 | | |
2179 | 2196 | | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
2180 | 2200 | | |
2181 | 2201 | | |
2182 | 2202 | | |
| |||
2238 | 2258 | | |
2239 | 2259 | | |
2240 | 2260 | | |
| 2261 | + | |
| 2262 | + | |
| 2263 | + | |
2241 | 2264 | | |
2242 | 2265 | | |
2243 | 2266 | | |
| |||
2303 | 2326 | | |
2304 | 2327 | | |
2305 | 2328 | | |
| 2329 | + | |
| 2330 | + | |
| 2331 | + | |
2306 | 2332 | | |
2307 | 2333 | | |
2308 | 2334 | | |
| |||
2357 | 2383 | | |
2358 | 2384 | | |
2359 | 2385 | | |
| 2386 | + | |
| 2387 | + | |
| 2388 | + | |
2360 | 2389 | | |
2361 | 2390 | | |
2362 | 2391 | | |
| |||
0 commit comments