Re: [ovs-dev] [PATCH v4] gre: Rename fallback devices to avoid udev's interference

2018-09-17 Thread Yifeng Sun
Hi Greg, Your guess is correct. The FB device is only created once. Even if more tunnels are added, there are still only one FB device. Yes, three digits should be enough in our case. Thanks, Yifeng On Mon, Sep 17, 2018 at 2:28 PM Gregory Rose wrote: > On 9/17/2018 1:40 PM, Yifeng Sun wr

Re: [ovs-dev] [PATCH] ofp-print: Fix a memory leak reported by fuzz

2018-09-18 Thread Yifeng Sun
Hi Ben, Got it, thanks for telling me. Best, Yifeng On Tue, Sep 18, 2018 at 1:35 AM Ben Pfaff wrote: > On Thu, Sep 13, 2018 at 06:19:55AM -0700, Yifeng Sun wrote: > > When ofputil_decode_port_stats returns error, it is possible that > > custom_stats_counters is valid and s

[ovs-dev] [PATCH v5] gre: Rename fallback devices to avoid udev's interference

2018-09-18 Thread Yifeng Sun
t;ovs-". Signed-off-by: Yifeng Sun VMware Issue: #2162866 --- Please backport this patch to upstream OVS down to 2.9, thanks. v1->v2: Added sanity check for device names, thanks Justin. v2->v3: Fix an indent error. v3->v4: Fix by code review, also fix a potenial bug. v4->v5: Remove un

[ovs-dev] [PATCH] tests: Fix broken test of 'truncate and output to gre tunnel'

2018-09-18 Thread Yifeng Sun
atic kernel versions. On centos, this test may fail due to the default rules of iptables. Signed-off-by: Yifeng Sun --- tests/system-traffic.at | 133 1 file changed, 133 insertions(+) diff --git a/tests/system-traffic.at b/tests/system-traf

Re: [ovs-dev] [PATCH v5] gre: Rename fallback devices to avoid udev's interference

2018-09-18 Thread Yifeng Sun
n Sep 18, 2018, at 10:35 AM, Yifeng Sun wrote: > > > > On certain kernel versions, when openvswitch kernel module creates > > a gre0 interface, the kernel’s gre module will jump out and compete > > to control the gre0 interface. This will cause the failure of > > openv

Re: [ovs-dev] [PATCH] tests: Fix broken test of 'truncate and output to gre tunnel'

2018-09-21 Thread Yifeng Sun
No need to backport. Thanks Ben. On Fri, Sep 21, 2018 at 1:23 PM Ben Pfaff wrote: > On Thu, Sep 20, 2018 at 10:49:08AM -0700, Gregory Rose wrote: > > On 9/18/2018 2:39 PM, Yifeng Sun wrote: > > >The test 'truncate and output to gre tunnel' is broken on certain >

Re: [ovs-dev] [PATCH] flow: Fix uninitialized flow fields in IPv6 error case.

2018-09-21 Thread Yifeng Sun
Thanks, looks good to me. Reviewed-by: Yifeng Sun On Fri, Sep 21, 2018 at 11:26 AM Ben Pfaff wrote: > When parse_ipv6_ext_hdrs__() returned false, half a 64-bit word had been > pushed into the miniflow and the second half was left uninitialized. This > commit fixes the problem. >

Re: [ovs-dev] [PATCH] ovsdb-data: Drop redundant initialization from ovsdb_datum_apply_diff().

2018-09-26 Thread Yifeng Sun
Looks good to me, thanks. Reviewed-by: Yifeng Sun On Mon, Sep 24, 2018 at 9:33 PM Ben Pfaff wrote: > The call to ovsdb_datum_diff() initializes 'new', so it's not necessary to > also do it in ovsdb_datum_apply_diff(). > > Found by inspection. > > Signed-off-

Re: [ovs-dev] [PATCH] dpif: Remove support for multiple queues per port.

2018-09-26 Thread Yifeng Sun
It looks good to me, and testing shows no problem. Thanks. Tested-by: Yifeng Sun Reviewed-by: Yifeng Sun On Tue, Sep 25, 2018 at 3:14 PM Ben Pfaff wrote: > Commit 69c51582ff78 ("dpif-netlink: don't allocate per thread netlink > sockets") removed dpif-netlink support fo

[ovs-dev] [PATCH] ovsdb-client: Fix a bug that uses wrong index

2018-09-27 Thread Yifeng Sun
This patch fixes the incorrect index to argv. Signed-off-by: Yifeng Sun --- ovsdb/ovsdb-client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ovsdb/ovsdb-client.c b/ovsdb/ovsdb-client.c index ab3aa7c93307..7c8a59d0e749 100644 --- a/ovsdb/ovsdb-client.c +++ b/ovsdb

[ovs-dev] [PATCH] extend-table: Fix a bug that iterates wrong table

2018-10-01 Thread Yifeng Sun
This seems to be a copy and paste bug that iterates and frees the wrong table. This commit fixes that. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10730 Signed-off-by: Yifeng Sun --- ovn/lib/extend-table.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[ovs-dev] [PATCH] expr: Properly initialize expr_constant

2018-10-01 Thread Yifeng Sun
expr_constant.masked may be uninitialized when its type is EXPR_C_STRING. This patch fixes this issue. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10731 Signed-off-by: Yifeng Sun --- include/ovn/expr.h | 10 +- ovn/lib/expr.c | 4 2 files changed, 13

[ovs-dev] [PATCH] lex: Fix stack underflow bug and improve loop

