Skip to content
  • Marek Szymczak's avatar
    9cb3e5db
    Bug#22136709 INFINITE RECURSION BY CALLING MY_MESSAGE FROM MYSQL_AUDIT_GENERAL_CLASS HANDLER · 9cb3e5db
    Marek Szymczak authored
    Problem:
    ========
    Calling my_message from within an audit plugin during handling MYSQL_AUDIT_GENERAL_ERROR event
    causes the audit error event generating mechanism to fall into infinite recursion, which ends
    with the server crash.
    
    Fix:
    ====
    A condition has been embedded into event generating mechanism that stops infinite recursion,
    when the stack size shrinks to a certain value. This fix does not prevent infinite recursion
    but stops it instead. The server does not crash and the ER_STACK_OVERRUN_NEED_MORE error is
    generated.
    
    null_audit_event_order_check_consume_ignore_count global variable was introduced that prevents
    clearing null_audit_event_order_check variable certain number of times. This allows to simulate
    infinite and non-infinite recursion during testing.
    
    Reviewed-by:
    ============
    Georgi Kodinov <georgi.kodinov@oracle.com>
    Ramil Kalimullin <ramil.kalimullin@oracle.com>
    Evgeny Potemkin <evgeny.potemkin@oracle.com>
    9cb3e5db
    Bug#22136709 INFINITE RECURSION BY CALLING MY_MESSAGE FROM MYSQL_AUDIT_GENERAL_CLASS HANDLER
    Marek Szymczak authored
    Problem:
    ========
    Calling my_message from within an audit plugin during handling MYSQL_AUDIT_GENERAL_ERROR event
    causes the audit error event generating mechanism to fall into infinite recursion, which ends
    with the server crash.
    
    Fix:
    ====
    A condition has been embedded into event generating mechanism that stops infinite recursion,
    when the stack size shrinks to a certain value. This fix does not prevent infinite recursion
    but stops it instead. The server does not crash and the ER_STACK_OVERRUN_NEED_MORE error is
    generated.
    
    null_audit_event_order_check_consume_ignore_count global variable was introduced that prevents
    clearing null_audit_event_order_check variable certain number of times. This allows to simulate
    infinite and non-infinite recursion during testing.
    
    Reviewed-by:
    ============
    Georgi Kodinov <georgi.kodinov@oracle.com>
    Ramil Kalimullin <ramil.kalimullin@oracle.com>
    Evgeny Potemkin <evgeny.potemkin@oracle.com>
Loading