-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
session_in/out not reset in mbedtls_ssl_session_reset() #1941
Labels
Comments
ARM Internal Ref: IOTSSL-2467 |
hanno-becker
pushed a commit
to hanno-becker/mbedtls
that referenced
this issue
Aug 14, 2018
hanno-becker
pushed a commit
to hanno-becker/mbedtls
that referenced
this issue
Aug 14, 2018
This was referenced Aug 14, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem:
mbedtls_ssl_session_reset()
, specifically the underlyingssl_session_reset_int()
, does not reset the pointersmbedtls_ssl_context::session_in
andmbedtls_ssl_context:session_out
, but it does free andNULL
ify thembedtls_ssl_context::session
to which they map after a successful handshake. This leaves them dangling and e.g. makes a subsequent call tombedtls_ssl_get_max_frag_len()
fail with a segmentation fault (see here for the failing access).Further accesses: There is another entirely unrestricted access to
session_out
inmbedtls_ssl_get_record_expansion()
, i.e. not even guarded by a check thatsession_out != NULL
(moving the subsequent checktransform_out != NULL
prior to the access would solve the matter).Apart from that, there don't seem to be further critical accesses to
session_in/out
: There is an access inssl_encrypt_buf()
, but this is guarded bytransform_out != NULL
, andtransform_out
is properly reset inmbedtls_ssl_sessoin_reset()
. The same holds for the access inmbedtls_ssl_write_record()
. There are similar accesses tosession_in
inssl_decrypt_buf()
andssl_prepare_record_content()
which are non-critical because they are guarded by a check thattransform_in != NULL
.The text was updated successfully, but these errors were encountered: