diff --git a/SOURCES/openvswitch-2.17.0.patch b/SOURCES/openvswitch-2.17.0.patch index 6a25d6e..56f7ad8 100644 --- a/SOURCES/openvswitch-2.17.0.patch +++ b/SOURCES/openvswitch-2.17.0.patch @@ -52961,6 +52961,89 @@ index d913b2088f..771ccc9737 100644 free_slot(slot); } ovs_mutex_destroy(&rwlock->mutex); +diff --git a/lib/fatal-signal.c b/lib/fatal-signal.c +index bbb31ef275..7054f8e745 100644 +--- a/lib/fatal-signal.c ++++ b/lib/fatal-signal.c +@@ -78,6 +78,39 @@ static void call_hooks(int sig_nr); + static BOOL WINAPI ConsoleHandlerRoutine(DWORD dwCtrlType); + #endif + ++/* Sets up a pipe or event handle that will be used to wake up the current ++ * process after signal is received, so it can be processed outside of the ++ * signal handler context in fatal_signal_run(). */ ++static void ++fatal_signal_create_wakeup_events(void) ++{ ++#ifndef _WIN32 ++ xpipe_nonblocking(signal_fds); ++#else ++ wevent = CreateEvent(NULL, TRUE, FALSE, NULL); ++ if (!wevent) { ++ char *msg_buf = ovs_lasterror_to_string(); ++ VLOG_FATAL("Failed to create a event (%s).", msg_buf); ++ } ++#endif ++} ++ ++static void ++fatal_signal_destroy_wakeup_events(void) ++{ ++#ifndef _WIN32 ++ close(signal_fds[0]); ++ signal_fds[0] = -1; ++ close(signal_fds[1]); ++ signal_fds[1] = -1; ++#else ++ ResetEvent(wevent); ++ CloseHandle(wevent); ++ wevent = NULL; ++#endif ++} ++ ++ + /* Initializes the fatal signal handling module. Calling this function is + * optional, because calling any other function in the module will also + * initialize it. However, in a multithreaded program, the module must be +@@ -94,15 +127,10 @@ fatal_signal_init(void) + inited = true; + + ovs_mutex_init_recursive(&mutex); +-#ifndef _WIN32 +- xpipe_nonblocking(signal_fds); +-#else +- wevent = CreateEvent(NULL, TRUE, FALSE, NULL); +- if (!wevent) { +- char *msg_buf = ovs_lasterror_to_string(); +- VLOG_FATAL("Failed to create a event (%s).", msg_buf); +- } + ++ fatal_signal_create_wakeup_events(); ++ ++#ifdef _WIN32 + /* Register a function to handle Ctrl+C. */ + SetConsoleCtrlHandler(ConsoleHandlerRoutine, true); + #endif +@@ -456,6 +484,9 @@ do_unlink_files(void) + * hooks passed a 'cancel_cb' function to fatal_signal_add_hook(), then those + * functions will be called, allowing them to free resources, etc. + * ++ * Also re-creates wake-up events, so signals in one of the processes do not ++ * wake up the other one. ++ * + * Following a fork, one of the resulting processes can call this function to + * allow it to terminate without calling the hooks registered before calling + * this function. New hooks registered after calling this function will take +@@ -467,6 +498,9 @@ fatal_signal_fork(void) + + assert_single_threaded(); + ++ fatal_signal_destroy_wakeup_events(); ++ fatal_signal_create_wakeup_events(); ++ + for (i = 0; i < n_hooks; i++) { + struct hook *h = &hooks[i]; + if (h->cancel_cb) { diff --git a/lib/flow.c b/lib/flow.c index dd523c889b..418c3c4f48 100644 --- a/lib/flow.c diff --git a/SPECS/openvswitch2.17.spec b/SPECS/openvswitch2.17.spec index 7fcf8c4..f88c076 100644 --- a/SPECS/openvswitch2.17.spec +++ b/SPECS/openvswitch2.17.spec @@ -63,7 +63,7 @@ Summary: Open vSwitch Group: System Environment/Daemons daemon/database/utilities URL: http://www.openvswitch.org/ Version: 2.17.0 -Release: 104%{?dist} +Release: 105%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -749,6 +749,12 @@ exit 0 %endif %changelog +* Fri Jun 09 2023 Open vSwitch CI - 2.17.0-105 +- Merging upstream branch-2.17 [RH git: 1f6a8ffe16] + Commit list: + 4b10b0b87f fatal-signal: Don't share signal fds/handles with forked process. + + * Wed Jun 07 2023 Open vSwitch CI - 2.17.0-104 - Merging upstream branch-2.17 [RH git: 262456bdbd] Commit list: