[ovs-dev] [PATCH v11 8/8] treewide: Add `ovs_assert` to check for null pointers

2023-06-04 Thread James Raphael Tiovalen
This patch adds an assortment of `ovs_assert` statements to check for null pointers. We use assertions since it should be impossible for any of these pointers to be NULL. Signed-off-by: James Raphael Tiovalen Reviewed-by: Simon Horman --- lib/dp-packet.c| 1 + lib/dpctl.c|

[ovs-dev] [PATCH v11 6/8] ovs-vsctl: Fix crash when routing is enabled

2023-06-04 Thread James Raphael Tiovalen
In the case where routing is enabled, the bridge member of the `vsctl_port` structs is not populated. This can cause a crash if we attempt to access it. This patch fixes the crash by checking if the bridge member is valid before attempting to access it. In the `check_conflicts` function, we print

[ovs-dev] [PATCH v11 7/8] lib, ovsdb: Add various null pointer checks

2023-06-04 Thread James Raphael Tiovalen
This commit adds various null pointer checks to some files in the `lib` and the `ovsdb` directories to fix several Coverity defects. These changes are grouped together as they perform similar checks, returning early or skipping some action if a null pointer is encountered. Signed-off-by: James

[ovs-dev] [PATCH v11 5/8] file, monitor: Add null pointer assertions for old and new ovsdb_rows

2023-06-04 Thread James Raphael Tiovalen
This commit adds non-null pointer assertions in some code that performs some decisions based on old and new input ovsdb_rows. Signed-off-by: James Raphael Tiovalen Reviewed-by: Simon Horman --- ovsdb/file.c| 2 ++ ovsdb/monitor.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-)

[ovs-dev] [PATCH v11 4/8] ovsdb: Assert and check return values of `ovsdb_table_schema_get_column`

2023-06-04 Thread James Raphael Tiovalen
This commit adds a few null pointer assertions and checks to some return values of `ovsdb_table_schema_get_column`. If a null pointer is encountered in these blocks, either the assertion will fail or the control flow will now be redirected to alternative paths which will output the appropriate

[ovs-dev] [PATCH v11 3/8] shash, simap, smap: Add assertions to `*_count` functions

2023-06-04 Thread James Raphael Tiovalen
This commit adds assertions in the functions `shash_count`, `simap_count`, and `smap_count` to ensure that the corresponding input struct pointer is not NULL. This ensures that if the return values of `shash_sort`, `simap_sort`, or `smap_sort` are NULL, then the following for loops would not

[ovs-dev] [PATCH v11 1/8] lib: Add non-null assertions to some return values of `dp_packet_data`

2023-06-04 Thread James Raphael Tiovalen
This commit adds some `ovs_assert()` checks to some return values of `dp_packet_data()` to ensure that they are not NULL and to prevent null-pointer dereferences, which might lead to unwanted crashes. We use assertions since it should be impossible for these calls to `dp_packet_data()` to return

[ovs-dev] [PATCH v11 2/8] lib, ovs-vsctl: Add zero-initializations

2023-06-04 Thread James Raphael Tiovalen
This commit adds zero-initializations by changing `SFL_ALLOC` from `malloc` to `xzalloc`, adding a `memset` call to `sflAlloc`, initializing a `pollfd` struct variable with zeroes, and changing some calls to `xmalloc` to `xzalloc`. This is to prevent potential data leaks or undefined behavior from

[ovs-dev] [PATCH v11 0/8] treewide: Fix multiple Coverity defects

2023-06-04 Thread James Raphael Tiovalen
This cleanup patchset addresses several high and medium-impact Coverity defects. Unit tests have been successfully executed via `make check` and they successfully passed. The list of revisions so far: v2: Fix some apply-robot checkpatch errors and warnings. v3: Fix some apply-robot checkpatch

Re: [ovs-dev] [PATCH v10 2/8] lib, ovs-vsctl: Add zero-initializations

2023-06-04 Thread James R T
On Wed, May 24, 2023 at 12:20 AM Simon Horman wrote: > > On question about this. > > memset() is passed alloc before the call to ovs_assert(). > From the POV of the safety you are implementing, is that ok? Ah right, apologies for that. It seems that I overlooked the order. `ovs_assert` should be

[ovs-dev] [ovs-dev v10] ofproto-dpif-upcall: fix push_dp_ops

2023-06-04 Thread Peng He
push_dp_ops only handles delete ops errors but ignores the modify ops results. It's better to handle all the dp operation errors in a consistent way. This patch prevents the inconsistency by considering modify failure in revalidators. To note, we cannot perform two state transitions and change

Re: [ovs-dev] [ovs-dev v9] ofproto-dpif-upcall: fix push_dp_ops

2023-06-04 Thread Peng He
Recently I have identified the real root cause for this inconsistency between ukey and megaflow actions. I thus decided to withdraw this version and change its commits. Will send a v10. Please do not review this version. 0-day Robot 于2023年6月2日周五 23:19写道: > Bleep bloop. Greetings Peng He, I am

Re: [ovs-dev] [PATCH v4 3/3] netdev-offload-dpdk: use flow transfer proxy mechanism

2023-06-04 Thread Ivan Malov via dev
Hi Eli, Thanks for reviewing this. Please see below. On Tue, 21 Feb 2023, Eli Britstein wrote: -Original Message- From: Ivan Malov Sent: Tuesday, 21 February 2023 2:41 To: ovs-dev@openvswitch.org Cc: Ilya Maximets ; Eli Britstein ; Ori Kam ; David Marchand Subject: [PATCH v4 3/3]