Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debian: Initial packaging for OVN #36

Closed
wants to merge 1 commit into from

Conversation

javacruft
Copy link
Contributor

Update debian packaging folder based on packaging work
completed in Ubuntu.

@numansiddique
Copy link
Collaborator

@javacruft Thanks for the PR.

The build is failing for me locally (and probably in travis CI too) with the below errors. Can you please check it. If you can submit the patch to the ovs-dev ML that would be great. No worries otherwise.


/bin/sh /home/nusiddiq/workspace_cpp/ovn-org/ovn-for-reviews/ovn/build-aux/missing autom4te --language=autotest -I '..' -o ../tests/system-kmod-testsuite.tmp ../tests/system-kmod-testsuite.at
/bin/sh /home/nusiddiq/workspace_cpp/ovn-org/ovn-for-reviews/ovn/build-aux/missing autom4te --language=autotest -I '..' -o ../tests/system-userspace-testsuite.tmp ../tests/system-userspace-testsuite.at
The following files are in git but not the distribution:
debian/ovn-ic-db.install
debian/ovn-ic-db.manpages
debian/ovn-ic-db.ovn-ovsdb-server-ic-nb.service
debian/ovn-ic-db.ovn-ovsdb-server-ic-sb.service
debian/ovn-ic-db.service
debian/ovn-ic.install
debian/ovn-ic.manpages
debian/ovn-ic.service
make[1]: *** [Makefile:2909: dist-hook-git] Error 1
make[1]: *** Waiting for unfinished jobs....
mv ../tests/system-kmod-testsuite.tmp ../tests/system-kmod-testsuite
mv ../tests/system-userspace-testsuite.tmp ../tests/system-userspace-testsuite
mv ../tests/testsuite.tmp ../tests/testsuite
make[1]: Leaving directory '/home/nusiddiq/workspace_cpp/ovn-org/ovn-for-reviews/ovn/_gcc'
make: *** [Makefile:1329: all] Error 2
make: Leaving directory '/home/nusiddiq/workspace_cpp/ovn-org/ovn-for-reviews/ovn/_gcc'


@javacruft
Copy link
Contributor Author

I might try to change the way the automake inclusions work - there is really no need to include all of the files in the debian directory in the way its done today. However I think as an initial set of Debian packaging this is good to go. It does require an openvswitch-source package that we produce from the openvswitch packaging in Ubuntu - I'll also be raising a PR for OVS for that work.

@numansiddique
Copy link
Collaborator

Could you please provide your Signed-off-by tag ?

After that I'll post the patch to ovs-dev ML to get some comments.
I'm not a debian developer and I've no experience with debian packaging.

Thanks
Numan

Update debian packaging folder based on packaging work
completed in Ubuntu.

Signed-off-by: James Page <james.page@ubuntu.com>
@shettyg
Copy link
Collaborator

shettyg commented Feb 21, 2020

@javacruft Will this be compatible with debian packages that are generated from openvswitch repo? As you know, the ones in openvswitch do not have systemd.

ovsrobot pushed a commit to ovsrobot/ovn that referenced this pull request Feb 21, 2020
Update debian packaging folder based on packaging work
completed in Ubuntu.

Submitted-at: ovn-org#36
Signed-off-by: James Page <james.page@ubuntu.com>
Signed-off-by: Numan Siddique <numans@ovn.org>
Signed-off-by: 0-day Robot <robot@bytheb.org>
@javacruft
Copy link
Contributor Author

@javacruft Will this be compatible with debian packages that are generated from openvswitch repo? As you know, the ones in openvswitch do not have systemd.

Not yet - I made some changes in Ubuntu specifically:

  • addition of the openvswitch-source package to support the OVN build
  • move of the ovsdb-server and ovsdb-tool binaries into openvswitch-common to avoid a dependency from ovn-* to openvswitch-switch

I'll raise a separate change to support that this week.

@shettyg
Copy link
Collaborator

shettyg commented Feb 24, 2020

Not yet - I made some changes in Ubuntu specifically:

