summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Black <daniel@mariadb.org>2022-09-02 10:43:39 +1000
committerDaniel Black <daniel@mariadb.org>2022-09-06 08:03:49 +1000
commitfd8dbe0d2cd23b8ad1e8b393edc85a1440fa293d (patch)
treec098864c7b57ecf774c4f2eb096701c409301338
parent9fefd440b516f2941710891d72489dac98a97d19 (diff)
downloadmariadb-git-fd8dbe0d2cd23b8ad1e8b393edc85a1440fa293d.tar.gz
MDEV-29443: prevent uring access to galera sst /notify scripts
The resources like uring in MariaDB aren't intended for spawned processes so we restrict access using the io_uring_ring_dontfork liburing library call.
-rw-r--r--tpool/aio_liburing.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/tpool/aio_liburing.cc b/tpool/aio_liburing.cc
index 2a9c79f9020..6eff6c313a3 100644
--- a/tpool/aio_liburing.cc
+++ b/tpool/aio_liburing.cc
@@ -63,6 +63,12 @@ public:
}
throw std::runtime_error("aio_uring()");
}
+ if (io_uring_ring_dontfork(&uring_) != 0)
+ {
+ my_printf_error(ER_UNKNOWN_ERROR,
+ "io_uring_dontfork() failed with errno %d (continuing)",
+ ME_ERROR_LOG | ME_WARNING, errno);
+ }
thread_= std::thread(thread_routine, this);
}