GitHub

File tree

  • Lib/multiprocessing

  • Misc/NEWS.d/next/Security

Original file line numberDiff line numberDiff line change

@@ -73,11 +73,6 @@ def arbitrary_address(family):

7373

if family == 'AF_INET':

7474

return ('localhost', 0)

7575

elif family == 'AF_UNIX':

76-

# Prefer abstract sockets if possible to avoid problems with the address

77-

# size. When coding portable applications, some implementations have

78-

# sun_path as short as 92 bytes in the sockaddr_un struct.

79-

if util.abstract_sockets_supported:

80-

return f"\0listener-{os.getpid()}-{next(_mmap_counter)}"

8176

return tempfile.mktemp(prefix='listener-', dir=util.get_temp_dir())

8277

elif family == 'AF_PIPE':

8378

return tempfile.mktemp(prefix=r'\\.\pipe\pyc-%d-%d-' %

Original file line numberDiff line numberDiff line change

@@ -0,0 +1,15 @@

1+

On Linux the :mod:`multiprocessing` module returns to using filesystem backed

2+

unix domain sockets for communication with the *forkserver* process instead of

3+

the Linux abstract socket namespace. Only code that chooses to use the

4+

:ref:`"forkserver" start method <multiprocessing-start-methods>` is affected.

5+
6+

Abstract sockets have no permissions and could allow any user on the system in

7+

the same `network namespace

8+

<https://man7.org/linux/man-pages/man7/network_namespaces.7.html>`_ (often the

9+

whole system) to inject code into the multiprocessing *forkserver* process.

10+

This was a potential privilege escalation. Filesystem based socket permissions

11+

restrict this to the *forkserver* process user as was the default in Python 3.8

12+

and earlier.

13+
14+

This prevents Linux `CVE-2022-42919

15+

<https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-42919>`_.

Read the original on github.com ↗