addition of the openvswitch-source package to support the OVN build
move of the ovsdb-server and ovsdb-tool binaries into openvswitch-common to avoid a dependency from ovn-* to openvswitch-switch
I'll raise a separate change to support that this week.

@javacruft Any changes to OVS debian packages should support upgrades from previous versions.

@fnordahl
Copy link
Member

@javacruft Will this be compatible with debian packages that are generated from openvswitch repo? As you know, the ones in openvswitch do not have systemd.

I'm not quite sure what you are aiming at here @shettyg. The traditional System V init scripts that currently ship with Open vSwitch will on both Debian and Ubuntu automatically get a entry point from systemd with help from systemd-sysv-generator.

For OVN the existing System V init scripts do not cut it for deploying OVN with clustered OVSDB servers and TLS enabled with spread placement of databases to name one thing. A side effect of providing configuration for ovn-northd is that databases will no longer be started at all

Instead of relying on external tools to provide magic to connect the aging System V scripts to the current world order, we are leveraging the power available in current tooling to enable you to make the most of the wonderful things the communities of Open vSwitch and Open Virtual Network projects produce every day.

@shettyg
Copy link
Collaborator

shettyg commented Feb 24, 2020

@fnordahl

It is perfectly fine to use systemd for OVN. Just that, it has to be tested with debian packages generated from OVS repo and not the debian packages that Ubuntu upstream creates for OVS. In the past, when I have tested the debian packages created by Ubuntu upstream (which is different than what OVS repo has), there were a few bugs. For e.g., it would not work with OVS integration with ifupdown. We had to put the following in OVS sysV scripts to make sure that the features work.

_SYSTEMCTL_SKIP_REDIRECT=yes
SYSTEMCTL_SKIP_REDIRECT=yes

@shettyg
Copy link
Collaborator

shettyg commented Feb 24, 2020

