Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion dist/images/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ ADD patches/e7d3ba53cdcbc524bb29c54ddb07b83cc4258ed7.patch $SRC_DIR
ADD patches/9286e1fd578fdb8f565a0f4aa9066b538295e1ac.patch $SRC_DIR
ADD patches/737d9f932edada5a91f315b5f382daada8dee952.patch $SRC_DIR
ADD patches/52b727b3315463668669ff423ce8bfa129861162.patch $SRC_DIR
ADD patches/sbrec-delete-null-check.patch $SRC_DIR

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
Expand Down Expand Up @@ -131,7 +132,9 @@ RUN cd /usr/src/ && git clone -b branch-25.03 --depth=1 https://github.com/ovn-o
# add skip conntrack ipcidrs support
git apply $SRC_DIR/737d9f932edada5a91f315b5f382daada8dee952.patch && \
# set dl_src for packets redirected by router port
git apply $SRC_DIR/52b727b3315463668669ff423ce8bfa129861162.patch
git apply $SRC_DIR/52b727b3315463668669ff423ce8bfa129861162.patch && \
# add null check before sbrec delete calls
git apply $SRC_DIR/sbrec-delete-null-check.patch
Comment on lines +135 to +137
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The patch application for sbrec-delete-null-check.patch is correctly added. This ensures that the critical null checks are applied during the OVN build process, preventing potential crashes.


RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
Expand Down
39 changes: 39 additions & 0 deletions dist/images/patches/sbrec-delete-null-check.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
diff --git a/northd/northd.c b/northd/northd.c
index 74c47972a..6b195d475 100644
--- a/northd/northd.c
+++ b/northd/northd.c
@@ -4950,7 +4950,9 @@ ls_handle_lsp_changes(struct ovsdb_idl_txn *ovnsb_idl_txn,
add_op_to_northd_tracked_ports(&trk_lsps->deleted, op);
hmap_remove(&nd->ls_ports, &op->key_node);
hmap_remove(&od->ports, &op->dp_node);
- sbrec_port_binding_delete(op->sb);
+ if (op->sb) {
+ sbrec_port_binding_delete(op->sb);
+ }
Comment on lines +10 to +12
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Adding a null check for op->sb before calling sbrec_port_binding_delete is a critical fix. This prevents potential null pointer dereferences, which could lead to crashes in northd.

delete_fdb_entries(ni->sbrec_fdb_by_dp_and_port, od->tunnel_key,
op->tunnel_key);
}
@@ -10702,7 +10704,7 @@ bfd_table_sync(struct ovsdb_idl_txn *ovnsb_txn,
}

HMAP_FOR_EACH_POP (bfd_e, hmap_node, &sync_bfd_connections) {
- if (bfd_e->stale) {
+ if (bfd_e->stale && bfd_e->sb_bt) {
sbrec_bfd_delete(bfd_e->sb_bt);
Comment on lines +21 to +22
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The addition of bfd_e->sb_bt null check before sbrec_bfd_delete is a crucial improvement. This addresses a potential crash scenario in the BFD table synchronization within northd.

}
bfd_erase_entry(bfd_e);
diff --git a/utilities/ovn-sbctl.c b/utilities/ovn-sbctl.c
index b00b8cd04..2b126d52f 100644
--- a/utilities/ovn-sbctl.c
+++ b/utilities/ovn-sbctl.c
@@ -494,7 +494,9 @@ cmd_chassis_del(struct ctl_context *ctx)
size_t i;

for (i = 0; i < sbctl_ch->ch_cfg->n_encaps; i++) {
- sbrec_encap_delete(sbctl_ch->ch_cfg->encaps[i]);
+ if (sbctl_ch->ch_cfg->encaps[i]) {
+ sbrec_encap_delete(sbctl_ch->ch_cfg->encaps[i]);
+ }
Comment on lines +34 to +36
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Implementing a null check for sbctl_ch->ch_cfg->encaps[i] before sbrec_encap_delete is vital. This prevents crashes in ovn-sbctl when handling chassis deletion, especially if an encapsulation entry is unexpectedly null.

}

struct sbctl_chassis_private *sbctl_ch_priv;