diff options
author | Hitendra Prajapati <hprajapati@mvista.com> | 2023-07-10 11:17:03 +0530 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2023-07-14 07:08:54 -0400 |
commit | 3e51eb35aea3c957a0ed7cce6228f746bec2931f (patch) | |
tree | 290a5f279889dee26909d88e094c74e0651f6fa5 | |
parent | fbe2d05a159aa95f81de89bd0ae6401f036d31d6 (diff) | |
download | meta-openembedded-3e51eb35aea3c957a0ed7cce6228f746bec2931f.tar.gz |
multipath-tools: fix CVE-2022-41974
Upstream-Status: Backport from https://github.com/openSUSE/multipath-tools/commit/fbbf280a0e26026c19879d938ebb2a8200b6357c
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r-- | meta-oe/recipes-support/multipath-tools/files/CVE-2022-41974.patch | 162 | ||||
-rw-r--r-- | meta-oe/recipes-support/multipath-tools/multipath-tools_0.8.4.bb | 1 |
2 files changed, 163 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/multipath-tools/files/CVE-2022-41974.patch b/meta-oe/recipes-support/multipath-tools/files/CVE-2022-41974.patch new file mode 100644 index 0000000000..dcc2cd49ef --- /dev/null +++ b/meta-oe/recipes-support/multipath-tools/files/CVE-2022-41974.patch | |||
@@ -0,0 +1,162 @@ | |||
1 | From 0168696f95b5c610c3861ced8ef98accd1a83b91 Mon Sep 17 00:00:00 2001 | ||
2 | From: Benjamin Marzinski <bmarzins@redhat.com> | ||
3 | Date: Tue, 27 Sep 2022 12:36:37 +0200 | ||
4 | Subject: [PATCH] multipathd: ignore duplicated multipathd command keys | ||
5 | |||
6 | multipath adds rather than or-s the values of command keys. Fix this. | ||
7 | Also, return an invalid fingerprint if a key is used more than once. | ||
8 | |||
9 | References: | ||
10 | https://nvd.nist.gov/vuln/detail/CVE-2022-41974 | ||
11 | https://github.com/opensvc/multipath-tools/issues/59 | ||
12 | |||
13 | Upstream-Status: Backport [https://github.com/openSUSE/multipath-tools/commit/fbbf280a0e26026c19879d938ebb2a8200b6357c] | ||
14 | CVE: CVE-2022-41974 | ||
15 | |||
16 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
17 | Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com> | ||
18 | --- | ||
19 | multipathd/cli.c | 8 ++-- | ||
20 | multipathd/main.c | 104 +++++++++++++++++++++++----------------------- | ||
21 | 2 files changed, 57 insertions(+), 55 deletions(-) | ||
22 | |||
23 | diff --git a/multipathd/cli.c b/multipathd/cli.c | ||
24 | index 800c0fbe..0a266761 100644 | ||
25 | --- a/multipathd/cli.c | ||
26 | +++ b/multipathd/cli.c | ||
27 | @@ -336,9 +336,11 @@ fingerprint(vector vec) | ||
28 | if (!vec) | ||
29 | return 0; | ||
30 | |||
31 | - vector_foreach_slot(vec, kw, i) | ||
32 | - fp += kw->code; | ||
33 | - | ||
34 | + vector_foreach_slot(vec, kw, i) { | ||
35 | + if (fp & kw->code) | ||
36 | + return (uint64_t)-1; | ||
37 | + fp |= kw->code; | ||
38 | + } | ||
39 | return fp; | ||
40 | } | ||
41 | |||
42 | diff --git a/multipathd/main.c b/multipathd/main.c | ||
43 | index 8baf9abe..975287d2 100644 | ||
44 | --- a/multipathd/main.c | ||
45 | +++ b/multipathd/main.c | ||
46 | @@ -1522,61 +1522,61 @@ uxlsnrloop (void * ap) | ||
47 | /* Tell main thread that thread has started */ | ||
48 | post_config_state(DAEMON_CONFIGURE); | ||
49 | |||
50 | - set_handler_callback(LIST+PATHS, cli_list_paths); | ||
51 | - set_handler_callback(LIST+PATHS+FMT, cli_list_paths_fmt); | ||
52 | - set_handler_callback(LIST+PATHS+RAW+FMT, cli_list_paths_raw); | ||
53 | - set_handler_callback(LIST+PATH, cli_list_path); | ||
54 | - set_handler_callback(LIST+MAPS, cli_list_maps); | ||
55 | - set_handler_callback(LIST+STATUS, cli_list_status); | ||
56 | - set_unlocked_handler_callback(LIST+DAEMON, cli_list_daemon); | ||
57 | - set_handler_callback(LIST+MAPS+STATUS, cli_list_maps_status); | ||
58 | - set_handler_callback(LIST+MAPS+STATS, cli_list_maps_stats); | ||
59 | - set_handler_callback(LIST+MAPS+FMT, cli_list_maps_fmt); | ||
60 | - set_handler_callback(LIST+MAPS+RAW+FMT, cli_list_maps_raw); | ||
61 | - set_handler_callback(LIST+MAPS+TOPOLOGY, cli_list_maps_topology); | ||
62 | - set_handler_callback(LIST+TOPOLOGY, cli_list_maps_topology); | ||
63 | - set_handler_callback(LIST+MAPS+JSON, cli_list_maps_json); | ||
64 | - set_handler_callback(LIST+MAP+TOPOLOGY, cli_list_map_topology); | ||
65 | - set_handler_callback(LIST+MAP+FMT, cli_list_map_fmt); | ||
66 | - set_handler_callback(LIST+MAP+RAW+FMT, cli_list_map_fmt); | ||
67 | - set_handler_callback(LIST+MAP+JSON, cli_list_map_json); | ||
68 | - set_handler_callback(LIST+CONFIG+LOCAL, cli_list_config_local); | ||
69 | - set_handler_callback(LIST+CONFIG, cli_list_config); | ||
70 | - set_handler_callback(LIST+BLACKLIST, cli_list_blacklist); | ||
71 | - set_handler_callback(LIST+DEVICES, cli_list_devices); | ||
72 | - set_handler_callback(LIST+WILDCARDS, cli_list_wildcards); | ||
73 | - set_handler_callback(RESET+MAPS+STATS, cli_reset_maps_stats); | ||
74 | - set_handler_callback(RESET+MAP+STATS, cli_reset_map_stats); | ||
75 | - set_handler_callback(ADD+PATH, cli_add_path); | ||
76 | - set_handler_callback(DEL+PATH, cli_del_path); | ||
77 | - set_handler_callback(ADD+MAP, cli_add_map); | ||
78 | - set_handler_callback(DEL+MAP, cli_del_map); | ||
79 | - set_handler_callback(SWITCH+MAP+GROUP, cli_switch_group); | ||
80 | + set_handler_callback(LIST|PATHS, cli_list_paths); | ||
81 | + set_handler_callback(LIST|PATHS|FMT, cli_list_paths_fmt); | ||
82 | + set_handler_callback(LIST|PATHS|RAW|FMT, cli_list_paths_raw); | ||
83 | + set_handler_callback(LIST|PATH, cli_list_path); | ||
84 | + set_handler_callback(LIST|MAPS, cli_list_maps); | ||
85 | + set_handler_callback(LIST|STATUS, cli_list_status); | ||
86 | + set_unlocked_handler_callback(LIST|DAEMON, cli_list_daemon); | ||
87 | + set_handler_callback(LIST|MAPS|STATUS, cli_list_maps_status); | ||
88 | + set_handler_callback(LIST|MAPS|STATS, cli_list_maps_stats); | ||
89 | + set_handler_callback(LIST|MAPS|FMT, cli_list_maps_fmt); | ||
90 | + set_handler_callback(LIST|MAPS|RAW|FMT, cli_list_maps_raw); | ||
91 | + set_handler_callback(LIST|MAPS|TOPOLOGY, cli_list_maps_topology); | ||
92 | + set_handler_callback(LIST|TOPOLOGY, cli_list_maps_topology); | ||
93 | + set_handler_callback(LIST|MAPS|JSON, cli_list_maps_json); | ||
94 | + set_handler_callback(LIST|MAP|TOPOLOGY, cli_list_map_topology); | ||
95 | + set_handler_callback(LIST|MAP|FMT, cli_list_map_fmt); | ||
96 | + set_handler_callback(LIST|MAP|RAW|FMT, cli_list_map_fmt); | ||
97 | + set_handler_callback(LIST|MAP|JSON, cli_list_map_json); | ||
98 | + set_handler_callback(LIST|CONFIG|LOCAL, cli_list_config_local); | ||
99 | + set_handler_callback(LIST|CONFIG, cli_list_config); | ||
100 | + set_handler_callback(LIST|BLACKLIST, cli_list_blacklist); | ||
101 | + set_handler_callback(LIST|DEVICES, cli_list_devices); | ||
102 | + set_handler_callback(LIST|WILDCARDS, cli_list_wildcards); | ||
103 | + set_handler_callback(RESET|MAPS|STATS, cli_reset_maps_stats); | ||
104 | + set_handler_callback(RESET|MAP|STATS, cli_reset_map_stats); | ||
105 | + set_handler_callback(ADD|PATH, cli_add_path); | ||
106 | + set_handler_callback(DEL|PATH, cli_del_path); | ||
107 | + set_handler_callback(ADD|MAP, cli_add_map); | ||
108 | + set_handler_callback(DEL|MAP, cli_del_map); | ||
109 | + set_handler_callback(SWITCH|MAP|GROUP, cli_switch_group); | ||
110 | set_unlocked_handler_callback(RECONFIGURE, cli_reconfigure); | ||
111 | - set_handler_callback(SUSPEND+MAP, cli_suspend); | ||
112 | - set_handler_callback(RESUME+MAP, cli_resume); | ||
113 | - set_handler_callback(RESIZE+MAP, cli_resize); | ||
114 | - set_handler_callback(RELOAD+MAP, cli_reload); | ||
115 | - set_handler_callback(RESET+MAP, cli_reassign); | ||
116 | - set_handler_callback(REINSTATE+PATH, cli_reinstate); | ||
117 | - set_handler_callback(FAIL+PATH, cli_fail); | ||
118 | - set_handler_callback(DISABLEQ+MAP, cli_disable_queueing); | ||
119 | - set_handler_callback(RESTOREQ+MAP, cli_restore_queueing); | ||
120 | - set_handler_callback(DISABLEQ+MAPS, cli_disable_all_queueing); | ||
121 | - set_handler_callback(RESTOREQ+MAPS, cli_restore_all_queueing); | ||
122 | + set_handler_callback(SUSPEND|MAP, cli_suspend); | ||
123 | + set_handler_callback(RESUME|MAP, cli_resume); | ||
124 | + set_handler_callback(RESIZE|MAP, cli_resize); | ||
125 | + set_handler_callback(RELOAD|MAP, cli_reload); | ||
126 | + set_handler_callback(RESET|MAP, cli_reassign); | ||
127 | + set_handler_callback(REINSTATE|PATH, cli_reinstate); | ||
128 | + set_handler_callback(FAIL|PATH, cli_fail); | ||
129 | + set_handler_callback(DISABLEQ|MAP, cli_disable_queueing); | ||
130 | + set_handler_callback(RESTOREQ|MAP, cli_restore_queueing); | ||
131 | + set_handler_callback(DISABLEQ|MAPS, cli_disable_all_queueing); | ||
132 | + set_handler_callback(RESTOREQ|MAPS, cli_restore_all_queueing); | ||
133 | set_unlocked_handler_callback(QUIT, cli_quit); | ||
134 | set_unlocked_handler_callback(SHUTDOWN, cli_shutdown); | ||
135 | - set_handler_callback(GETPRSTATUS+MAP, cli_getprstatus); | ||
136 | - set_handler_callback(SETPRSTATUS+MAP, cli_setprstatus); | ||
137 | - set_handler_callback(UNSETPRSTATUS+MAP, cli_unsetprstatus); | ||
138 | - set_handler_callback(FORCEQ+DAEMON, cli_force_no_daemon_q); | ||
139 | - set_handler_callback(RESTOREQ+DAEMON, cli_restore_no_daemon_q); | ||
140 | - set_handler_callback(GETPRKEY+MAP, cli_getprkey); | ||
141 | - set_handler_callback(SETPRKEY+MAP+KEY, cli_setprkey); | ||
142 | - set_handler_callback(UNSETPRKEY+MAP, cli_unsetprkey); | ||
143 | - set_handler_callback(SETMARGINAL+PATH, cli_set_marginal); | ||
144 | - set_handler_callback(UNSETMARGINAL+PATH, cli_unset_marginal); | ||
145 | - set_handler_callback(UNSETMARGINAL+MAP, cli_unset_all_marginal); | ||
146 | + set_handler_callback(GETPRSTATUS|MAP, cli_getprstatus); | ||
147 | + set_handler_callback(SETPRSTATUS|MAP, cli_setprstatus); | ||
148 | + set_handler_callback(UNSETPRSTATUS|MAP, cli_unsetprstatus); | ||
149 | + set_handler_callback(FORCEQ|DAEMON, cli_force_no_daemon_q); | ||
150 | + set_handler_callback(RESTOREQ|DAEMON, cli_restore_no_daemon_q); | ||
151 | + set_handler_callback(GETPRKEY|MAP, cli_getprkey); | ||
152 | + set_handler_callback(SETPRKEY|MAP|KEY, cli_setprkey); | ||
153 | + set_handler_callback(UNSETPRKEY|MAP, cli_unsetprkey); | ||
154 | + set_handler_callback(SETMARGINAL|PATH, cli_set_marginal); | ||
155 | + set_handler_callback(UNSETMARGINAL|PATH, cli_unset_marginal); | ||
156 | + set_handler_callback(UNSETMARGINAL|MAP, cli_unset_all_marginal); | ||
157 | |||
158 | umask(077); | ||
159 | uxsock_listen(&uxsock_trigger, ux_sock, ap); | ||
160 | -- | ||
161 | 2.25.1 | ||
162 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/multipath-tools_0.8.4.bb b/meta-oe/recipes-support/multipath-tools/multipath-tools_0.8.4.bb index 23273f5d5b..e14e494366 100644 --- a/meta-oe/recipes-support/multipath-tools/multipath-tools_0.8.4.bb +++ b/meta-oe/recipes-support/multipath-tools/multipath-tools_0.8.4.bb | |||
@@ -46,6 +46,7 @@ SRC_URI = "git://github.com/opensvc/multipath-tools.git;protocol=http;branch=mas | |||
46 | file://0001-fix-bug-of-do_compile-and-do_install.patch \ | 46 | file://0001-fix-bug-of-do_compile-and-do_install.patch \ |
47 | file://0001-add-explicit-dependency-on-libraries.patch \ | 47 | file://0001-add-explicit-dependency-on-libraries.patch \ |
48 | file://CVE-2022-41973.patch \ | 48 | file://CVE-2022-41973.patch \ |
49 | file://CVE-2022-41974.patch \ | ||
49 | " | 50 | " |
50 | 51 | ||
51 | LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2" | 52 | LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2" |