It is also fine to invest time to move debian packages in OVS repo to move to systemd too -if that is a blocker for any reason. (I think the rhel/fedora devs have done a good job with systemd integration and OVS - in OVS repo's rhel directory and a lot of it can be re-used).

@fnordahl
Copy link
Member

@fnordahl

It is perfectly fine to use systemd for OVN. Just that, it has to be tested with debian packages generated from OVS repo and not the debian packages that Ubuntu upstream creates for OVS. In the past, when I have tested the debian packages created by Ubuntu upstream (which is different than what OVS repo has), there were a few bugs. For e.g., it would not work with OVS integration with ifupdown. We had to put the following in OVS sysV scripts to make sure that the features work.

_SYSTEMCTL_SKIP_REDIRECT=yes
SYSTEMCTL_SKIP_REDIRECT=yes

We would love to hear all about it.

It is also fine to invest time to move debian packages in OVS repo to move to systemd too -if that is a blocker for any reason. (I think the rhel/fedora devs have done a good job with systemd integration and OVS - in OVS repo's rhel directory and a lot of it can be re-used).

The Ubuntu packages already have systemd units, and this endeavor is all about upstreaming that. I'm sure we have shared notes with our friends at Fedora already, that's what this OSS thing is all about :)

@javacruft
Copy link
Contributor Author

Not yet - I made some changes in Ubuntu specifically:

addition of the openvswitch-source package to support the OVN build
move of the ovsdb-server and ovsdb-tool binaries into openvswitch-common to avoid a dependency from ovn-* to openvswitch-switch
I'll raise a separate change to support that this week.

@javacruft Any changes to OVS debian packages should support upgrades from previous versions.

Absolutely and something I'm always aware of - any proposed changes would support in-place upgrades of existing deployments without having to uninstall first. The moves are fairly simple and just required a few Breaks/Replaces on the impacted binary packages.

@javacruft
Copy link
Contributor Author

It is also fine to invest time to move debian packages in OVS repo to move to systemd too -if that is a blocker for any reason. (I think the rhel/fedora devs have done a good job with systemd integration and OVS - in OVS repo's rhel directory and a lot of it can be re-used).

ifupdown is one consideration here - later Ubuntu versions don't use ifupdown by default but netplan lacks OVS support (there is work happening in that area but its not ready yet) so it does present a bit of a gap compared to older releases so I'd prefer to split any systemd work from updates to the OVS repo to support OVN packaging which I think is entirely sensible.

@numansiddique
Copy link
Collaborator

What's the status of this PR ?

Does it needs more work or we can merge it ?

Thanks

--localstatedir=/var \
--sysconfdir=/etc \
--with-dbdir=/var/lib/ovn \
--with-ovs-source=$(CURDIR)/ovs \
Copy link
Contributor

Choose a reason for hiding this comment

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

Previous varian was more flexible, I think, it will be better to use $(DATAPATH_CONFIGURE_OPTS) for parameters defining

RUN DATADIR="/usr/share/ovn" \
    DATAPATH_CONFIGURE_OPTS="--with-ovs-source=${OVS_SRC} --with-ovs-build=${OVS_SRC}" \
    DEB_BUILD_OPTIONS="parallel=8 nocheck" \
    fakeroot debian/rules binary

@numansiddique
Copy link
Collaborator

This PR is inactive since a long time. Closing it. Feel free to reopen it if it is still valid.

Thanks
Numan

LorenzoBianconi added a commit to LorenzoBianconi/ovn that referenced this pull request Apr 15, 2022
Avoid the following crash in ovn-trace due to a reject action infinite
loop:

AddressSanitizer:DEADLYSIGNAL
==569410==ERROR: AddressSanitizer: stack-overflow on address 0x7ffc0a991bc4 (pc 0x000000415081 bp 0x7ffc0a993fa0 sp 0x7ffc0a991b30 T0)
    #0 0x415081 in trace_actions utilities/ovn-trace.c:2617
    ovn-org#1 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    ovn-org#2 0x41d878 in trace__ utilities/ovn-trace.c:3007
    ovn-org#3 0x41e3a8 in execute_output utilities/ovn-trace.c:1700
    ovn-org#4 0x416fcf in trace_actions utilities/ovn-trace.c:2640
    ovn-org#5 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    ovn-org#6 0x41d878 in trace__ utilities/ovn-trace.c:3007
    ovn-org#7 0x41788d in execute_next utilities/ovn-trace.c:2307
    ovn-org#8 0x41788d in trace_actions utilities/ovn-trace.c:2644
    ovn-org#9 0x41a7c0 in trace_actions utilities/ovn-trace.c:2622
    ovn-org#10 0x41a7c0 in execute_sctp4_abort utilities/ovn-trace.c:1985
    ovn-org#11 0x419671 in execute_reject utilities/ovn-trace.c:2049
    ovn-org#12 0x419671 in trace_actions utilities/ovn-trace.c:2860
    ovn-org#13 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    ovn-org#14 0x41d878 in trace__ utilities/ovn-trace.c:3007
    ovn-org#15 0x41e3a8 in execute_output utilities/ovn-trace.c:1700
    ovn-org#16 0x416fcf in trace_actions utilities/ovn-trace.c:2640
    ovn-org#17 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    ovn-org#18 0x41d878 in trace__ utilities/ovn-trace.c:3007
    ovn-org#19 0x41788d in execute_next utilities/ovn-trace.c:2307
    ovn-org#20 0x41788d in trace_actions utilities/ovn-trace.c:2644
    ovn-org#21 0x41a7c0 in trace_actions utilities/ovn-trace.c:2622
    ovn-org#22 0x41a7c0 in execute_sctp4_abort utilities/ovn-trace.c:1985
    ovn-org#23 0x419671 in execute_reject utilities/ovn-trace.c:2049
    ovn-org#24 0x419671 in trace_actions utilities/ovn-trace.c:2860
    ovn-org#25 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    ovn-org#26 0x41d878 in trace__ utilities/ovn-trace.c:3007
    ovn-org#27 0x41e3a8 in execute_output utilities/ovn-trace.c:1700
    ovn-org#28 0x416fcf in trace_actions utilities/ovn-trace.c:2640
    ovn-org#29 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    ovn-org#30 0x41d878 in trace__ utilities/ovn-trace.c:3007
    ovn-org#31 0x41788d in execute_next utilities/ovn-trace.c:2307
    ovn-org#32 0x41788d in trace_actions utilities/ovn-trace.c:2644
    ovn-org#33 0x41a7c0 in trace_actions utilities/ovn-trace.c:2622
    ovn-org#34 0x41a7c0 in execute_sctp4_abort utilities/ovn-trace.c:1985
    ovn-org#35 0x419671 in execute_reject utilities/ovn-trace.c:2049
    ovn-org#36 0x419671 in trace_actions utilities/ovn-trace.c:2860
    ovn-org#37 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    ovn-org#38 0x41d878 in trace__ utilities/ovn-trace.c:3007
    ovn-org#39 0x41e3a8 in execute_output utilities/ovn-trace.c:1700
    ovn-org#40 0x416fcf in trace_actions utilities/ovn-trace.c:2640
    ovn-org#41 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    ovn-org#42 0x41d878 in trace__ utilities/ovn-trace.c:3007
    ovn-org#43 0x41788d in execute_next utilities/ovn-trace.c:2307
    ....

The issue can be triggered with the following reproducer:

$ovn-nbctl ls-add sw
$ovn-nbctl lsp-add sw p1
$ovn-nbctl lsp-set-addresses p1 "00:00:00:00:00:02 192.168.0.2"
$ovn-nbctl lsp-add sw p2
$ovn-nbctl lsp-set-addresses p2 "00:00:00:00:00:03 192.168.0.3"
$ovn-nbctl pg-add pg1 p1 p2
$ovn-nbctl acl-add pg1 to-lport 2003 "inport==@pg1 && ip4 && ip4.src == 192.168.0.0/16 && udp && udp.dst == 9000" allow
$ovn-nbctl acl-add pg1 to-lport 2001 "inport==@pg1" reject
$ovn-trace 'inport == "p2" && eth.src == 00:00:00:00:00:03 && eth.dst == 00:00:00:00:00:02 && ip.ttl==42 && ip4.src == 192.168.0.3'

Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=2074537
ovsrobot pushed a commit to ovsrobot/ovn that referenced this pull request Apr 15, 2022
Avoid the following crash in ovn-trace due to a reject action infinite
loop:

AddressSanitizer:DEADLYSIGNAL
==569410==ERROR: AddressSanitizer: stack-overflow on address 0x7ffc0a991bc4 (pc 0x000000415081 bp 0x7ffc0a993fa0 sp 0x7ffc0a991b30 T0)
    #0 0x415081 in trace_actions utilities/ovn-trace.c:2617
    ovn-org#1 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    ovn-org#2 0x41d878 in trace__ utilities/ovn-trace.c:3007
    ovn-org#3 0x41e3a8 in execute_output utilities/ovn-trace.c:1700
    ovn-org#4 0x416fcf in trace_actions utilities/ovn-trace.c:2640
    ovn-org#5 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    ovn-org#6 0x41d878 in trace__ utilities/ovn-trace.c:3007
    ovn-org#7 0x41788d in execute_next utilities/ovn-trace.c:2307
    ovn-org#8 0x41788d in trace_actions utilities/ovn-trace.c:2644
    ovn-org#9 0x41a7c0 in trace_actions utilities/ovn-trace.c:2622
    ovn-org#10 0x41a7c0 in execute_sctp4_abort utilities/ovn-trace.c:1985
    ovn-org#11 0x419671 in execute_reject utilities/ovn-trace.c:2049
    ovn-org#12 0x419671 in trace_actions utilities/ovn-trace.c:2860
    ovn-org#13 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    ovn-org#14 0x41d878 in trace__ utilities/ovn-trace.c:3007
    ovn-org#15 0x41e3a8 in execute_output utilities/ovn-trace.c:1700
    ovn-org#16 0x416fcf in trace_actions utilities/ovn-trace.c:2640
    ovn-org#17 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    ovn-org#18 0x41d878 in trace__ utilities/ovn-trace.c:3007
    ovn-org#19 0x41788d in execute_next utilities/ovn-trace.c:2307
    ovn-org#20 0x41788d in trace_actions utilities/ovn-trace.c:2644
    ovn-org#21 0x41a7c0 in trace_actions utilities/ovn-trace.c:2622
    ovn-org#22 0x41a7c0 in execute_sctp4_abort utilities/ovn-trace.c:1985
    ovn-org#23 0x419671 in execute_reject utilities/ovn-trace.c:2049
    ovn-org#24 0x419671 in trace_actions utilities/ovn-trace.c:2860
    ovn-org#25 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    ovn-org#26 0x41d878 in trace__ utilities/ovn-trace.c:3007
    ovn-org#27 0x41e3a8 in execute_output utilities/ovn-trace.c:1700
    ovn-org#28 0x416fcf in trace_actions utilities/ovn-trace.c:2640
    ovn-org#29 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    ovn-org#30 0x41d878 in trace__ utilities/ovn-trace.c:3007
    ovn-org#31 0x41788d in execute_next utilities/ovn-trace.c:2307
    ovn-org#32 0x41788d in trace_actions utilities/ovn-trace.c:2644
    ovn-org#33 0x41a7c0 in trace_actions utilities/ovn-trace.c:2622
    ovn-org#34 0x41a7c0 in execute_sctp4_abort utilities/ovn-trace.c:1985
    ovn-org#35 0x419671 in execute_reject utilities/ovn-trace.c:2049
    ovn-org#36 0x419671 in trace_actions utilities/ovn-trace.c:2860
    ovn-org#37 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    ovn-org#38 0x41d878 in trace__ utilities/ovn-trace.c:3007
    ovn-org#39 0x41e3a8 in execute_output utilities/ovn-trace.c:1700
    ovn-org#40 0x416fcf in trace_actions utilities/ovn-trace.c:2640
    ovn-org#41 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    ovn-org#42 0x41d878 in trace__ utilities/ovn-trace.c:3007
    ovn-org#43 0x41788d in execute_next utilities/ovn-trace.c:2307
    ....

The issue can be triggered with the following reproducer:

$ovn-nbctl ls-add sw
$ovn-nbctl lsp-add sw p1
$ovn-nbctl lsp-set-addresses p1 "00:00:00:00:00:02 192.168.0.2"
$ovn-nbctl lsp-add sw p2
$ovn-nbctl lsp-set-addresses p2 "00:00:00:00:00:03 192.168.0.3"
$ovn-nbctl pg-add pg1 p1 p2
$ovn-nbctl acl-add pg1 to-lport 2003 "inport==@pg1 && ip4 && ip4.src == 192.168.0.0/16 && udp && udp.dst == 9000" allow
$ovn-nbctl acl-add pg1 to-lport 2001 "inport==@pg1" reject
$ovn-trace 'inport == "p2" && eth.src == 00:00:00:00:00:03 && eth.dst == 00:00:00:00:00:02 && ip.ttl==42 && ip4.src == 192.168.0.3'

Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=2074537
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: 0-day Robot <robot@bytheb.org>
putnopvut pushed a commit that referenced this pull request May 10, 2022
Avoid the following crash in ovn-trace due to a reject action infinite
loop:

AddressSanitizer:DEADLYSIGNAL
==569410==ERROR: AddressSanitizer: stack-overflow on address 0x7ffc0a991bc4 (pc 0x000000415081 bp 0x7ffc0a993fa0 sp 0x7ffc0a991b30 T0)
    #0 0x415081 in trace_actions utilities/ovn-trace.c:2617
    #1 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    #2 0x41d878 in trace__ utilities/ovn-trace.c:3007
    #3 0x41e3a8 in execute_output utilities/ovn-trace.c:1700
    #4 0x416fcf in trace_actions utilities/ovn-trace.c:2640
    #5 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    #6 0x41d878 in trace__ utilities/ovn-trace.c:3007
    #7 0x41788d in execute_next utilities/ovn-trace.c:2307
    #8 0x41788d in trace_actions utilities/ovn-trace.c:2644
    #9 0x41a7c0 in trace_actions utilities/ovn-trace.c:2622
    #10 0x41a7c0 in execute_sctp4_abort utilities/ovn-trace.c:1985
    #11 0x419671 in execute_reject utilities/ovn-trace.c:2049
    #12 0x419671 in trace_actions utilities/ovn-trace.c:2860
    #13 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    #14 0x41d878 in trace__ utilities/ovn-trace.c:3007
    #15 0x41e3a8 in execute_output utilities/ovn-trace.c:1700
    #16 0x416fcf in trace_actions utilities/ovn-trace.c:2640
    #17 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    #18 0x41d878 in trace__ utilities/ovn-trace.c:3007
    #19 0x41788d in execute_next utilities/ovn-trace.c:2307
    #20 0x41788d in trace_actions utilities/ovn-trace.c:2644
    #21 0x41a7c0 in trace_actions utilities/ovn-trace.c:2622
    #22 0x41a7c0 in execute_sctp4_abort utilities/ovn-trace.c:1985
    #23 0x419671 in execute_reject utilities/ovn-trace.c:2049
    #24 0x419671 in trace_actions utilities/ovn-trace.c:2860
    #25 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    #26 0x41d878 in trace__ utilities/ovn-trace.c:3007
    #27 0x41e3a8 in execute_output utilities/ovn-trace.c:1700
    #28 0x416fcf in trace_actions utilities/ovn-trace.c:2640
    #29 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    #30 0x41d878 in trace__ utilities/ovn-trace.c:3007
    #31 0x41788d in execute_next utilities/ovn-trace.c:2307
    #32 0x41788d in trace_actions utilities/ovn-trace.c:2644
    #33 0x41a7c0 in trace_actions utilities/ovn-trace.c:2622
    #34 0x41a7c0 in execute_sctp4_abort utilities/ovn-trace.c:1985
    #35 0x419671 in execute_reject utilities/ovn-trace.c:2049
    #36 0x419671 in trace_actions utilities/ovn-trace.c:2860
    #37 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    #38 0x41d878 in trace__ utilities/ovn-trace.c:3007
    #39 0x41e3a8 in execute_output utilities/ovn-trace.c:1700
    #40 0x416fcf in trace_actions utilities/ovn-trace.c:2640
    #41 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    #42 0x41d878 in trace__ utilities/ovn-trace.c:3007
    #43 0x41788d in execute_next utilities/ovn-trace.c:2307
    ....

The issue can be triggered with the following reproducer:

$ovn-nbctl ls-add sw
$ovn-nbctl lsp-add sw p1
$ovn-nbctl lsp-set-addresses p1 "00:00:00:00:00:02 192.168.0.2"
$ovn-nbctl lsp-add sw p2
$ovn-nbctl lsp-set-addresses p2 "00:00:00:00:00:03 192.168.0.3"
$ovn-nbctl pg-add pg1 p1 p2
$ovn-nbctl acl-add pg1 to-lport 2003 "inport==@pg1 && ip4 && ip4.src == 192.168.0.0/16 && udp && udp.dst == 9000" allow
$ovn-nbctl acl-add pg1 to-lport 2001 "inport==@pg1" reject
$ovn-trace 'inport == "p2" && eth.src == 00:00:00:00:00:03 && eth.dst == 00:00:00:00:00:02 && ip.ttl==42 && ip4.src == 192.168.0.3'

Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=2074537
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Acked-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Mark Michelson <mmichels@redhat.com>
putnopvut pushed a commit that referenced this pull request May 10, 2022
Avoid the following crash in ovn-trace due to a reject action infinite
loop:

AddressSanitizer:DEADLYSIGNAL
==569410==ERROR: AddressSanitizer: stack-overflow on address 0x7ffc0a991bc4 (pc 0x000000415081 bp 0x7ffc0a993fa0 sp 0x7ffc0a991b30 T0)
    #0 0x415081 in trace_actions utilities/ovn-trace.c:2617
    #1 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    #2 0x41d878 in trace__ utilities/ovn-trace.c:3007
    #3 0x41e3a8 in execute_output utilities/ovn-trace.c:1700
    #4 0x416fcf in trace_actions utilities/ovn-trace.c:2640
    #5 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    #6 0x41d878 in trace__ utilities/ovn-trace.c:3007
    #7 0x41788d in execute_next utilities/ovn-trace.c:2307
    #8 0x41788d in trace_actions utilities/ovn-trace.c:2644
    #9 0x41a7c0 in trace_actions utilities/ovn-trace.c:2622
    #10 0x41a7c0 in execute_sctp4_abort utilities/ovn-trace.c:1985
    #11 0x419671 in execute_reject utilities/ovn-trace.c:2049
    #12 0x419671 in trace_actions utilities/ovn-trace.c:2860
    #13 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    #14 0x41d878 in trace__ utilities/ovn-trace.c:3007
    #15 0x41e3a8 in execute_output utilities/ovn-trace.c:1700
    #16 0x416fcf in trace_actions utilities/ovn-trace.c:2640
    #17 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    #18 0x41d878 in trace__ utilities/ovn-trace.c:3007
    #19 0x41788d in execute_next utilities/ovn-trace.c:2307
    #20 0x41788d in trace_actions utilities/ovn-trace.c:2644
    #21 0x41a7c0 in trace_actions utilities/ovn-trace.c:2622
    #22 0x41a7c0 in execute_sctp4_abort utilities/ovn-trace.c:1985
    #23 0x419671 in execute_reject utilities/ovn-trace.c:2049
    #24 0x419671 in trace_actions utilities/ovn-trace.c:2860
    #25 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    #26 0x41d878 in trace__ utilities/ovn-trace.c:3007
    #27 0x41e3a8 in execute_output utilities/ovn-trace.c:1700
    #28 0x416fcf in trace_actions utilities/ovn-trace.c:2640
    #29 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    #30 0x41d878 in trace__ utilities/ovn-trace.c:3007
    #31 0x41788d in execute_next utilities/ovn-trace.c:2307
    #32 0x41788d in trace_actions utilities/ovn-trace.c:2644
    #33 0x41a7c0 in trace_actions utilities/ovn-trace.c:2622
    #34 0x41a7c0 in execute_sctp4_abort utilities/ovn-trace.c:1985
    #35 0x419671 in execute_reject utilities/ovn-trace.c:2049
    #36 0x419671 in trace_actions utilities/ovn-trace.c:2860
    #37 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    #38 0x41d878 in trace__ utilities/ovn-trace.c:3007
    #39 0x41e3a8 in execute_output utilities/ovn-trace.c:1700
    #40 0x416fcf in trace_actions utilities/ovn-trace.c:2640
    #41 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    #42 0x41d878 in trace__ utilities/ovn-trace.c:3007
    #43 0x41788d in execute_next utilities/ovn-trace.c:2307
    ....

The issue can be triggered with the following reproducer:

$ovn-nbctl ls-add sw
$ovn-nbctl lsp-add sw p1
$ovn-nbctl lsp-set-addresses p1 "00:00:00:00:00:02 192.168.0.2"
$ovn-nbctl lsp-add sw p2
$ovn-nbctl lsp-set-addresses p2 "00:00:00:00:00:03 192.168.0.3"
$ovn-nbctl pg-add pg1 p1 p2
$ovn-nbctl acl-add pg1 to-lport 2003 "inport==@pg1 && ip4 && ip4.src == 192.168.0.0/16 && udp && udp.dst == 9000" allow
$ovn-nbctl acl-add pg1 to-lport 2001 "inport==@pg1" reject
$ovn-trace 'inport == "p2" && eth.src == 00:00:00:00:00:03 && eth.dst == 00:00:00:00:00:02 && ip.ttl==42 && ip4.src == 192.168.0.3'

Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=2074537
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Acked-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Mark Michelson <mmichels@redhat.com>
putnopvut pushed a commit that referenced this pull request May 10, 2022
Avoid the following crash in ovn-trace due to a reject action infinite
loop:

AddressSanitizer:DEADLYSIGNAL
==569410==ERROR: AddressSanitizer: stack-overflow on address 0x7ffc0a991bc4 (pc 0x000000415081 bp 0x7ffc0a993fa0 sp 0x7ffc0a991b30 T0)
    #0 0x415081 in trace_actions utilities/ovn-trace.c:2617
    #1 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    #2 0x41d878 in trace__ utilities/ovn-trace.c:3007
    #3 0x41e3a8 in execute_output utilities/ovn-trace.c:1700
    #4 0x416fcf in trace_actions utilities/ovn-trace.c:2640
    #5 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    #6 0x41d878 in trace__ utilities/ovn-trace.c:3007
    #7 0x41788d in execute_next utilities/ovn-trace.c:2307
    #8 0x41788d in trace_actions utilities/ovn-trace.c:2644
    #9 0x41a7c0 in trace_actions utilities/ovn-trace.c:2622
    #10 0x41a7c0 in execute_sctp4_abort utilities/ovn-trace.c:1985
    #11 0x419671 in execute_reject utilities/ovn-trace.c:2049
    #12 0x419671 in trace_actions utilities/ovn-trace.c:2860
    #13 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    #14 0x41d878 in trace__ utilities/ovn-trace.c:3007
    #15 0x41e3a8 in execute_output utilities/ovn-trace.c:1700
    #16 0x416fcf in trace_actions utilities/ovn-trace.c:2640
    #17 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    #18 0x41d878 in trace__ utilities/ovn-trace.c:3007
    #19 0x41788d in execute_next utilities/ovn-trace.c:2307
    #20 0x41788d in trace_actions utilities/ovn-trace.c:2644
    #21 0x41a7c0 in trace_actions utilities/ovn-trace.c:2622
    #22 0x41a7c0 in execute_sctp4_abort utilities/ovn-trace.c:1985
    #23 0x419671 in execute_reject utilities/ovn-trace.c:2049
    #24 0x419671 in trace_actions utilities/ovn-trace.c:2860
    #25 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    #26 0x41d878 in trace__ utilities/ovn-trace.c:3007
    #27 0x41e3a8 in execute_output utilities/ovn-trace.c:1700
    #28 0x416fcf in trace_actions utilities/ovn-trace.c:2640
    #29 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    #30 0x41d878 in trace__ utilities/ovn-trace.c:3007
    #31 0x41788d in execute_next utilities/ovn-trace.c:2307
    #32 0x41788d in trace_actions utilities/ovn-trace.c:2644
    #33 0x41a7c0 in trace_actions utilities/ovn-trace.c:2622
    #34 0x41a7c0 in execute_sctp4_abort utilities/ovn-trace.c:1985
    #35 0x419671 in execute_reject utilities/ovn-trace.c:2049
    #36 0x419671 in trace_actions utilities/ovn-trace.c:2860
    #37 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    #38 0x41d878 in trace__ utilities/ovn-trace.c:3007
    #39 0x41e3a8 in execute_output utilities/ovn-trace.c:1700
    #40 0x416fcf in trace_actions utilities/ovn-trace.c:2640
    #41 0x41d878 in trace_actions utilities/ovn-trace.c:2622
    #42 0x41d878 in trace__ utilities/ovn-trace.c:3007
    #43 0x41788d in execute_next utilities/ovn-trace.c:2307
    ....

The issue can be triggered with the following reproducer:

$ovn-nbctl ls-add sw
$ovn-nbctl lsp-add sw p1
$ovn-nbctl lsp-set-addresses p1 "00:00:00:00:00:02 192.168.0.2"
$ovn-nbctl lsp-add sw p2
$ovn-nbctl lsp-set-addresses p2 "00:00:00:00:00:03 192.168.0.3"
$ovn-nbctl pg-add pg1 p1 p2
$ovn-nbctl acl-add pg1 to-lport 2003 "inport==@pg1 && ip4 && ip4.src == 192.168.0.0/16 && udp && udp.dst == 9000" allow
$ovn-nbctl acl-add pg1 to-lport 2001 "inport==@pg1" reject
$ovn-trace 'inport == "p2" && eth.src == 00:00:00:00:00:03 && eth.dst == 00:00:00:00:00:02 && ip.ttl==42 && ip4.src == 192.168.0.3'

Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=2074537
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Acked-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Mark Michelson <mmichels@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants