Skip to content
/ server Public

MDEV-11896: thd_security_context - use snprintf to fill buffer with i…#328

Closed
grooverdan wants to merge 1 commit intoMariaDB:5.5from
grooverdan:5.5-MDEV-11896-thd_security_context
Closed

MDEV-11896: thd_security_context - use snprintf to fill buffer with i…#328
grooverdan wants to merge 1 commit intoMariaDB:5.5from
grooverdan:5.5-MDEV-11896-thd_security_context

Conversation

@grooverdan
Copy link
Member

…nformation

Under string.append with insufficient space results in undefined behaviour, in
this case a segfault.

I submit this under the MCA.

…nformation

Under string.append with insufficient space results in undefined behaviour, in
this case a segfault.

Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
@svoj svoj added this to the 5.5 milestone Mar 7, 2017
@svoj
Copy link
Contributor

svoj commented Mar 7, 2017

Hi Daniel,

Thanks for your contribution. JIRA task just for the record: https://jira.mariadb.org/browse/MDEV-11896

This task was added to 5.5 backlog, which hasn't been scheduled yet.

Thanks,
Sergey

@grooverdan
Copy link
Member Author

is there going to be another 5.5 - https://mariadb.com/kb/en/mariadb/mariadb-maintenance-policy/ list 11 April 2017 as the boundary?

@vuvova
Copy link
Member

vuvova commented Mar 7, 2017

Stay tuned, it's being discussed. Probably we'll keep maintaining 5.5 as long as Oracle does or as long as distributions that have it are maintained.

@vuvova
Copy link
Member

vuvova commented Jul 11, 2017

How does String::append result in undefined behavior?

@grooverdan
Copy link
Member Author

Not sure however the back trace and upstream bug shows it can happen. Is the snprintf a simplification?

@vuvova
Copy link
Member

vuvova commented Jul 11, 2017

I don't think String::append() is to blame here at all. This thd_security_context() accesses some other THD's data (user, query, etc). The caller is supposed to take care of proper locking, as far as I understand. Perhaps some callers don't? Then String::append() will try to resolve invalid pointer or access unmapped memory, and it'll crash.

@grooverdan
Copy link
Member Author

OK. Makes sense. FYI I looked at https://clang.llvm.org/docs/ThreadSafetyAnalysis.html which despite looking promising didn't work as expected. I raised some clang bug reports so I'll find out soon if its me or the implementation being wrong.

@grooverdan grooverdan closed this Jul 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants