Uploaded image for project: 'ejabberd development'
  1. ejabberd development
  2. EJAB-1119

Fix memory and port leak when TLS is enabled in HTTP

    Details

      Description

      Fix TLS port leak.

      The issue is that the TLS port is assigned to ejabberd_http_sup
      because it's spawned during ejabberd_http:start_link/2, which is
      called inside ejabberd_http_sup's process.

      The fix is to move the initialization of tls into a new function
      ejabberd_http:init/2, which is called by proc_lib:spawn_link/3. This
      binds the port driver to ejabberd_http, not the supervisor, so they
      get cleaned up when the handler closes.

      1. tls-leak-fix.patch
        2 kB
        Brian Cully
      2. tls-leak-fix2.patch
        1 kB
        Brian Cully

        Activity

        Hide
        badlop Badlop added a comment -

        Patch applied to 2.1.x and trunk.

        Show
        badlop Badlop added a comment - Patch applied to 2.1.x and trunk.
        Hide
        bjc Brian Cully added a comment -

        The patch was misapplied and breaks all HTTPS. I've attached a `fix2' patch which should be applied on top of this one.

        Show
        bjc Brian Cully added a comment - The patch was misapplied and breaks all HTTPS. I've attached a `fix2' patch which should be applied on top of this one.
        Hide
        bjc Brian Cully added a comment -

        This patch is already applied. My mistake.

        Show
        bjc Brian Cully added a comment - This patch is already applied. My mistake.

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development