2018-10-02 Thread Yifeng Sun
In previous code, if hexit == 0, then the boundary for 'out' is not checked. This patch fixes it and also takes the checking out of loop to improve loop's performance. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10710 Signed-off-by: Yifeng Sun --- ovn

[ovs-dev] [PATCH v2] expr: Properly initialize expr_constant

2018-10-02 Thread Yifeng Sun
expr_constant.masked may be uninitialized when its type is EXPR_C_STRING. This patch fixes this issue. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10731 Signed-off-by: Yifeng Sun --- v1->v2: Fix email subject by adding [ovs-dev] include/ovn/expr.h | 10 +-

[ovs-dev] [PATCH v2] extend-table: Fix a bug that iterates wrong table

2018-10-02 Thread Yifeng Sun
This seems to be a copy and paste bug that iterates and frees the wrong table. This commit fixes that. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10730 Signed-off-by: Yifeng Sun --- v1->v2: Fix email subject by adding [ovs-dev] ovn/lib/extend-table.c | 4 ++-- 1 f

Re: [ovs-dev] [PATCH] lex: Fix stack underflow bug and improve loop

2018-10-02 Thread Yifeng Sun
Sorry just realized my patches are missing the [ovs-dev] in the subjects. Resend v2. On Tue, Oct 2, 2018 at 11:26 AM Yifeng Sun wrote: > In previous code, if hexit == 0, then the boundary for 'out' is > not checked. This patch fixes it and also takes the checking out > of loo

[ovs-dev] [PATCH v2] lex: Fix stack underflow bug and improve loop

2018-10-02 Thread Yifeng Sun
In previous code, if hexit == 0, then the boundary for 'out' is not checked. This patch fixes it and also takes the checking out of loop to improve loop's performance. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10710 Signed-off-by: Yifeng Sun --- v1->v2:

[ovs-dev] [PATCH v3] lex: Fix stack underflow bug reported by Fuzz

2018-10-02 Thread Yifeng Sun
In previous code, if hexit == 0, then the boundary for 'out' is not checked. This patch fixes it. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10710 Signed-off-by: Yifeng Sun --- v1->v2: Fix email subject by adding [ovs-dev] v2->v3: Fix the code to hand

Re: [ovs-dev] [PATCH] lex: Fix stack underflow bug and improve loop

2018-10-02 Thread Yifeng Sun
Thanks Ben for the review, I sent a v3. On Tue, Oct 2, 2018 at 11:41 AM Ben Pfaff wrote: > On Tue, Oct 02, 2018 at 11:26:23AM -0700, Yifeng Sun wrote: > > In previous code, if hexit == 0, then the boundary for 'out' is > > not checked. This patch fixes it and also take

Re: [ovs-dev] [PATCH v2] expr: Properly initialize expr_constant

2018-10-02 Thread Yifeng Sun
, Oct 02, 2018 at 11:37:02AM -0700, Yifeng Sun wrote: > > expr_constant.masked may be uninitialized when its type is EXPR_C_STRING. > > This patch fixes this issue. > > > > Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10731 > > Signed-off-by: Yifeng

Re: [ovs-dev] [PATCH v2] extend-table: Fix a bug that iterates wrong table

2018-10-02 Thread Yifeng Sun
Good idea, let me work out a new version. Thanks, Yifeng On Tue, Oct 2, 2018 at 3:03 PM Ben Pfaff wrote: > On Tue, Oct 02, 2018 at 11:37:03AM -0700, Yifeng Sun wrote: > > This seems to be a copy and paste bug that iterates and frees > > the wrong table. This commit fixes that. &

[ovs-dev] [PATCH] lib: Adapt jsonrpc header file for use in C++.

2018-10-03 Thread Yifeng Sun
This patch exposes jsonrpc.h for inclusion in C++, which will be used by NSX. It added [extern "C"] to the header file and fixed other places to accommodate this change. Signed-off-by: Yifeng Sun --- include/openvswitch/automake.mk | 1 + include/openvswitch/jsonrpc.h

Re: [ovs-dev] [PATCH] lib: Adapt jsonrpc header file for use in C++.

2018-10-03 Thread Yifeng Sun
We need a proper method for external code to send queries to db.sock. The jsonrpc.h does expose more than what is needed. Do you have any better suggestion? Thanks, Yifeng On Wed, Oct 3, 2018 at 6:26 PM Ben Pfaff wrote: > On Wed, Oct 03, 2018 at 04:07:22PM -0700, Yifeng Sun wrote: >

Re: [ovs-dev] [PATCH] lib: Adapt jsonrpc header file for use in C++.

2018-10-04 Thread Yifeng Sun
very third-party program. > > Another is that we could expose the additional APIs that are needed. > > On Wed, Oct 03, 2018 at 07:01:09PM -0700, Yifeng Sun wrote: > > We need a proper method for external code to send queries to db.sock. > > The jsonrpc.h does expose more

Re: [ovs-dev] [PATCH] lib: Adapt jsonrpc header file for use in C++.

2018-10-04 Thread Yifeng Sun
Thanks. I will create a patch. On Thu, Oct 4, 2018 at 11:50 AM Ben Pfaff wrote: > On Thu, Oct 04, 2018 at 11:34:44AM -0700, Yifeng Sun wrote: > > Or we make the changes to ovsdb-types.h as below so that it can be > compiled > > by c++ compilers. What do you think? > >

[ovs-dev] [PATCH] ovsdb-types: Refactor structs so as to comply with C++ standard

2018-10-04 Thread Yifeng Sun
C++ standard only accepts anonymous struct inside anonymous union. This patch re-organized the structs so that this header file can be used in C++ source files. Signed-off-by: Yifeng Sun --- Please backport to 2.10, thanks. lib/ovsdb-types.h | 46

