[MIR] xdp-tools

Bug #2002103 reported by Frode Nordahl
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
xdp-tools (Ubuntu)
Fix Released
High
Unassigned

Bug Description

[Availability]
- The package xdp-tools is already in Ubuntu universe.
- The package xdp-tools build for the architectures it is designed to work on.
- It currently builds and works for architetcures:
  - amd64, arm64, armhf, ppc64el, riscv64, s390x
Link to package: [[https://launchpad.net/ubuntu/+source/xdp-tools|xdp-tools]]

[Rationale]
- The package xdp-tools is required in Ubuntu main for openvswitch.
- AF_XDP, Address Family of the eXpress Data Path, is a new Linux socket type
  built upon the eBPF and XDP technology. It is aims to have comparable
  performance to DPDK but cooperate better with existing kernel’s networking
  stack. The original author of Open vSwitch has written a paper about it [0].
- The feature is still in the experimental stage, but it is important to make
  it available to the masses in order to support its further development.
- Competing Linux distributions are vocal about supporting this feature.
- The package xdp-tools complements libbpf, and is a new runtime
  dependency of package openvswitch which we already support.
- The package xdp-tools is required in Ubuntu main no later than 2023-02-09
  due to openvswitch 3.1.0 enabling build of AF_XDP support by default which
  we want included in Ubuntu 23.04.

0: https://qmro.qmul.ac.uk/xmlui/bitstream/handle/123456789/73562/Antichi%20revisiting%20the%20open%20vSwitch%20dataplane%20ten%20years%20later%202021%20Accepted.pdf

[Security]
- No CVEs/security issues in this software in the past
- no `suid` or `sgid` binaries
- Binary xdp-filter, xdp-loader and xdpdump in `/usr/sbin` are admin tools
  that require super user access to run.
- Package does not install services, timers or recurring jobs
- Packages does not open privileged ports (ports < 1024)
- Packages does not contain extensions to security-sensitive software

[Quality assurance - function/usage]
- The package provides admin tools with manual pages, a library and
  header files and works as expected.

[Quality assurance - maintenance]
- The package is maintained well in Debian/Ubuntu and has not too many
  and long term critical bugs open
  - Ubuntu https://bugs.launchpad.net/ubuntu/+source/xdp-tools/+bug
  - Debian https://bugs.debian.org/cgi-bin/pkgreport.cgi?src=xdp-tools
- The package does not deal with exotic hardware we cannot support

[Quality assurance - testing]
- The package does not run a test at build time because tests require root and
  break the testbed.
- The package runs an autopkgtest, and is currently passing on
  amd64 arm64 ppc64el s390x, link to test logs:
  https://autopkgtest.ubuntu.com/packages/xdp-tools

[Quality assurance - packaging]
- debian/watch is present and works
- debian/control defines a correct Maintainer field
- This package does not yield massive lintian Warnings, Errors
- Link to a recent build log of the package https://launchpadlibrarian.net/639539109/buildlog_ubuntu-lunar-amd64.xdp-tools_1.2.9-1_BUILDING.txt.gz
- Lintian overrides are present, but ok because BPF binaries appear to be
  from other architecture.
- This package does not rely on obsolete or about to be demoted packages.
- This package has no python2 or GTK2 dependencies
- The package will be installed by default, but does not ask debconf
  questions higher than medium.
- Packaging and build is easy

[UI standards]
- Application is not end-user facing (does not need translation)

[Dependencies]
- No further depends or recommends dependencies that are not yet in main

[Standards compliance]
- This package correctly follows FHS and Debian Policy

[Maintenance/Owner]
- Owning Team will be OVN
- Team is not yet, but will subscribe to the package before promotion
- This does not use static builds
- This does not use vendored code
- This package is not rust based

[Background information]
- The Package description explains the package well
- Upstream Name is xdp-tools
- Link to upstream project https://github.com/xdp-project/xdp-tools

Tags: sec-1571
Frode Nordahl (fnordahl)
Changed in xdp-tools (Ubuntu):
importance: Undecided → High
description: updated
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :
Download full text (4.0 KiB)

Review for Package: xdp-tools

[Summary]
This rather new, but well packaged - I did not find a blocker in regard to the
general MIR rules.
=> MIR team ACK

But several risks make it prone to attacks, so this does need a security
review, I'll assign ubuntu-security

List of specific binary packages to be promoted to main: libxdp1, libxdp-dev
Specific binary packages built, but NOT to be promoted to main: xdp-tools, xdp-tests

[Duplication]
There is no other package in main providing the same functionality.

[Dependencies]
OK:
- no other Dependencies to MIR due to this (libbpf1 and libc6 are in main)
- no -dev/-debug/-doc packages that need exclusion (libxdp-dev has no
  problematic dependencies)
- No dependencies in main that are only superficially tested requiring
  more tests now.

Problems: None

[Embedded sources and static linking]
OK:
- no static linking (bpf programs are special, but not static in the sense
  that is meant here)
- does not have unexpected Built-Using entries
- not a go package, no extra constraints to consider in that regard
- not a rust package, no extra constraints to consider in that regard

Problems:
- embedded source present for libbpf, but the build takes care to enforce
  the use of the packages libbpf via setting FORCE_SYSTEM_LIBBPF in d/rules

[Security]
OK:
- history of CVEs does not look concerning
  Note there are other XDP related issues, but those are - for now - related
  to the kernel XDP components and those of other XDP users
  https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=xdp
- does not run a daemon as root
- does not use webkit1,2
- does not use lib*v8 directly
- does not open a port/socket
- does not process arbitrary web content
- does not use centralized online accounts
- does not integrate arbitrary javascript into the desktop
- does not deal with system authentication (eg, pam), etc)
- does not deal with security attestation (secure boot, tpm, signatures)
- does not deal with cryptography (en-/decryption, certificates, signing, ...)

Problems:
- does parse data formats (files [images, video, audio,
  xml, json, asn.1], network packets, structures, ...) from
  an untrusted source => Network packages.
- Although the package itself didn't yet trigger CVEs there are two reasons
  that makes this critical. First it is about network traffic which directly
  means externally craftable content.
  Furthemore this brings BPF programs which are loaded into the kernel. And
  while BPF provides security layers, that still is an elevated risk IMHO.

[Common blockers]
OK:
- does not FTBFS currently
- does have a non-trivial test suite that runs as autopkgtest
  - This does not need special HW for build or test (only for HW support which
    is rare, as of today this is mostyl SW)
- no new python2 dependency

Problems:
- does not have a test suite that runs at build time - it is explicitly
  disabled as it requires root and brekas the testbed. That is not perfect but
  ok since there is a quality autopkgetest to make up for it.
  => https://autopkgtest.ubuntu.com/packages/x/xdp-tools/lunar/amd64

[Packaging red flags]
OK:
- Ubuntu does not carry a delta
- symbols tracking is in place
- d/watch is present and...

Read more...

Changed in xdp-tools (Ubuntu):
assignee: nobody → Ubuntu Security Team (ubuntu-security)
tags: added: sec-1571
Changed in xdp-tools (Ubuntu):
assignee: Ubuntu Security Team (ubuntu-security) → Camila Camargo de Matos (ccdm94)
status: New → In Progress
Revision history for this message
Camila Camargo de Matos (ccdm94) wrote (last edit ):
Download full text (14.0 KiB)

I reviewed xdp-tools 1.2.9-2 as checked into lunar. This shouldn't be considered a full audit but rather a quick gauge of maintainability.

xdp-tools is a library and collection of utilities for working with the eXpress Data Path facility of the kernel, meaning it can be used when working with AF_XDP sockets and also to attach eBPF programs to the XDP layer. It also includes a set of tools to help debug and test functionalities of the main library, libxdp.

- CVE History:
  - No CVEs registered to this package.

- Build-Depends?
  - clang, debhelper-compat (= 13), libbpf-dev, libelf-dev, libpcap-dev, llvm, pkg-config, zlib1g-dev and gcc-multilib (all packages in main).
  - This package does not depend on encryption or networking libraries. It's main dependency could be considered 'libbpf', which is to be expected, given the goal the software wished to achieve.
  - Of the dependencies, 'elfutils' seems to be the package with the most CVEs associated to it. The related vulnerabilities, however, are all patched for releases affected, and lunar is not one of them

- No pre/post inst/rm scripts
- No init scripts
- No systemd units
- No dbus services
- No setuid binaries
- No sudo fragments
- No polkit files
- No udev rules
- No cronjobs rules

- Binaries in PATH:
  - 'xdp-filter', 'xdp-loader' and 'xdpdump' are installed in 'usr/sbin' (not SUID, owned by 'root:root'). The associated binary package is 'xdp-tools', meaning it can be installed separately or not at all, according to the user's needs. It is common for packages with extra tools such as this one to have various CVEs be reported against the tools only. At the same time that this could be an issue, I also think that having the tools could be an advantage when it comes to patching problems in these tools and in the library itself. That is because the tools allows us to test PoCs against the libraries in a way that the presence (or lack of it) of the vulnerability is clear. Also, should the tools themselves be vulnerable, the user can choose to simply not install them.

- Unit tests / autopkgtests:
  - The package does have autopkgtests.
  - The package also seems to contain unit tests, even if they can not be run during package build due to the need for root privileges. The unit tests can be called from '.sh' scripts and those will then run C code based programs. Building the code locally and running the tests is a fairly easy process, which is an advantage when we consider testing the code for regressions after patching. The presence of the tools in this aspect is also positive because we can then use those to further test the application and even create more automated tests for the package in the future.

- Build logs:
  - The package builds quickly.
  - No warning messages or error messages generated during the build.
  - A few lintian errors, but I believe that they are no reason for concern.

- Processes spawned
  - No processes spawned inside the code.
  - Testing directory contains a few shell scripts to setup the testing environment.

- Memory management
  - The code seems to perform memory management carefully in most instances, an example being the choice to use 'calloc' calls ...

Changed in xdp-tools (Ubuntu):
assignee: Camila Camargo de Matos (ccdm94) → nobody
Changed in xdp-tools (Ubuntu):
status: In Progress → Fix Committed
status: Fix Committed → In Progress
Revision history for this message
Lukas Märdian (slyon) wrote :

@ccdm94: This sounds like a security team ACK, is that correct?

If so, I think the status of this MIR could be "Fix Committed", as the package has a team bug subscriber and is already being pulled in as a dependency.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

[16:38] <sarnold> cpaelzer: xdp-tools looks ready to migrate to main

setting fix committed

Changed in xdp-tools (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Steve Langasek (vorlon) wrote :

missing the team subscriber in launchpad

Changed in xdp-tools (Ubuntu):
status: Fix Committed → Incomplete
Revision history for this message
Steve Langasek (vorlon) wrote :

I see that ~ubuntu-ovn-eng is a structural subscriber, but this is not a recognized team for main ownership. Why is this not using ~ubuntu-openstack as the subscriber?

Frode Nordahl (fnordahl)
Changed in xdp-tools (Ubuntu):
status: Incomplete → Fix Committed
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

This is fully approved and in component mismatches, I wanted to promote it to main, but found that
the OVN/Openstack team is not yet subscribed.

In case you are already subscribed the following might be the problem.
You mentioned "OVN Team" and usually it is "ubuntu-openstack".
If your org started to now subscribe the OVN team independently you'd need to become a team known tho the archive admins [1]

[1]: https://git.launchpad.net/ubuntu-archive-tools/tree/lputils.py#n46

Frode Nordahl (fnordahl)
Changed in xdp-tools (Ubuntu):
status: Fix Committed → Incomplete
Frode Nordahl (fnordahl)
Changed in xdp-tools (Ubuntu):
status: Incomplete → Fix Committed
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Thanks for fixing the subscription Fnordahl!

As agreed I left xdp-tools and xdp-tests in universe.

Override component to main
xdp-tools 1.3.0-2ubuntu2 in lunar: universe/misc -> main
Override [y|N]? y
1 publication overridden.

Override component to main
libxdp1 1.3.0-2ubuntu2 in lunar amd64: universe/libs/optional/100% -> main
libxdp1 1.3.0-2ubuntu2 in lunar arm64: universe/libs/optional/100% -> main
libxdp1 1.3.0-2ubuntu2 in lunar armhf: universe/libs/optional/100% -> main
libxdp1 1.3.0-2ubuntu2 in lunar ppc64el: universe/libs/optional/100% -> main
libxdp1 1.3.0-2ubuntu2 in lunar riscv64: universe/libs/optional/100% -> main
libxdp1 1.3.0-2ubuntu2 in lunar s390x: universe/libs/optional/100% -> main
libxdp-dev 1.3.0-2ubuntu2 in lunar amd64: universe/libdevel/optional/100% -> main
libxdp-dev 1.3.0-2ubuntu2 in lunar arm64: universe/libdevel/optional/100% -> main
libxdp-dev 1.3.0-2ubuntu2 in lunar armhf: universe/libdevel/optional/100% -> main
libxdp-dev 1.3.0-2ubuntu2 in lunar ppc64el: universe/libdevel/optional/100% -> main
libxdp-dev 1.3.0-2ubuntu2 in lunar riscv64: universe/libdevel/optional/100% -> main
libxdp-dev 1.3.0-2ubuntu2 in lunar s390x: universe/libdevel/optional/100% -> main
Override [y|N]? y
12 publications overridden.

Changed in xdp-tools (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.