]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
More trunk connection UBSAN false positives
authorNick Porter <nick@portercomputing.co.uk>
Wed, 4 Sep 2024 11:33:51 +0000 (12:33 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Wed, 4 Sep 2024 11:33:51 +0000 (12:33 +0100)
src/lib/ldap/connection.c
src/lib/server/trunk.h
src/modules/rlm_radius/rlm_radius_udp.c
src/modules/rlm_sql/drivers/rlm_sql_mysql/rlm_sql_mysql.c
src/modules/rlm_sql/drivers/rlm_sql_postgresql/rlm_sql_postgresql.c
src/modules/rlm_tacacs/rlm_tacacs_tcp.c

index 8094c169d6e3ec26055f2d89b13791524b99768c..0e481afde1a5c9d991a0adc44bf02d5e9139e083 100644 (file)
@@ -493,6 +493,7 @@ static void ldap_request_cancel(UNUSED connection_t *conn, void *preq, UNUSED tr
  * @param[in] conn     The specific connection queries will be cancelled on
  * @param[in] uctx     Context provided to trunk_alloc
  */
+CC_NO_UBSAN(function) /* UBSAN: false positive - public vs private connection_t trips --fsanitize=function*/
 static void ldap_request_cancel_mux(UNUSED fr_event_list_t *el, trunk_connection_t *tconn,
                                    connection_t *conn, UNUSED void *uctx)
 {
@@ -563,6 +564,7 @@ static connection_t *ldap_trunk_connection_alloc(trunk_connection_t *tconn, fr_e
  * @param[in] conn     on which to send the queries
  * @param[in] uctx     User context passed to trunk_alloc
  */
+CC_NO_UBSAN(function) /* UBSAN: false positive - public vs private connection_t trips --fsanitize=function*/
 static void ldap_trunk_request_mux(UNUSED fr_event_list_t *el, trunk_connection_t *tconn,
                                   connection_t *conn, UNUSED void *uctx)
 {
@@ -683,6 +685,7 @@ static void ldap_trunk_request_mux(UNUSED fr_event_list_t *el, trunk_connection_
  * @param[in] conn     Connection handle for these results.
  * @param[in] uctx     Thread specific trunk structure - contains tree of pending queries.
  */
+CC_NO_UBSAN(function) /* UBSAN: false positive - public vs private connection_t trips --fsanitize=function*/
 static void ldap_trunk_request_demux(fr_event_list_t *el, trunk_connection_t *tconn, connection_t *conn, void *uctx)
 {
        fr_ldap_connection_t    *ldap_conn = talloc_get_type_abort(conn->h, fr_ldap_connection_t);
@@ -1006,6 +1009,7 @@ trunk_state_t fr_thread_ldap_trunk_state(fr_ldap_thread_t *thread, char const *u
  * @param[in] conn     on which to send the queries
  * @param[in] uctx     User context passed to trunk_alloc
  */
+CC_NO_UBSAN(function) /* UBSAN: false positive - public vs private connection_t trips --fsanitize=function*/
 static void ldap_trunk_bind_auth_mux(UNUSED fr_event_list_t *el, trunk_connection_t *tconn,
                                   connection_t *conn, void *uctx)
 {
@@ -1110,6 +1114,7 @@ static void ldap_trunk_bind_auth_mux(UNUSED fr_event_list_t *el, trunk_connectio
  * @param[in] conn     Connection handle for these results.
  * @param[in] uctx     Thread specific trunk structure - contains tree of pending queries.
  */
+CC_NO_UBSAN(function) /* UBSAN: false positive - public vs private connection_t trips --fsanitize=function*/
 static void ldap_trunk_bind_auth_demux(UNUSED fr_event_list_t *el, UNUSED trunk_connection_t *tconn,
                                       connection_t *conn, void *uctx)
 {
@@ -1228,6 +1233,7 @@ static void ldap_trunk_bind_auth_demux(UNUSED fr_event_list_t *el, UNUSED trunk_
  * @param[in] conn     The specific connection binds will be cancelled on
  * @param[in] uctx     Context provided to trunk_alloc
  */
+CC_NO_UBSAN(function) /* UBSAN: false positive - public vs private connection_t trips --fsanitize=function*/
 static void ldap_bind_auth_cancel_mux(UNUSED fr_event_list_t *el, trunk_connection_t *tconn,
                                    connection_t *conn, UNUSED void *uctx)
 {
index 7f6ce09baa7763070f43ae1c2f5f18d1de4748ef..c64aa19aa9146aa4265738cfb28f3c9c89d300ac 100644 (file)
@@ -959,6 +959,7 @@ static void _conn_error(UNUSED fr_event_list_t *el, UNUSED int fd, UNUSED int fl
        ERROR("%s - Connection failed: %s", tconn->conn->name, fr_syserror(fd_errno)); \
        connection_signal_reconnect(tconn->conn, CONNECTION_FAILED); \
 } \
+CC_NO_UBSAN(function) /* UBSAN: false positive - public vs private connection_t trips --fsanitize=function*/ \
 static void _name(trunk_connection_t *tconn, connection_t *conn, \
                  fr_event_list_t *el, trunk_connection_event_t notify_on, UNUSED void *uctx) \
 { \
index 41fa0cd9936b75eafe0ff02f69f0058c41552e85..aabc07be690e2376cc46eceb382d3ab6d60c1b99 100644 (file)
@@ -995,6 +995,7 @@ static void conn_error(UNUSED fr_event_list_t *el, UNUSED int fd, UNUSED int fla
        connection_signal_reconnect(conn, CONNECTION_FAILED);
 }
 
+CC_NO_UBSAN(function) /* UBSAN: false positive - public vs private connection_t trips --fsanitize=function*/
 static void thread_conn_notify(trunk_connection_t *tconn, connection_t *conn,
                               fr_event_list_t *el,
                               trunk_connection_event_t notify_on, UNUSED void *uctx)
@@ -1047,6 +1048,7 @@ static void thread_conn_notify(trunk_connection_t *tconn, connection_t *conn,
 /** A special version of the trunk/event loop glue function which always discards incoming data
  *
  */
+CC_NO_UBSAN(function) /* UBSAN: false positive - public vs private connection_t trips --fsanitize=function*/
 static void thread_conn_notify_replicate(trunk_connection_t *tconn, connection_t *conn,
                                         fr_event_list_t *el,
                                         trunk_connection_event_t notify_on, UNUSED void *uctx)
@@ -1571,6 +1573,7 @@ static void status_check_retry(UNUSED fr_event_list_t *el, fr_time_t now, void *
         trunk_connection_signal_reconnect(tconn, CONNECTION_FAILED);
 }
 
+CC_NO_UBSAN(function) /* UBSAN: false positive - public vs private connection_t trips --fsanitize=function*/
 static void request_mux(fr_event_list_t *el,
                        trunk_connection_t *tconn, connection_t *conn, UNUSED void *uctx)
 {
@@ -1827,6 +1830,7 @@ static void request_mux(fr_event_list_t *el,
        for (i = sent; i < queued; i++) trunk_request_requeue(h->coalesced[i].treq);
 }
 
+CC_NO_UBSAN(function) /* UBSAN: false positive - public vs private connection_t trips --fsanitize=function*/
 static void request_mux_replicate(UNUSED fr_event_list_t *el,
                                  trunk_connection_t *tconn, connection_t *conn, UNUSED void *uctx)
 {
@@ -2136,6 +2140,7 @@ static void status_check_reply(trunk_request_t *treq, fr_time_t now)
        trunk_connection_signal_active(treq->tconn);
 }
 
+CC_NO_UBSAN(function) /* UBSAN: false positive - public vs private connection_t trips --fsanitize=function*/
 static void request_demux(UNUSED fr_event_list_t *el, trunk_connection_t *tconn, connection_t *conn, UNUSED void *uctx)
 {
        udp_handle_t            *h = talloc_get_type_abort(conn->h, udp_handle_t);
index 7f708ab769cd2daad29c04db9fd6c9cdc125d84e..154a7b5729e59e871599a1a8586ba884e1f5bd66 100644 (file)
@@ -865,6 +865,7 @@ static connection_t *sql_trunk_connection_alloc(trunk_connection_t *tconn, fr_ev
 
 TRUNK_NOTIFY_FUNC(sql_trunk_connection_notify, rlm_sql_mysql_conn_t)
 
+CC_NO_UBSAN(function) /* UBSAN: false positive - public vs private connection_t trips --fsanitize=function*/
 static void sql_trunk_request_mux(UNUSED fr_event_list_t *el, trunk_connection_t *tconn,
                                  connection_t *conn, UNUSED void *uctx)
 {
@@ -956,6 +957,7 @@ static void sql_trunk_request_mux(UNUSED fr_event_list_t *el, trunk_connection_t
        if (request) unlang_interpret_mark_runnable(request);
 }
 
+CC_NO_UBSAN(function) /* UBSAN: false positive - public vs private connection_t trips --fsanitize=function*/
 static void sql_trunk_request_demux(UNUSED fr_event_list_t *el, UNUSED trunk_connection_t *tconn,
                                    connection_t *conn, UNUSED void *uctx)
 {
@@ -1027,6 +1029,7 @@ static void sql_trunk_request_demux(UNUSED fr_event_list_t *el, UNUSED trunk_con
        query_ctx->rcode = RLM_SQL_OK;
 }
 
+CC_NO_UBSAN(function) /* UBSAN: false positive - public vs private connection_t trips --fsanitize=function*/
 static void sql_request_cancel(connection_t *conn, void *preq, trunk_cancel_reason_t reason,
                               UNUSED void *uctx)
 {
@@ -1038,6 +1041,7 @@ static void sql_request_cancel(connection_t *conn, void *preq, trunk_cancel_reas
        if (sql_conn->query_ctx == query_ctx) sql_conn->query_ctx = NULL;
 }
 
+CC_NO_UBSAN(function) /* UBSAN: false positive - public vs private connection_t trips --fsanitize=function*/
 static void sql_request_cancel_mux(UNUSED fr_event_list_t *el, trunk_connection_t *tconn,
                                   connection_t *conn, UNUSED void *uctx)
 {
index 304994a144c5d662c4d541d8f9155323f0670324..8387bf93f7016e2c856f7038f06f421c0bbfcbaf 100644 (file)
@@ -367,6 +367,7 @@ static connection_t *sql_trunk_connection_alloc(trunk_connection_t *tconn, fr_ev
 
 TRUNK_NOTIFY_FUNC(sql_trunk_connection_notify, rlm_sql_postgres_conn_t)
 
+CC_NO_UBSAN(function) /* UBSAN: false positive - public vs private connection_t trips --fsanitize=function*/
 static void sql_trunk_request_mux(UNUSED fr_event_list_t *el, trunk_connection_t *tconn,
                                  connection_t *conn, UNUSED void *uctx)
 {
@@ -403,6 +404,7 @@ static void sql_trunk_request_mux(UNUSED fr_event_list_t *el, trunk_connection_t
        }
 }
 
+CC_NO_UBSAN(function) /* UBSAN: false positive - public vs private connection_t trips --fsanitize=function*/
 static void sql_trunk_request_demux(UNUSED fr_event_list_t *el, UNUSED trunk_connection_t *tconn,
                                    connection_t *conn, UNUSED void *uctx)
 {
@@ -504,6 +506,7 @@ static void sql_trunk_request_demux(UNUSED fr_event_list_t *el, UNUSED trunk_con
        if (request) unlang_interpret_mark_runnable(request);
 }
 
+CC_NO_UBSAN(function) /* UBSAN: false positive - public vs private connection_t trips --fsanitize=function*/
 static void sql_request_cancel(connection_t *conn, void *preq, trunk_cancel_reason_t reason,
                               UNUSED void *uctx)
 {
@@ -515,6 +518,7 @@ static void sql_request_cancel(connection_t *conn, void *preq, trunk_cancel_reas
        if (sql_conn->query_ctx == query_ctx) sql_conn->query_ctx = NULL;
 }
 
+CC_NO_UBSAN(function) /* UBSAN: false positive - public vs private connection_t trips --fsanitize=function*/
 static void sql_request_cancel_mux(UNUSED fr_event_list_t *el, trunk_connection_t *tconn,
                                   connection_t *conn, UNUSED void *uctx)
 {
index 92a89cd9ccac7dc4eeda7493b7df214bb55286fd..bf8f14d3f7eeeb64e386faa04a6dc0d1a2e2e1d0 100644 (file)
@@ -462,6 +462,7 @@ static void conn_error(UNUSED fr_event_list_t *el, UNUSED int fd, UNUSED int fla
        connection_signal_reconnect(conn, CONNECTION_FAILED);
 }
 
+CC_NO_UBSAN(function) /* UBSAN: false positive - public vs private connection_t trips --fsanitize=function*/
 static void thread_conn_notify(trunk_connection_t *tconn, connection_t *conn,
                               fr_event_list_t *el,
                               trunk_connection_event_t notify_on, UNUSED void *uctx)
@@ -788,6 +789,7 @@ static void request_retry(fr_event_list_t *el, fr_time_t now, void *uctx)
        check_for_zombie(el, tconn, now, u->retry.start);
 }
 
+CC_NO_UBSAN(function) /* UBSAN: false positive - public vs private connection_t trips --fsanitize=function*/
 static void request_mux(fr_event_list_t *el,
                        trunk_connection_t *tconn, connection_t *conn, UNUSED void *uctx)
 {