mirror of
https://gitee.com/openharmony/third_party_python
synced 2024-11-27 01:21:06 +00:00
!31 python-3.10漏洞升级 CVE-2022-42919
Merge pull request !31 from lsn1028/lsn_python_1122_4
This commit is contained in:
commit
75fd6b7e74
@ -73,11 +73,6 @@ def arbitrary_address(family):
|
|||||||
if family == 'AF_INET':
|
if family == 'AF_INET':
|
||||||
return ('localhost', 0)
|
return ('localhost', 0)
|
||||||
elif family == 'AF_UNIX':
|
elif family == 'AF_UNIX':
|
||||||
# Prefer abstract sockets if possible to avoid problems with the address
|
|
||||||
# size. When coding portable applications, some implementations have
|
|
||||||
# sun_path as short as 92 bytes in the sockaddr_un struct.
|
|
||||||
if util.abstract_sockets_supported:
|
|
||||||
return f"\0listener-{os.getpid()}-{next(_mmap_counter)}"
|
|
||||||
return tempfile.mktemp(prefix='listener-', dir=util.get_temp_dir())
|
return tempfile.mktemp(prefix='listener-', dir=util.get_temp_dir())
|
||||||
elif family == 'AF_PIPE':
|
elif family == 'AF_PIPE':
|
||||||
return tempfile.mktemp(prefix=r'\\.\pipe\pyc-%d-%d-' %
|
return tempfile.mktemp(prefix=r'\\.\pipe\pyc-%d-%d-' %
|
||||||
|
@ -0,0 +1,15 @@
|
|||||||
|
On Linux the :mod:`multiprocessing` module returns to using filesystem backed
|
||||||
|
unix domain sockets for communication with the *forkserver* process instead of
|
||||||
|
the Linux abstract socket namespace. Only code that chooses to use the
|
||||||
|
:ref:`"forkserver" start method <multiprocessing-start-methods>` is affected.
|
||||||
|
|
||||||
|
Abstract sockets have no permissions and could allow any user on the system in
|
||||||
|
the same `network namespace
|
||||||
|
<https://man7.org/linux/man-pages/man7/network_namespaces.7.html>`_ (often the
|
||||||
|
whole system) to inject code into the multiprocessing *forkserver* process.
|
||||||
|
This was a potential privilege escalation. Filesystem based socket permissions
|
||||||
|
restrict this to the *forkserver* process user as was the default in Python 3.8
|
||||||
|
and earlier.
|
||||||
|
|
||||||
|
This prevents Linux `CVE-2022-42919
|
||||||
|
<https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-42919>`_.
|
Loading…
Reference in New Issue
Block a user