1. 15 6月, 2018 5 次提交
  2. 14 6月, 2018 1 次提交
  3. 13 6月, 2018 7 次提交
  4. 12 6月, 2018 6 次提交
  5. 11 6月, 2018 7 次提交
  6. 09 6月, 2018 4 次提交
  7. 08 6月, 2018 9 次提交
  8. 07 6月, 2018 1 次提交
    • M
      Do not free a session before calling the remove_session_cb · c0a58e03
      Marcus Huewe 提交于
      If the remove_session_cb accesses the session's data (for instance,
      via SSL_SESSION_get_protocol_version), a potential use after free
      can occur. For this, consider the following scenario when adding
      a new session via SSL_CTX_add_session:
      
      - The session cache is full
        (SSL_CTX_sess_number(ctx) > SSL_CTX_sess_get_cache_size(ctx))
      - Only the session cache has a reference to ctx->session_cache_tail
        (that is, ctx->session_cache_tail->references == 1)
      
      Since the cache is full, remove_session_lock is called to remove
      ctx->session_cache_tail from the cache. That is, it
      SSL_SESSION_free()s the session, which free()s the data. Afterwards,
      the free()d session is passed to the remove_session_cb. If the callback
      accesses the session's data, we have a use after free.
      
      The free before calling the callback behavior was introduced in
      commit e4612d02 ("Remove sessions
      from external cache, even if internal cache not used.").
      
      CLA: trivial
      Reviewed-by: NRich Salz <rsalz@openssl.org>
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/6222)
      c0a58e03