[ovs-dev] [PATCH] flow: Clear ovs_nsh_key's context data when nsh's type can't be handled

2018-10-04 Thread Yifeng Sun
In the default case when nsh's md_type is not recognized by nsh parser, uninitialized data in key->context can sneak into miniflow. This patch fixes it. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10519 Signed-off-by: Yifeng Sun --- lib/flow.c | 1 + 1 file ch

[ovs-dev] [PATCH] expr: Set a limit on the depth of nested parentheses

2018-10-04 Thread Yifeng Sun
Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10714 Signed-off-by: Yifeng Sun Suggested-by: Ben Pfaff --- ovn/lib/expr.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ovn/lib/expr.c b/ovn/lib/expr.c index 0a2cef2f0ee9..cabd5c60d9c8 100644

[ovs-dev] [PATCH] odp-util: Fix a use-afer-free bug

2018-10-05 Thread Yifeng Sun
After ofpbug_put, actions may have been reallocated and key will point to invalid memory address. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10796 Signed-off-by: Yifeng Sun --- lib/odp-util.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a

[ovs-dev] [PATCH v3] extend-table: Fix a bug that iterates wrong table

2018-10-05 Thread Yifeng Sun
This seems to be a copy and paste bug that iterates and frees the wrong table. This commit fixes that. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10730 Co-authored-by: Ben Pfaff Signed-off-by: Yifeng Sun Signed-off-by: Ben Pfaff --- v1->v2: Fix email subject by add

Re: [ovs-dev] [PATCH] odp-util: Fix a use-afer-free bug

2018-10-05 Thread Yifeng Sun
This patch should also fix the bug reported at https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10802 On Fri, Oct 5, 2018 at 2:50 PM Yifeng Sun wrote: > After ofpbug_put, actions may have been reallocated and > key will point to invalid memory address. > > Report

Re: [ovs-dev] [PATCH] expr: Set a limit on the depth of nested parentheses

2018-10-08 Thread Yifeng Sun
Thanks for the review! I will come up with a new version. Yifeng On Mon, Oct 8, 2018 at 11:02 AM Ben Pfaff wrote: > On Thu, Oct 04, 2018 at 04:30:10PM -0700, Yifeng Sun wrote: > > Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10714 > > Signed-off

[ovs-dev] [PATCH 1/2] odp-util: Fix a bug that causes stack overflow

2018-10-09 Thread Yifeng Sun
orted-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10855 Signed-off-by: Yifeng Sun --- lib/odp-util.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/odp-util.c b/lib/odp-util.c index 7705bb30ae21..d482d5bcf968 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@

[ovs-dev] [PATCH 2/2] odp-util: Handle returning when parse_odp_key_mask_attr handles ufid

