mirror of
https://github.com/python/cpython.git
synced 2025-12-14 05:11:36 +00:00
_Py_closerange() currently assumes that close_range() closes all file descriptors even if it returns an error (other than ENOSYS). This assumption can be wrong on Linux if a seccomp sandbox denies the underlying syscall, pretending that it returns EPERM or EACCES. In this case _Py_closerange() won't close any descriptors at all, which in the worst case can be a security issue. Fix this by falling back to other methods in case of any close_range() error. Note that fallbacks will not be triggered on any problems with closing individual file descriptors because close_range() is documented to ignore such errors on both Linux[1] and FreeBSD[2]. [1] https://man7.org/linux/man-pages/man2/close_range.2.html [2] https://www.freebsd.org/cgi/man.cgi?query=close_range&sektion=2 |
||
|---|---|---|
| .. | ||
| clinic | ||
| deepfreeze | ||
| frozen_modules | ||
| _warnings.c | ||
| adaptive.md | ||
| asdl.c | ||
| ast.c | ||
| ast_opt.c | ||
| ast_unparse.c | ||
| bltinmodule.c | ||
| bootstrap_hash.c | ||
| ceval.c | ||
| ceval_gil.h | ||
| codecs.c | ||
| compile.c | ||
| condvar.h | ||
| context.c | ||
| dtoa.c | ||
| dup2.c | ||
| dynamic_annotations.c | ||
| dynload_hpux.c | ||
| dynload_shlib.c | ||
| dynload_stub.c | ||
| dynload_win.c | ||
| emscripten_signal.c | ||
| errors.c | ||
| fileutils.c | ||
| formatter_unicode.c | ||
| frame.c | ||
| frozen.c | ||
| frozenmain.c | ||
| future.c | ||
| getargs.c | ||
| getcompiler.c | ||
| getcopyright.c | ||
| getopt.c | ||
| getplatform.c | ||
| getversion.c | ||
| hamt.c | ||
| hashtable.c | ||
| import.c | ||
| importdl.c | ||
| importdl.h | ||
| initconfig.c | ||
| makeopcodetargets.py | ||
| marshal.c | ||
| modsupport.c | ||
| mysnprintf.c | ||
| mystrtoul.c | ||
| opcode_targets.h | ||
| pathconfig.c | ||
| preconfig.c | ||
| pyarena.c | ||
| pyctype.c | ||
| pyfpe.c | ||
| pyhash.c | ||
| pylifecycle.c | ||
| pymath.c | ||
| pystate.c | ||
| pystrcmp.c | ||
| pystrhex.c | ||
| pystrtod.c | ||
| Python-ast.c | ||
| Python-tokenize.c | ||
| pythonrun.c | ||
| pytime.c | ||
| README | ||
| specialize.c | ||
| stdlib_module_names.h | ||
| structmember.c | ||
| suggestions.c | ||
| symtable.c | ||
| sysmodule.c | ||
| thread.c | ||
| thread_nt.h | ||
| thread_pthread.h | ||
| traceback.c | ||
Miscellaneous source files for the main Python shared library