[ovs-git] [openvswitch/ovs] 2480d0: ovsdb: transaction-forward: Fix initialization of ...
Ilya Maximets
noreply at github.com
Thu Aug 5 19:49:29 UTC 2021
Branch: refs/heads/master
Home: https://github.com/openvswitch/ovs
Commit: 2480d09e9f61bc1ef83d0e9d8edee131a2edc32a
https://github.com/openvswitch/ovs/commit/2480d09e9f61bc1ef83d0e9d8edee131a2edc32a
Author: Ilya Maximets <i.maximets at ovn.org>
Date: 2021-08-05 (Thu, 05 Aug 2021)
Changed paths:
M ovsdb/transaction-forward.c
Log Message:
-----------
ovsdb: transaction-forward: Fix initialization of the 'sent' hmap node.
'sent_node' is initialized to all zeroes by xzalloc(), but
HMAP_NODE_NULL is not all zeroes. hmap_node_is_null() is used
to detect if the node is valid, but it will fail and cause
segmentation fault on attempt to remove the non-existent node
from the hash map. This can happen if client disconnected while
the transaction is not yet forwarded to the relay source:
Program terminated with signal 11, Segmentation fault.
0 in hmap_remove at include/openvswitch/hmap.h:293
293 while (*bucket != node) {
(gdb) bt
0 hmap_remove at include/openvswitch/hmap.h:293
1 ovsdb_txn_forward_unlist at ovsdb/transaction-forward.c:67
2 ovsdb_txn_forward_destroy at ovsdb/transaction-forward.c:79
3 ovsdb_trigger_destroy at ovsdb/trigger.c:70
4 ovsdb_jsonrpc_trigger_complete at ovsdb/jsonrpc-server.c:1192
5 ovsdb_jsonrpc_trigger_remove__ at ovsdb/jsonrpc-server.c:1204
6 ovsdb_jsonrpc_trigger_complete_all at ovsdb/jsonrpc-server.c:1223
7 ovsdb_jsonrpc_session_run at ovsdb/jsonrpc-server.c:546
8 ovsdb_jsonrpc_session_run_all at ovsdb/jsonrpc-server.c:591
9 ovsdb_jsonrpc_server_run at ovsdb/jsonrpc-server.c:406
10 main_loop
(gdb) print db->txn_forward_sent
$20 = {buckets = 0x..., one = 0x0, mask = 63, n = 0}
(gdb) print txn_fwd->sent_node
$24 = {hash = 0, next = 0x0}
Fix that by correct initialization of the 'sent_node'.
Reported-by: Wentao Jia <wentao.jia at easystack.cn>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2021-August/051354.html
Fixes: 7964ffe7d2bf ("ovsdb: relay: Add support for transaction forwarding.")
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Acked-by: Mark D. Gray <mark.d.gray at redhat.com>
Commit: 765c8a774dfebea9ec78c20a3de5e89703d0a3a0
https://github.com/openvswitch/ovs/commit/765c8a774dfebea9ec78c20a3de5e89703d0a3a0
Author: Ilya Maximets <i.maximets at ovn.org>
Date: 2021-08-05 (Thu, 05 Aug 2021)
Changed paths:
M AUTHORS.rst
Log Message:
-----------
AUTHORS.rst: Add Gaetan Rivet and Wentao Jia.
Wentao Jia provided useful bug reports for ovsdb relay mode.
Gaetan Rivet authored several patches already, but I seem to
forget to add him to the list of authors.
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Compare: https://github.com/openvswitch/ovs/compare/a3bd383e94a9...765c8a774dfe
More information about the git
mailing list