2018-10-09 Thread Yifeng Sun
: Yifeng Sun --- lib/odp-util.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/odp-util.c b/lib/odp-util.c index d482d5bcf968..f53530db40aa 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -2216,9 +2216,10 @@ parse_odp_action(const char *s, const struct simap

[ovs-dev] [PATCH v2] expr: Set a limit on the depth of nested parentheses

2018-10-10 Thread Yifeng Sun
This patch checks the depth of nested parentheses to prevent stack overflow. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10714 Signed-off-by: Yifeng Sun Suggested-by: Ben Pfaff --- v1->v2: Handle parse_chassis_resident and add new test, thanks Ben! ovn/lib/expr.c |

[ovs-dev] [PATCH v3] expr: Set a limit on the depth of nested parentheses

2018-10-10 Thread Yifeng Sun
10714 Signed-off-by: Yifeng Sun Suggested-by: Ben Pfaff --- v1->v2: Handle parse_chassis_resident and add new test, thanks Ben! v2->v3: Ignore parentheses from chassis resident. ovn/lib/expr.c | 10 ++ tests/ovn.at | 4 2 files changed, 14 insertions(+) diff --git a/ovn/l

Re: [ovs-dev] [PATCH v2] expr: Set a limit on the depth of nested parentheses

2018-10-10 Thread Yifeng Sun
Thanks, handling is_chassis_resident is not necessary because it doesn't allow nested parentheses. I've sent out a new version. Yifeng On Wed, Oct 10, 2018 at 11:13 AM Ben Pfaff wrote: > On Wed, Oct 10, 2018 at 11:03:54AM -0700, Yifeng Sun wrote: > > This patch checks

[ovs-dev] [PATCH v3] expr: Access expr_constant.mask only when its type is EXPR_C_INTEGER

2018-10-10 Thread Yifeng Sun
: Yifeng Sun --- v1->v2: Fix email subject by adding [ovs-dev] v2->v3: Inspect through code to make sure expr_constant is accessed correctly by its type, thanks Ben for the review! ovn/lib/expr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ovn/lib/expr.c b/ovn/lib/

Re: [ovs-dev] [PATCH v3] expr: Set a limit on the depth of nested parentheses

2018-10-11 Thread Yifeng Sun
Thanks! On Thu, Oct 11, 2018 at 1:02 PM Ben Pfaff wrote: > On Wed, Oct 10, 2018 at 03:15:52PM -0700, Yifeng Sun wrote: > > This patch checks the depth of nested parentheses to prevent > > stack overflow. Since is_chassis_resident doesn't allow > > nested parentheses,

Re: [ovs-dev] [PATCH] expr: Disallow < <= >= > comparisons against empty value set.

2018-10-11 Thread Yifeng Sun
Looks good to me, thanks. Reviewed-by: Yifeng Sun On Thu, Oct 11, 2018 at 12:44 PM Ben Pfaff wrote: > OVN expression syntax does not allow a literal empty value set, like {}. > Rather, any literal value set has to have at least one value. However, > value sets that originate fro

Re: [ovs-dev] [PATCH 1/2] odp-util: Fix a bug that causes stack overflow

2018-10-11 Thread Yifeng Sun
In scan_set, '\0' is not always put in the buf. Ok, I think this patch is not the correct way to fix this issue, I will come up with a new version. Thanks, Yifeng On Thu, Oct 11, 2018 at 1:18 PM Ben Pfaff wrote: > On Tue, Oct 09, 2018 at 03:39:17PM -0700, Yifeng Sun wrote: >

Re: [ovs-dev] [PATCH 2/2] odp-util: Handle returning when parse_odp_key_mask_attr handles ufid

2018-10-11 Thread Yifeng Sun
Thanks for the review. How about returning a -EINVAL in this case? On Thu, Oct 11, 2018 at 1:39 PM Ben Pfaff wrote: > On Tue, Oct 09, 2018 at 03:39:18PM -0700, Yifeng Sun wrote: > > When parse_odp_key_mask_attr runs into ufid, it returns length of ufid > > without appending da

Re: [ovs-dev] [PATCH 2/2] odp-util: Handle returning when parse_odp_key_mask_attr handles ufid

2018-10-11 Thread Yifeng Sun
Thu, Oct 11, 2018 at 01:53:54PM -0700, Yifeng Sun wrote: > > Thanks for the review. > > > > How about returning a -EINVAL in this case? > > > > On Thu, Oct 11, 2018 at 1:39 PM Ben Pfaff wrote: > > > > > On Tue, Oct 09, 2018 at 03:39:18PM -0700, Yifeng S

Re: [ovs-dev] [PATCH] ofproto-dpif-xlate: Avoid deadlock on multicast snooping recursion.

2018-10-12 Thread Yifeng Sun
Looks good to me, thanks. Reviewed-by: Yifeng Sun On Mon, Aug 20, 2018 at 8:26 PM Ben Pfaff wrote: > Until now, OVS did multicast snooping outputs holding the read-lock on > the mcast_snooping object. This could recurse via a patch port to try to > take the write-lock on the sa

[ovs-dev] [PATCH] datapath: Use correct reply values in datapath and vport ops

2018-10-17 Thread Yifeng Sun
This patch fixes the bug that all datapath and vport ops are returning wrong values (OVS_FLOW_CMD_NEW or OVS_DP_CMD_NEW) in their replies. This commit backports upstream net-next's commit 804fe108fc92e59 ("openvswitch: Use correct reply values in datapath and vport ops"). Signed

[ovs-dev] [PATCH] ofp-port: Free memory on error in ofp_print_ofpst_port_reply

2018-10-18 Thread Yifeng Sun
Counters in ops->custom_stats may already be valid at this error point. This patch frees the leaked memory. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10322 Signed-off-by: Yifeng Sun --- lib/ofp-port.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ofp-port.

[ovs-dev] [PATCH v2] odp-util: Move ufid handling to odp_flow_from_string

2018-10-18 Thread Yifeng Sun
understand ufid. This patch moves ufid parsing from parse_odp_key_mask_attr out to odp_flow_from_string. Reported-by: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10850 Signed-off-by: Yifeng Sun --- v1->v2: Improved according to Ben's review. lib/odp-util.c | 18 +++--

[ovs-dev] [PATCH] odp-util: Initialize nsh_hdr in odp_nsh_hdr_from_attr

2018-10-18 Thread Yifeng Sun
://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10863 Signed-off-by: Yifeng Sun --- lib/odp-util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/odp-util.c b/lib/odp-util.c index d156fa7265de..1a52f3bc5ad9 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -2559,6 +2559,8

[ovs-dev] [PATCH] odp-util: Properly handle the return values of scan_XXX functions

2018-10-25 Thread Yifeng Sun
scan_XXX functions are not properly handled. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10800 Signed-off-by: Yifeng Sun --- lib/odp-util.c | 63 +++--- 1 file changed, 51 insertions(+), 12 deletions(-) diff --git a/lib

Re: [ovs-dev] [PATCH] odp-util: Properly handle the return values of scan_XXX functions

2018-10-25 Thread Yifeng Sun
Sorry there is a compiling warning. I will fix it and submit v2. On Thu, Oct 25, 2018 at 12:38 PM Yifeng Sun wrote: > Functions like scan_u8, return 0 when they failed to scan the expected > values. Function scan_geneve failed to check this situation. This leads > to using of unin

[ovs-dev] [PATCH] NSH: Fix NSH-related length macros that cause stack overflow

2018-10-25 Thread Yifeng Sun
p/oss-fuzz/issues/detail?id=10855 Signed-off-by: Yifeng Sun --- datapath/linux/compat/include/net/nsh.h | 4 ++-- include/openvswitch/nsh.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/datapath/linux/compat/include/net/nsh.h b/datapath/linux/compat/includ

[ovs-dev] [PATCH] ofctl_parse_target: Fix a bug that uses incomplete ofputil_flow_mod data

2018-10-25 Thread Yifeng Sun
://bugs.chromium.org/p/oss-fuzz/issues/detail?id=0 Signed-off-by: Yifeng Sun --- tests/oss-fuzz/ofctl_parse_target.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/oss-fuzz/ofctl_parse_target.c b/tests/oss-fuzz/ofctl_parse_target.c index 29f89f9b53eb..13d0899dbbae 100644

[ovs-dev] [PATCH v2] odp-util: Properly handle the return values of scan_XXX functions

2018-10-25 Thread Yifeng Sun
scan_XXX functions are not properly handled. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10800 Signed-off-by: Yifeng Sun --- v1->v2: Fix a compiler warning, ovs-dev-bounces complains [ovs-dev] in the subject, remove it. lib/odp-util.c |

Re: [ovs-dev] [PATCH] NSH: Fix NSH-related length macros that cause stack overflow

2018-10-26 Thread Yifeng Sun
appen. On Fri, Oct 26, 2018 at 3:05 PM Ben Pfaff wrote: > On Fri, Oct 26, 2018 at 02:55:55PM -0700, Ben Pfaff wrote: > > On Thu, Oct 25, 2018 at 02:41:50PM -0700, Yifeng Sun wrote: > > > In the filed of ver_flags_ttl_len of struct nshhdr, there are only 6 > > > bits th

Re: [ovs-dev] [PATCH v3] ovn-nbctl: Fix the ovn-nbctl test "LBs - daemon" which fails during rpm build

2018-10-30 Thread Yifeng Sun
I feel another option to fix this issue is to add a new function like dns_resolve_timeout__, what do you think? Thanks, Yifeng On Thu, Oct 25, 2018 at 2:58 AM wrote: > From: Numan Siddique > > When 'make check' is called by the mock rpm build (which disables > networking), > the test "ovn-nbct

Re: [ovs-dev] [PATCH 1/6] connmgr: Modernize coding style.

2018-10-30 Thread Yifeng Sun
Looks good to me, thanks! Reviewed-by: Yifeng Sun On Mon, Oct 29, 2018 at 3:58 PM Ben Pfaff wrote: > This moves declarations closer to first use and merges them with > initialization when possible, moves "for" loop variable declarations into > the "for" s

Re: [ovs-dev] [PATCH 2/6] rconn: New function rconn_is_reliable().

2018-10-30 Thread Yifeng Sun
Looks good, thanks! Reviewed-by: Yifeng Sun On Mon, Oct 29, 2018 at 3:58 PM Ben Pfaff wrote: > This will have its first user in an upcoming commit. > > Signed-off-by: Ben Pfaff > --- > include/openvswitch/rconn.h | 1 + > lib/rconn.c | 7 +++ >

Re: [ovs-dev] [PATCH v3] ovn-nbctl: Fix the ovn-nbctl test "LBs - daemon" which fails during rpm build

2018-10-31 Thread Yifeng Sun
, Oct 30, 2018 at 11:50 PM Yifeng Sun > wrote: > >> I feel another option to fix this issue is to add a new function like >> dns_resolve_timeout__, what do you think? >> > > I think that can fix the problem. I am not too familiar with libunbound. > Does it support spe

Re: [ovs-dev] [PATCH 2/6] rconn: New function rconn_is_reliable().

2018-10-31 Thread Yifeng Sun
Yes, I am reviewing 3. Please ask someone else to review 4+. Thanks. Yifeng On Wed, Oct 31, 2018 at 1:47 PM Ben Pfaff wrote: > On Wed, Oct 31, 2018 at 01:40:59PM -0700, Ben Pfaff wrote: > > Thanks for the reviews, I applied patches 1 and 2. > > > > Do you plan to review further patches? I unde

Re: [ovs-dev] [PATCH 3/6] connmgr: Improve interface for setting controllers.

2018-10-31 Thread Yifeng Sun
Thanks for the improvement. Tested-by: Yifeng Sun Reviewed-by: Yifeng Sun On Mon, Oct 29, 2018 at 3:59 PM Ben Pfaff wrote: > Using an shash instead of an array simplifies the code for both the caller > and the callee. Putting the set of allowed OpenFlow versions in

Re: [ovs-dev] [PATCH v3] ovn-nbctl: Fix the ovn-nbctl test "LBs - daemon" which fails during rpm build

2018-10-31 Thread Yifeng Sun
Hi Ben, The dns resolving depends on libunbound's ub_resolve, which, from Numan's experience as well as my reading on its documentation, doesn't support timeout. I agree there is a bug and we should fix it. Thanks, Yifeng On Wed, Oct 31, 2018 at 1:59 PM Ben Pfaff wrote: > On Thu, Oct 25, 2018

Re: [ovs-dev] [PATCH v3] ovn-nbctl: Fix the ovn-nbctl test "LBs - daemon" which fails during rpm build

2018-10-31 Thread Yifeng Sun
ers the first question. What about if no DNS servers are > available; what does the resolver do in that case? > > On Wed, Oct 31, 2018 at 03:24:13PM -0700, Yifeng Sun wrote: > > Hi Ben, > > > > The dns resolving depends on libunbound's ub_resolve, which, from &

[ovs-dev] [PATCH] odp-util: Validate close-brace in scan_geneve and fix return values of san_xxx functions

2018-11-01 Thread Yifeng Sun
This patch adds validation of close-braces in scan_geneve. In addition, SCAN_TYPE expects scan_XXX functions to return 0 on errors. This patch inspects all related scan_XXX functions and fixes their return values. Signed-off-by: Yifeng Sun --- lib/odp-util.c | 20 +++- 1 file

Re: [ovs-dev] [PATCH] odp-util: Validate close-brace in scan_geneve and fix return values of san_xxx functions

2018-11-01 Thread Yifeng Sun
eems not correct. On Thu, Nov 1, 2018 at 8:08 AM Ben Pfaff wrote: > On Wed, Oct 31, 2018 at 06:43:24PM -0700, Yifeng Sun wrote: > > This patch adds validation of close-braces in scan_geneve. > > > > In addition, SCAN_TYPE expects scan_XXX functions to return 0 > > on erro

[ovs-dev] [PATCH v2] odp-util: Validate close-brace in scan_geneve and fix return values of san_xxx functions

2018-11-01 Thread Yifeng Sun
ss-fuzz https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11153. In addition, SCAN_TYPE expects scan_XXX functions to return 0 on errors. This patch inspects all related scan_XXX functions and fixes their return values. Signed-off-by: Yifeng Sun --- v1->v2: Added example in commit message by Ben's

Re: [ovs-dev] [PATCH] odp-util: Validate close-brace in scan_geneve and fix return values of san_xxx functions

2018-11-01 Thread Yifeng Sun
Sure, I'll do that. On Thu, Nov 1, 2018 at 10:23 AM Ben Pfaff wrote: > Thanks. Would you mind adding that information to the commit message? > > On Thu, Nov 01, 2018 at 09:55:35AM -0700, Yifeng Sun wrote: > > I found this issue while surveying an oss-fuzz report, but I

Re: [ovs-dev] [PATCH v3] ovn-nbctl: Fix the ovn-nbctl test "LBs - daemon" which fails during rpm build

2018-11-01 Thread Yifeng Sun
has "127.0.0.1" as the dns server, like Numan mentioned, resolver will block. For testing, I feel that a timeout dns_resolve makes sense. Can we determine testing context in runtime? Best, Yifeng On Thu, Nov 1, 2018 at 6:20 AM Mark Michelson wrote: > On 10/31/2018 06:24 PM, Yifeng S

Re: [ovs-dev] [PATCH] ovsdb: Clarify that a server that leaves a cluster may never rejoin.

2018-11-01 Thread Yifeng Sun
Looks good to me, thanks. Reviewed-by: Yifeng Sun On Mon, Oct 29, 2018 at 4:37 PM Ben Pfaff wrote: > This wasn't clear from the documentation. > > Reported-by; Paul Greenberg > Signed-off-by: Ben Pfaff > --- > Documentation/ref/ovsdb.7.rst | 3 +++ > ovsdb/o

[ovs-dev] [PATCH] oss-fuzz: Free error string in ofctl_parse_flow

2018-11-01 Thread Yifeng Sun
This patch frees the leaked free string to stop oss-fuzz from complaining. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11161 Signed-off-by: Yifeng Sun --- tests/oss-fuzz/ofctl_parse_target.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/oss-fuzz

[ovs-dev] [PATCH] oss-fuzz: Use unsigned for left shift in ofctl_parse_flows__

2018-11-01 Thread Yifeng Sun
o unsigned int. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11166 Signed-off-by: Yifeng Sun --- tests/oss-fuzz/ofctl_parse_target.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/oss-fuzz/ofctl_parse_target.c b/tests/oss-fuzz/ofctl_parse_targ

[ovs-dev] [PATCH] ofp-actions: Let parse_UNROLL_XLATE return error message instead of aborting program

2018-11-01 Thread Yifeng Sun
ned-off-by: Yifeng Sun --- lib/ofp-actions.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c index a80a4a308dba..f25fdec64cc0 100644 --- a/lib/ofp-actions.c +++ b/lib/ofp-actions.c @@ -5842,7 +5842,8 @@ static char * OVS_WARN_UNU

Re: [ovs-dev] [PATCH] oss-fuzz: Free error string in ofctl_parse_flow

2018-11-01 Thread Yifeng Sun
Sorry, there is a typo in the message, the leaked free string => the leaked error string Ben, do you mind fixing it? Thanks. Best, Yifeng On Thu, Nov 1, 2018 at 11:40 AM Yifeng Sun wrote: > This patch frees the leaked free string to stop oss-fuzz from > complaining. > > Rep

Re: [ovs-dev] [PATCH 1/2] checkpatch: Add explicit test for mailing list as author.

2018-11-02 Thread Yifeng Sun
Looks good to me, thanks. Reviewed-by: Yifeng Sun On Thu, Nov 1, 2018 at 8:06 AM Ben Pfaff wrote: > Somehow some such patches snuck through. checkpatch caught them (and the > committer missed that) but this makes it even more explicit. > > Signed-off-by: Ben Pfaff &g

Re: [ovs-dev] [PATCH 2/2] checkpatch: Speed up checking when spell checking not enabled.

2018-11-02 Thread Yifeng Sun
Looks good to me, thanks. Reviewed-by: Yifeng Sun On Thu, Nov 1, 2018 at 8:07 AM Ben Pfaff wrote: > On my machine it takes almost a second for enchant to read its dictionary. > This time is wasted when spell checking is not enabled. This commit makes > checkpatch read the dictio

Re: [ovs-dev] [PATCH v3] ovn-nbctl: Fix the ovn-nbctl test "LBs - daemon" which fails during rpm build

2018-11-02 Thread Yifeng Sun
good to you? Thanks, Yifeng On Fri, Nov 2, 2018 at 1:21 PM Ben Pfaff wrote: > On Fri, Nov 02, 2018 at 04:05:13PM -0400, Mark Michelson wrote: > > On 11/01/2018 02:15 PM, Yifeng Sun wrote: > > >Hi Mark, > > > > > >Thanks a lot for the information, that is

[ovs-dev] [PATCH] dns-resolve: Stop dns resolving when dns servers are configured.

2018-11-05 Thread Yifeng Sun
DNS resolution should fail if no DNS servers are available. This patch fixes it and also enables users to use environment variable OVS_RESOLV_CONF to specify the path for DNS server configuration file. Suggested-by: Ben Pfaff Suggested-by: Mark Michelson Signed-off-by: Yifeng Sun --- lib/dns

Re: [ovs-dev] [PATCH] dns-resolve: Stop dns resolving when dns servers are configured.

2018-11-06 Thread Yifeng Sun
On Mon, Nov 5, 2018 at 7:58 PM Ben Pfaff wrote: > [CCing Alin for his opinion on Windows issue] > > On Mon, Nov 05, 2018 at 04:20:18PM -0800, Yifeng Sun wrote: > > DNS resolution should fail if no DNS servers are available. This > > patch fixes it and also enables use

Re: [ovs-dev] [PATCH] dns-resolve: Stop dns resolving when dns servers are configured.

2018-11-06 Thread Yifeng Sun
Sure, will do. Thanks for the comments. Best, Yifeng On Tue, Nov 6, 2018 at 10:04 AM Ben Pfaff wrote: > On Tue, Nov 06, 2018 at 09:48:36AM -0800, Yifeng Sun wrote: > > On Mon, Nov 5, 2018 at 7:58 PM Ben Pfaff wrote: > > > > > [CCing Alin for his opinion on Windows i

[ovs-dev] [PATCH] actions: Enforce a maximum limit for nested action depth

2018-11-07 Thread Yifeng Sun
If nested depth of actions is too deep, then the stack will be overflown and ovs-vswitch crashes. This patch prevents this by adding a depth limit to nested actions. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11237 Signed-off-by: Yifeng Sun --- ovn/lib/actions.c | 9

[ovs-dev] [PATCH] ofctl_parse_target: Avoid passing invalid ofputil_protocol to ofputil_protocol_to_ofp_version

2018-11-07 Thread Yifeng Sun
In this test, the involved ovs functions expect valid ofputil_protocol values. Therefore, if usable_protocols is invalid, we should return. Otherwise, ovs will abort. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11165 Signed-off-by: Yifeng Sun --- tests/oss-fuzz

[ovs-dev] [PATCH] odp-util: Set a limit for nested parse_odp_key_mask_attr call

2018-11-07 Thread Yifeng Sun
-off-by: Yifeng Sun --- lib/odp-util.c | 36 +--- tests/odp.at | 9 + 2 files changed, 38 insertions(+), 7 deletions(-) diff --git a/lib/odp-util.c b/lib/odp-util.c index f50de7fd275c..627baaa397ed 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -57,8

[ovs-dev] [PATCH 1/2] dns-resolve: Stop dns resolving if no DNS server configured

2018-11-07 Thread Yifeng Sun
DNS resolution should fail if no DNS servers are available. This patch fixes it. Suggested-by: Ben Pfaff Suggested-by: Mark Michelson Signed-off-by: Yifeng Sun --- lib/dns-resolve.c | 9 + 1 file changed, 9 insertions(+) diff --git a/lib/dns-resolve.c b/lib/dns-resolve.c index

[ovs-dev] [PATCH 2/2] dns-resolve: Improve on handling of system DNS nameserver

2018-11-07 Thread Yifeng Sun
. Suggested-by: Ben Pfaff Suggested-by: Mark Michelson Signed-off-by: Yifeng Sun --- Documentation/intro/install/general.rst | 2 ++ NEWS| 2 ++ lib/dns-resolve.c | 16 +++- 3 files changed, 15 insertions(+), 5 deletions

Re: [ovs-dev] [PATCH] docs: Fix cross-references that referred to discussions that have moved.

2018-11-12 Thread Yifeng Sun
Looks good to me, thanks. Reviewed-by: Yifeng Sun On Thu, Nov 8, 2018 at 9:39 PM Ben Pfaff wrote: > Signed-off-by: Ben Pfaff > --- > include/openvswitch/meta-flow.h | 4 ++-- > ovn/utilities/ovn-sbctl.8.in| 2 +- > ovn/utilities/ovn-trace.8.xml | 2 +- > vs

Re: [ovs-dev] [PATCH] pcap-file: Add support for Linux SLL formatted PCAP files.

2018-11-12 Thread Yifeng Sun
Looks good to me, thanks. Reviewed-by: Yifeng Sun On Sun, Nov 11, 2018 at 3:41 PM Ben Pfaff wrote: > Someone sent me one of these and OVS couldn't read it. This fixes the > problem. > > Signed-off-by: Ben Pfaff > --- >

[ovs-dev] [PATCH] odp-util: Add checking to prevent buffer overflow when parsing push_nsh

2018-11-13 Thread Yifeng Sun
Previously, the buffer size of 'struct ofpbuf b' is less than the size of 'char buf[512]', this could cause memory overflow of ofpbuf when calling ofpbuf_put_hex. This patch fixes it. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10865 Signed-off-by: Yife

[ovs-dev] [PATCH] oss-fuzz: Fix memory leak in ofctl_parse_flow

2018-11-14 Thread Yifeng Sun
If parse_ofp_flow_mod_str returns no error, ofputil_flow_mod.match contains allocated memory that should be free. This patch fixes it. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11343 Signed-off-by: Yifeng Sun --- tests/oss-fuzz/ofctl_parse_target.c | 1 + 1 file changed

Re: [ovs-dev] [PATCH 2/3] ovsdb-idlc: Fix memory leak reported by Coverity.

2020-05-09 Thread Yifeng Sun
Looks good to me, thanks. Reviewed-by: Yifeng Sun On Sat, May 2, 2020 at 10:29 AM William Tu wrote: > An exmplae pattern shown below: > void > ovsrec_ct_zone_index_set_external_ids(const struct ovsrec_ct_zone... > { > // 1. alloc_fn: Storage is returned from allocation f

Re: [ovs-dev] [PATCH 3/3] ovsdb-idl: Fix NULL deref reported by Coverity.

2020-05-09 Thread Yifeng Sun
(ovsdb_atom_needs_destruction(type)) { Reviewed-by: Yifeng Sun Yifeng On Sat, May 2, 2020 at 10:29 AM William Tu wrote: > When 'datum.values' or 'datum.keys' is NULL, some code path calling > into ovsdb_idl_txn_write__ triggers NULL deref. An example is below: > > ovsre

Re: [ovs-dev] [PATCH 1/3] ovsdb-idlc: Fix memory leak reported by Coverity.

2020-05-09 Thread Yifeng Sun
Looks good to me, thanks. Reviewed-by: Yifeng Sun On Sat, May 2, 2020 at 10:29 AM William Tu wrote: > Coverity shows the following memory leak in this code pattern: > > void > ovsrec_ipfix_index_set_obs_domain_id( > { > struct ovsdb_datum datum; > // 1. alloc_fn

Re: [ovs-dev] [PATCH 2/2] oss-fuzz: Fix miniflow_target.c.

2020-05-12 Thread Yifeng Sun
LGTM, thanks. Reviewed-by: Yifeng Sun On Tue, May 12, 2020 at 8:23 AM William Tu wrote: > Clang reports: > tests/oss-fuzz/miniflow_target.c:209:26: error: suggest braces around \ > initialization of subobject > [-Werror,-Wmissing-braces] > struct flow flow2 =

Re: [ovs-dev] [PATCHv2] ovsdb-idl: Fix NULL deref reported by Coverity.

2020-05-18 Thread Yifeng Sun
Thanks William. Reviewed-by: Yifeng Sun On Fri, May 15, 2020 at 6:47 AM William Tu wrote: > When 'datum.values' or 'datum.keys' is NULL, some code path calling > into ovsdb_idl_txn_write__ triggers NULL deref. > > An example: > ovsrec_open_vswitch_set_cur_c

[ovs-dev] [PATCH] bfd: Support overlay BFD

2020-06-24 Thread Yifeng Sun
for forwarding. This patch keeps BFD's backward compatibility. Signed-off-by: Yifeng Sun --- lib/bfd.c| 16 +--- vswitchd/vswitch.xml | 7 +++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/lib/bfd.c b/lib/bfd.c index cc8c6857afa4..3c965699ace3 1

Re: [ovs-dev] [PATCH] bfd: Support overlay BFD

2020-06-27 Thread Yifeng Sun
Thanks for the review. Please check my inline comments. Will fix them in v2. Yifeng On Sat, Jun 27, 2020 at 3:07 PM William Tu wrote: > Thanks for the patch. > > On Wed, Jun 24, 2020 at 1:58 PM Yifeng Sun wrote: > > > > Current OVS intercepts and processes all BFD

[ovs-dev] [PATCH] rhel: Fix ovs-kmod-manage.sh that may create invalid soft links

2019-11-18 Thread Yifeng Sun
Current code iterates every kernel under '/lib/modules' for a matched version. As a result, this script may create invalid soft links if the matched kernel doesn't have openvswitch-kmod RPM installed. This patch fixes it. VMWare-BZ: #2257534 Signed-off-by: Yifeng

Re: [ovs-dev] [PATCH] rhel: Fix ovs-kmod-manage.sh that may create invalid soft links

2019-11-18 Thread Yifeng Sun
Will do, thanks! On Mon, Nov 18, 2019 at 11:35 AM Yi-Hung Wei wrote: > > On Mon, Nov 18, 2019 at 11:24 AM Yifeng Sun wrote: > > > > Current code iterates every kernel under '/lib/modules' for a matched > > version. As a result, this script may create invalid so

[ovs-dev] [PATCH v2] rhel: Fix ovs-kmod-manage.sh that may create invalid soft links

2019-11-18 Thread Yifeng Sun
kernel in kmod build with mulitple versions, fedora") Signed-off-by: Yifeng Sun --- v1->v2: Added fix tag, thanks YiHung. rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rhel/usr_share_openvswitch_script

Re: [ovs-dev] [PATCH] rhel: Support RHEL7.7 build and packaging

2019-12-02 Thread Yifeng Sun
Thanks Ben. Can you please backport this patch to 2.12? Yifeng On Thu, Oct 24, 2019 at 3:12 PM Ben Pfaff wrote: > > On Fri, Oct 11, 2019 at 02:49:14PM -0700, Yifeng Sun wrote: > > This patch provides essential fixes for OVS to support > > RHEL7.7's new kernel. >

Re: [ovs-dev] [PATCH] rhel: Support RHEL7.7 build and packaging

2019-12-02 Thread Yifeng Sun
Thanks. On Mon, Dec 2, 2019 at 10:42 AM Ben Pfaff wrote: > > Done. > > On Mon, Dec 02, 2019 at 09:15:03AM -0800, Yifeng Sun wrote: > > Thanks Ben. Can you please backport this patch to 2.12? > > > > Yifeng > > > > On Thu, Oct 24, 2019 at 3:12 PM Ben Pfaf

Re: [ovs-dev] [PATCH] rhel: Support RHEL 7.8 kernel module rpm build

2019-12-06 Thread Yifeng Sun
Looks good to me, thanks YiHung. Reviewed-by: Yifeng Sun On Wed, Dec 4, 2019 at 5:22 PM Yi-Hung Wei wrote: > > This patch supports RHEL 7.8 kernel module rpm package building. > > $ make rpm-fedora-kmod \ > RPMBUILD_OPT='-D "kversion 3.10.0-1101.el7.x86_64"&#

<    1   2   3   4   5   6   >