Package: openvswitch-switch-dpdk
Version: 2.15.0+ds1-3
Severity: important

Dear Maintainer,

the current integration of update-alternatives mixes libraries from different 
flavors
that are not ABI compatible. This manifests in a crash when enabling lldp on a 
OVS-DPDK
as the code path traverses functions from libofproto which use a different ABI 
in the
DPDK / non-DPDK build.

There might be other crashes due to this glitch as well, but it's hard to find 
them.
The provided patch makes the libofproto library flavor dependent.

While this patch fixes the update-alternatives, we should question ourselfs if
static linking against internal-only dependencies might be the better approach.
This is how Ubuntu packages it.
Ás we have no easy way to track which library actually changes amoung flavors,
we might run into these issues again in the future.

Best regards,
Felix Moessbauer

-- System Information:
Debian Release: 11.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: armhf, i386, arm64

Kernel: Linux 4.19.0-13-rt-amd64 (SMP w/12 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages openvswitch-switch-dpdk depends on:
pn  dpdk                <none>
ii  libc6               2.31-13
ii  libcap-ng0          0.7.9-2.2+b1
pn  librte-eal21        <none>
pn  librte-ethdev21     <none>
pn  librte-mbuf21       <none>
pn  librte-mempool21    <none>
pn  librte-meter21      <none>
pn  librte-vhost21      <none>
ii  libssl1.1           1.1.1k-1
ii  libunbound8         1.13.1-1
ii  openvswitch-common  2.15.0+ds1-2
ii  openvswitch-switch  2.15.0+ds1-2

openvswitch-switch-dpdk recommends no packages.

openvswitch-switch-dpdk suggests no packages.
>From 89ee843f2d9632861b8ea40849d9e21e07c1a0c4 Mon Sep 17 00:00:00 2001
From: Felix Moessbauer <felix.moessba...@siemens.com>
Date: Wed, 18 Aug 2021 06:21:20 +0000
Subject: [PATCH] fix ABI incompatibility that crashes OVS when enabling LLDP

This fix ensures that the libofproto is also placed in the
update-alternatives to ensure that the library is build with the same
defines (e.g. NETDEV_DPDK) as the ovs-vswitchd binary.

Previously, even the ovs-vswitchd build with DPDK used the libofproto without
DPDK support.

%% original patch: 
0001-fix-ABI-incompatibility-that-lead-to-a-crash-when-en.patch
---
 debian/openvswitch-common.postinst.in      |  3 ++-
 debian/openvswitch-switch-dpdk.postinst.in |  3 ++-
 debian/rules                               | 13 +++++++++++--
 3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/debian/openvswitch-common.postinst.in 
b/debian/openvswitch-common.postinst.in
index 43df5b886..b75b2e9ed 100644
--- a/debian/openvswitch-common.postinst.in
+++ b/debian/openvswitch-common.postinst.in
@@ -4,7 +4,8 @@ set -e
 
 if [ "${1}" = "configure" ] ; then
        update-alternatives --install /usr/sbin/ovs-vswitchd ovs-vswitchd 
/usr/lib/openvswitch-common/ovs-vswitchd 100 \
-        --slave /usr/lib/%%MULTIARCH_TRIPLETT%%/libopenvswitch-2.15.so.0.0.0 
libopenvswitch.so /usr/lib/openvswitch-common/libopenvswitch-2.15.so.0.0.0
+        --slave /usr/lib/%%MULTIARCH_TRIPLETT%%/libopenvswitch-2.15.so.0.0.0 
libopenvswitch.so /usr/lib/openvswitch-common/libopenvswitch-2.15.so.0.0.0 \
+        --slave /usr/lib/%%MULTIARCH_TRIPLETT%%/libofproto-2.15.so.0.0.0 
libofproto.so /usr/lib/openvswitch-common/libofproto-2.15.so.0.0.0
 fi
 
 #DEBHELPER#
diff --git a/debian/openvswitch-switch-dpdk.postinst.in 
b/debian/openvswitch-switch-dpdk.postinst.in
index 4bbc279e3..85d231d27 100644
--- a/debian/openvswitch-switch-dpdk.postinst.in
+++ b/debian/openvswitch-switch-dpdk.postinst.in
@@ -4,7 +4,8 @@ set -e
 
 if [ "${1}" = "configure" ] ; then
        update-alternatives --install /usr/sbin/ovs-vswitchd ovs-vswitchd 
/usr/lib/openvswitch-switch-dpdk/ovs-vswitchd-dpdk 200 \
-        --slave /usr/lib/%%MULTIARCH_TRIPLETT%%/libopenvswitch-2.15.so.0.0.0 
libopenvswitch.so /usr/lib/openvswitch-switch-dpdk/libopenvswitch-2.15.so.0.0.0
+        --slave /usr/lib/%%MULTIARCH_TRIPLETT%%/libopenvswitch-2.15.so.0.0.0 
libopenvswitch.so /usr/lib/openvswitch-switch-dpdk/libopenvswitch-2.15.so.0.0.0 
\
+        --slave /usr/lib/%%MULTIARCH_TRIPLETT%%/libofproto-2.15.so.0.0.0 
libofproto.so /usr/lib/openvswitch-switch-dpdk/libofproto-2.15.so.0.0.0
 fi
 
 #DEBHELPER#
diff --git a/debian/rules b/debian/rules
index 205596f00..d310f0d57 100755
--- a/debian/rules
+++ b/debian/rules
@@ -207,6 +207,9 @@ override_dh_auto_install-arch:
                
$(CURDIR)/debian/openvswitch-common/usr/lib/openvswitch-common/ovs-vswitchd
        mv $(CURDIR)/debian/tmp/usr/lib/*/libopenvswitch-2.15.so.0.0.0 \
                
$(CURDIR)/debian/openvswitch-common/usr/lib/openvswitch-common/libopenvswitch-2.15.so.0.0.0
+       mv $(CURDIR)/debian/tmp/usr/lib/*/libofproto-2.15.so.0.0.0 \
+               
$(CURDIR)/debian/openvswitch-common/usr/lib/openvswitch-common/libofproto-2.15.so.0.0.0
+
 
 override_dh_auto_install-indep:
        $(MAKE) -C _debian DESTDIR=$(CURDIR)/debian/tmp install
@@ -218,7 +221,10 @@ override_dh_auto_install-indep:
 
 override_dh_install:
        install -D -m 0644 utilities/ovs-vsctl-bashcomp.bash 
$(CURDIR)/debian/openvswitch-switch/usr/share/bash-completion/completions/ovs-vsctl
-       dh_install --exclude=usr/sbin/ovs-vswitchd 
--exclude=usr/lib/`dpkg-architecture 
-qDEB_HOST_MULTIARCH`/libopenvswitch-2.15.so.0.0.0
+       dh_install --exclude=usr/sbin/ovs-vswitchd \
+                  --exclude=usr/lib/`dpkg-architecture 
-qDEB_HOST_MULTIARCH`/libopenvswitch-2.15.so.0.0.0 \
+                  --exclude=usr/lib/`dpkg-architecture 
-qDEB_HOST_MULTIARCH`/libofproto-2.15.so.0.0.0
+
 
        rm -f $(CURDIR)/debian/tmp/usr/lib/*/*.la
        dh_installman --language=C
@@ -227,6 +233,7 @@ override_dh_install:
        # remove the files managed via update-alternatives
        rm -f $(CURDIR)/debian/tmp/usr/sbin/ovs-vswitchd
        rm -f $(CURDIR)/debian/tmp/usr/lib/*/libopenvswitch-2.15.so.0.0.0
+       rm -f $(CURDIR)/debian/tmp/usr/lib/*/libofproto-2.15.so.0.0.0
 
        dh_missing --fail-missing
        # openvswitch-switch
@@ -238,6 +245,8 @@ ifneq (,$(filter i386 amd64 ppc64el arm64, 
$(DEB_HOST_ARCH)))
                
$(CURDIR)/debian/openvswitch-switch-dpdk/usr/lib/openvswitch-switch-dpdk/ovs-vswitchd-dpdk
        install -v -D _dpdk/lib/.libs/libopenvswitch-2.15.so.0.0.0 \
                
$(CURDIR)/debian/openvswitch-switch-dpdk/usr/lib/openvswitch-switch-dpdk/libopenvswitch-2.15.so.0.0.0
+       install -v -D _dpdk/ofproto/.libs/libofproto-2.15.so.0.0.0 \
+               
$(CURDIR)/debian/openvswitch-switch-dpdk/usr/lib/openvswitch-switch-dpdk/libofproto-2.15.so.0.0.0
 endif
 
 override_dh_installinit:
@@ -254,7 +263,7 @@ override_dh_strip:
        dh_strip --dbg-package=openvswitch-dbg
 
 override_dh_shlibdeps:
-       dh_shlibdeps -l$(CURDIR)/_debian/lib/.libs
+       dh_shlibdeps 
-l$(CURDIR)/_debian/lib/.libs:$(CURDIR)/_debian/ofproto/.libs
 
 override_dh_installman:
        echo "Do nothing..."
-- 
2.30.2

Reply via email to