[MIR] Promote ruby-nio4r to main as a pcs indirect dependency

Bug #2006464 reported by Lucas Kanashiro
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ruby-nio4r (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

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

[Rationale]
The package ruby-nio4r is required in Ubuntu main for puma promotion which is a runtime dependency of pcs (the main reason for this promotion).

Ideally, we expect that ruby-nio4r (and pcs) will be promoted in the "L" development cycle. The idea is to promote only the ruby-nio4r binary.

[Security]
Required links:

https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=ruby-nio4r

Nothing was found searching for the package name. If you look for the gem name:

https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=nio4r

also nothing is reported.

Nothing was found searching in the OSS security mailing list archive.

https://ubuntu.com/security/cves?package=ruby-nio4r

Also nothing found in the Ubuntu security tracker.

No `suid` or `sgid` binaries.

No executables in `/sbin` and `/usr/sbin`.

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
(filters, scanners, plugins, UI skins, ...).

[Quality assurance - function/usage]
The package works well right after install.

[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/ruby-nio4r/+bug
- Debian https://bugs.debian.org/cgi-bin/pkgreport.cgi?src=ruby-nio4r

The package does not deal with exotic hardware we cannot support.

[Quality assurance - testing]
The package runs a test suite on build time, if it fails
it makes the build fail, link to build log:

https://launchpadlibrarian.net/649375123/buildlog_ubuntu-lunar-amd64.ruby-nio4r_2.5.8-2build2_BUILDING.txt.gz

The package runs an autopkgtest, and is currently passing on
this list of architectures: amd64, arm64, armhf, i386, ppc64el, s390x.

Link to test logs:

https://autopkgtest.ubuntu.com/packages/ruby-nio4r

The package does have not failing autopkgtests right now.

[Quality assurance - packaging]
debian/watch is present and works.

debian/control defines a correct Maintainer field.

Output of `lintian --pedantic` against the source package present in lunar:

W: ruby-nio4r source: unknown-field Ruby-Versions
P: ruby-nio4r source: silent-on-rules-requiring-root [debian/control]
P: ruby-nio4r source: update-debian-copyright 2014 vs 2023 [debian/copyright:14]

There is no lintian overrides.

This package does not rely on obsolete or about to be demoted packages.

The package will not be installed by default.

Packaging and build is easy, link to d/rules:

https://git.launchpad.net/~git-ubuntu-import/ubuntu/+source/ruby-nio4r/tree/debian/rules

[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 Server.

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.

The package has been built in the archive more recently than the last
test rebuild.

[Background information]
The Package description explains the package well.

Upstream Name is: nio4r.

Link to upstream project: https://github.com/socketry/nio4r

Changed in ruby-nio4r (Ubuntu):
assignee: nobody → Lukas Märdian (slyon)
tags: added: sec-1676
Revision history for this message
Lukas Märdian (slyon) wrote :
Download full text (4.9 KiB)

Review for Package: src:ruby-nio4r

[Summary]
nio4r is a Ruby gem/library that provides asynchronous I/O primitives
for scalable network clients and servers. It is not a full-featured
event framework like EventMachine or Cool.io.

MIR team ACK under the constraint to resolve the below listed
required TODOs and as much as possible having a look at the
recommended TODOs.

This does need a security review, so I'll assign ubuntu-security

List of specific binary packages to be promoted to main: ruby-nio4r
Specific binary packages built, but NOT to be promoted to main: <None>

Notes:
#0 I'm requesting security review, especially for the embedded "libev"
   (and also a bit about the openssl sockets)

Required TODOs:
#1 embedded library source in ext/libev/
   * same version 4.33 is also available as shared library in the
     archive; it should be used instead
   * libev seems to be shipped as source files, please clearify how
     this is being used & if libev from the archive can be used instead

Recommended TODOs:
#2 The package should get a team bug subscriber before being promoted
#3 libev compiler warnings
#4 consider symbols tracking
   * I'm not sure if this is needed or if the .so can only be used internally?)
   * /usr/lib/*/rubygems-integration/*/extensions/*/*/nio4r-2.5.8/nio4r_ext.so
#5 Work with Debian to improve/update some of the lintian warnings (see below)

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

[Dependencies]
OK:
- no other Dependencies to MIR due to this
  - SRCPKG checked with `check-mir`
  - all dependencies can be found in `seeded-in-ubuntu` (already in main)
  - none of the (potentially auto-generated) dependencies (Depends
    and Recommends) that are present after build are not in main
- no -dev/-debug/-doc packages that need exclusion
- No dependencies in main that are only superficially tested requiring
  more tests now.

Problems: None

[Embedded sources and static linking]
OK:
- no static linking
- 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: ext/libev/ (same version 4.33 is also
  available as shared library in the archive; it should be used
  instead)
- libev seems to be shipped as source files, please clearify how this
  is being used and if libev from the archive can be used instead

[Security]
OK:
- history of CVEs does not look concerning
- does not run a daemon as root
- does not use webkit1,2
- does not use lib*v8 directly
- does not parse data formats (files [images, video, audio,
  xml, json, asn.1], network packets, structures, ...) from
  an untrusted source.
- 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)

Problems:
- does open a port/socket
- does deal with cryptography (supports OpenSSL sockets)

[Common blockers]
OK:
- does not FTBFS currently
- does have a test su...

Read more...

Changed in ruby-nio4r (Ubuntu):
assignee: Lukas Märdian (slyon) → Ubuntu Security Team (ubuntu-security)
Revision history for this message
Alex Murray (alexmurray) wrote : security audit
Download full text (4.1 KiB)

I reviewed ruby-nio4r 2.5.8-2build1 as checked into lunar. This shouldn't be
considered a full audit but rather a quick gauge of maintainability.

ruby-nio4r is an asynchronous I/O library designed to be used to build network
clients or servers. It provides both a pure Ruby implementation, using
Kernel.select as the backend, as well as a backend based on the libev library,
and finally when used on JRuby will wrap the Java NIO subsystem on which this
library is designed.

- CVE History:
  - None
- No encryption / network based Build-Depends
  - Does have a vendored copy of libev based on the upstream 4.33 version of
    libev - captured in the Ubuntu CVE tracker via
    https://git.launchpad.net/ubuntu-cve-tracker/tree/boilerplates/libev?id=d2ddece0a26d2930ac6e714aff3cb3718cd2af9d#n7
- No pre/post inst/rm scripts
- No init scripts
- No systemd units
- No dbus services
- No setuid binaries
- No binaries in PATH
- No sudo fragments
- No polkit files
- No udev rules
- unit tests / autopkgtests
  - unit tests are run during the build
  - No autopkgtests
- No cron jobs
- Build logs:
  - Some minor warnings during the build of the vendored libev
```
In file included from nio4r_ext.c:6:
../libev/ev.c:2136:31: warning: ‘ev_default_loop_ptr’ initialized and declared ‘extern’
 2136 | EV_API_DECL struct ev_loop *ev_default_loop_ptr = 0; /* needs to be initialised to make it a definition despite extern */
      | ^~~~~~~~~~~~~~~~~~~
../libev/ev.c: In function ‘evpipe_write’:
../libev/ev.c:2798:11: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 2798 | write (evpipe [1], &counter, sizeof (uint64_t));
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../libev/ev.c:2810:11: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 2810 | write (evpipe [1], &(evpipe [1]), 1);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../libev/ev.c: In function ‘pipecb’:
../libev/ev.c:2831:11: warning: ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 2831 | read (evpipe [1], &counter, sizeof (uint64_t));
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../libev/ev.c:2845:11: warning: ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 2845 | read (evpipe [0], &dummy, sizeof (dummy));
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
  - No LINTIAN FAILURES

- No Processes spawned
- Memory management is ruby ;)
- No File IO
- No Logging
- Uses the NIO4R_PURE environment variable to allow a user to choose a pure ruby
  implementation, rather than relying on the libev based backend
- No use of privileged functions
- No use of cryptography / random number sources etc other than in test code
- No use of temp files
- No use of networking other than in test code
- No use of WebKit
- No use of PolicyKit

- No significant cppcheck results
- No significant Coverity results
- No significant brakeman results
- No significant rubocop results
- No significant shellch...

Read more...

tags: added: security-review-done
Changed in ruby-nio4r (Ubuntu):
assignee: Ubuntu Security Team (ubuntu-security) → nobody
Lukas Märdian (slyon)
Changed in ruby-nio4r (Ubuntu):
status: New → Incomplete
assignee: nobody → Lucas Kanashiro (lucaskanashiro)
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

My comments below regarding Lukas' requests:

#0: Security team already acked the promotion to main in comment #2.

#1: As explained by Alex in comment #2, the embedded version has some changes compared to what we have in the archive, so I'll kindly ask to not make this mandatory for the promotion. FWIW security team will be tracking the embedded version as stated by Alex.

#2: The server team is already subscribed to this package.

#3: I'd not want to make changes in the embedded libev code for now. Since this is recommended, could we skip this?

#4: I do not see a reason to ship a symbols file here, just ruby-nio4r is using it.

#5: I uploaded version 2.5.8-3 of ruby-nio4r to Debian addressing most of the lintian warnings, it should be sync'ed soon.

Changed in ruby-nio4r (Ubuntu):
assignee: Lucas Kanashiro (lucaskanashiro) → nobody
Revision history for this message
Lukas Märdian (slyon) wrote :

#0 ACK.
#1 ACK. If it's not a blocker for the security team and the owning team, I'm fine with it, too.
=> Downgrading to a "Recommended TODO".
#2 ACK.
#3 ACK.
#4 ACK.
#5 ACK.

Thanks! This seems ready for promotion.

Changed in ruby-nio4r (Ubuntu):
status: Incomplete → In Progress
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Showing up in component mismatch now as planned.

Changed in ruby-nio4r (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Promoted together with the full PCS stack, details see https://bugs.launchpad.net/ubuntu/+source/pcs/+bug/1953341/comments/13

Changed in ruby-nio4r (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.