patch 'drivers: fix symbol exports when map is omitted' has been queued to stable release 22.11.2

Xueming Li xuemingl at nvidia.com
Mon Feb 27 07:21:10 CET 2023


Hi,

FYI, your patch has been queued to stable release 22.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/01/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/07e68b092cbc347b4ec420e4e74e07e8cfb19064

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 07e68b092cbc347b4ec420e4e74e07e8cfb19064 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand at redhat.com>
Date: Tue, 29 Nov 2022 11:00:57 +0100
Subject: [PATCH] drivers: fix symbol exports when map is omitted
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit bfc43a0f681c9069a6e1ef9d18027b0fcfc24afc ]

ld exports any global symbol by default if no version script is passed.
As a consequence, the incriminated change let any public symbol leak
out of the driver shared libraries.

Hide again those symbols by providing a default map file which
unexports any global symbol using a local: * catch-all statement.

The checks are skipped for this default map file as it is intentionnally
an empty map (see commit b67bdda86cd4 ("devtools: catch empty symbol
maps")) and there is nothing else to check in this map.

This change impacts the exported symbols, hence, bump the version in the
ABI check to the v22.11.1 from the 22.11 LTS branch.

Fixes: 7dde9c844a37 ("drivers: omit symbol map when unneeded")

Reported-by: Luca Boccassi <luca.boccassi at microsoft.com>
Signed-off-by: David Marchand <david.marchand at redhat.com>
Tested-by: Ferruh Yigit <ferruh.yigit at amd.com>
Reviewed-by: Bruce Richardson <bruce.richardson at intel.com>
Acked-by: Aaron Conole <aconole at redhat.com>
---
 .github/workflows/build.yml | 3 ++-
 .travis.yml                 | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 82d83f4030..04a975c787 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -25,7 +25,8 @@ jobs:
       MINGW: ${{ matrix.config.cross == 'mingw' }}
       MINI: ${{ matrix.config.mini != '' }}
       PPC64LE: ${{ matrix.config.cross == 'ppc64le' }}
-      REF_GIT_TAG: none
+      REF_GIT_REPO: https://dpdk.org/git/dpdk-stable
+      REF_GIT_TAG: v22.11.1
       RISCV64: ${{ matrix.config.cross == 'riscv64' }}
       RUN_TESTS: ${{ contains(matrix.config.checks, 'tests') }}
 
diff --git a/.travis.yml b/.travis.yml
index 4bb5bf629e..0ea1242d97 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -42,7 +42,8 @@ script: ./.ci/${TRAVIS_OS_NAME}-build.sh
 env:
   global:
     - LIBABIGAIL_VERSION=libabigail-1.8
-    - REF_GIT_TAG=none
+    - REF_GIT_REPO=https://dpdk.org/git/dpdk-stable
+    - REF_GIT_TAG=v22.11.1
 
 jobs:
   include:
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.038294200 +0800
+++ 0001-drivers-fix-symbol-exports-when-map-is-omitted.patch	2023-02-27 14:08:40.719237000 +0800
@@ -1 +1 @@
-From bfc43a0f681c9069a6e1ef9d18027b0fcfc24afc Mon Sep 17 00:00:00 2001
+From 07e68b092cbc347b4ec420e4e74e07e8cfb19064 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit bfc43a0f681c9069a6e1ef9d18027b0fcfc24afc ]
@@ -21 +23,0 @@
-Cc: stable at dpdk.org
@@ -29,7 +31,3 @@
- .github/workflows/build.yml   |  3 +-
- .travis.yml                   |  3 +-
- devtools/check-symbol-maps.sh |  2 +-
- drivers/meson.build           | 68 +++++++++++++++++++----------------
- drivers/version.map           |  3 ++
- 5 files changed, 45 insertions(+), 34 deletions(-)
- create mode 100644 drivers/version.map
+ .github/workflows/build.yml | 3 ++-
+ .travis.yml                 | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
@@ -38 +36 @@
-index 9527ad1f8c..6bad94098e 100644
+index 82d83f4030..04a975c787 100644
@@ -45 +43 @@
--      REF_GIT_TAG: v22.11
+-      REF_GIT_TAG: none
@@ -52 +50 @@
-index b99444620f..0936788dc7 100644
+index 4bb5bf629e..0ea1242d97 100644
@@ -58,2 +56,2 @@
-     - LIBABIGAIL_VERSION=libabigail-2.1
--    - REF_GIT_TAG=v22.11
+     - LIBABIGAIL_VERSION=libabigail-1.8
+-    - REF_GIT_TAG=none
@@ -65,104 +62,0 @@
-diff --git a/devtools/check-symbol-maps.sh b/devtools/check-symbol-maps.sh
-index 0a6062de26..8c116bfa9c 100755
---- a/devtools/check-symbol-maps.sh
-+++ b/devtools/check-symbol-maps.sh
-@@ -8,7 +8,7 @@ cd $(dirname $0)/..
- export LC_ALL=C
- 
- if [ $# = 0 ] ; then
--    set -- $(find lib drivers -name '*.map')
-+    set -- $(find lib drivers -name '*.map' -a ! -path drivers/version.map)
- fi
- 
- ret=0
-diff --git a/drivers/meson.build b/drivers/meson.build
-index c4ff3ff1ba..5188302057 100644
---- a/drivers/meson.build
-+++ b/drivers/meson.build
-@@ -210,40 +210,46 @@ foreach subpath:subdirs
- 
-         lk_deps = []
-         lk_args = []
--        if fs.is_file(version_map)
--            def_file = custom_target(lib_name + '_def',
--                    command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'],
--                    input: version_map,
--                    output: '@0 at _exports.def'.format(lib_name))
--
--            mingw_map = custom_target(lib_name + '_mingw',
--                    command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'],
--                    input: version_map,
--                    output: '@0 at _mingw.map'.format(lib_name))
--
--            lk_deps = [version_map, def_file, mingw_map]
--            if is_windows
--                if is_ms_linker
--                    lk_args = ['-Wl,/def:' + def_file.full_path()]
--                    if meson.version().version_compare('<0.54.0')
--                        lk_args += ['-Wl,/implib:drivers\\' + implib]
--                    endif
--                else
--                    lk_args = ['-Wl,--version-script=' + mingw_map.full_path()]
-+        if not fs.is_file(version_map)
-+            version_map = '@0@/version.map'.format(meson.current_source_dir())
-+            lk_deps += [version_map]
-+        else
-+            lk_deps += [version_map]
-+            if not is_windows and developer_mode
-+                # on unix systems check the output of the
-+                # check-symbols.sh script, using it as a
-+                # dependency of the .so build
-+                lk_deps += custom_target(lib_name + '.sym_chk',
-+                        command: [check_symbols, version_map, '@INPUT@'],
-+                        capture: true,
-+                        input: static_lib,
-+                        output: lib_name + '.sym_chk')
-+            endif
-+        endif
-+
-+        def_file = custom_target(lib_name + '_def',
-+                command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'],
-+                input: version_map,
-+                output: '@0 at _exports.def'.format(lib_name))
-+
-+        mingw_map = custom_target(lib_name + '_mingw',
-+                command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'],
-+                input: version_map,
-+                output: '@0 at _mingw.map'.format(lib_name))
-+
-+        lk_deps += [def_file, mingw_map]
-+
-+        if is_windows
-+            if is_ms_linker
-+                lk_args = ['-Wl,/def:' + def_file.full_path()]
-+                if meson.version().version_compare('<0.54.0')
-+                    lk_args += ['-Wl,/implib:drivers\\' + implib]
-                 endif
-             else
--                lk_args = ['-Wl,--version-script=' + version_map]
--                if developer_mode
--                    # on unix systems check the output of the
--                    # check-symbols.sh script, using it as a
--                    # dependency of the .so build
--                    lk_deps += custom_target(lib_name + '.sym_chk',
--                            command: [check_symbols, version_map, '@INPUT@'],
--                            capture: true,
--                            input: static_lib,
--                            output: lib_name + '.sym_chk')
--                endif
-+                lk_args = ['-Wl,--version-script=' + mingw_map.full_path()]
-             endif
-+        else
-+            lk_args = ['-Wl,--version-script=' + version_map]
-         endif
- 
-         shared_lib = shared_library(lib_name, sources,
-diff --git a/drivers/version.map b/drivers/version.map
-new file mode 100644
-index 0000000000..78c3585d7c
---- /dev/null
-+++ b/drivers/version.map
-@@ -0,0 +1,3 @@
-+DPDK_23 {
-+	local: *;
-+};


More information about the stable mailing list