I reviewed qrtr 1.0-2 as checked into mantic. This shouldn't be
considered a full audit but rather a quick gauge of maintainability.

qrtr: Userspace reference for net/qrtr in the Linux kernel

- CVE History:
  - no CVE history
  - no security policy
  - CVE-2019-19079 and CVE-2021-29647 affect kernel implementation
- Build-Depends?
  - no explicit dependencies in d/control
- pre/post inst/rm scripts?
  - postinst configures and starts qrtr-ns.service
  - prerm stops qrtr-ns.service
  - postrm runs daemon-reload and purges qrtr-ns.service
- init scripts?
  - init
- systemd units?
  - ./lib/systemd/system/qrtr-ns.service
    - spartan documentation
    - starts qrtr-ns
- dbus services?
  - none
- setuid binaries?
  - none
- binaries in PATH?
  - ./usr/bin/qrtr-cfg
  - ./usr/bin/qrtr-lookup
  - ./usr/bin/qrtr-ns
- sudo fragments?
  - none
- polkit files?
  - none
- udev rules?
  - none
- unit tests / autopkgtests?
  - tests, hardware tests, are needed
- cron jobs?
  - none
- Build logs:
  - mostly clean
  - see -proposed

- Processes spawned?
  - none
- Memory management?
  - memory use appears safe
  - if values are confidential, memset_s should be used
- File IO?
  - only sockets
- Logging?
  - yes, see PLOGE 
  - string use looks safe
- Environment variable usage?
  - none
- Use of privileged functions?
  - none
- Use of cryptography / random number sources etc?
  - none
- Use of temp files?
  - none
- Use of networking?
  - heavy, most of codebase
  - nothing obviously concerning
- Use of WebKit?
  - none
- Use of PolicyKit?
  - none

- Any significant cppcheck results?
  - none
- Any significant Coverity results?
  - rc appears to be false positive
  - src/ns.c:796:2 appears to be an infinite loop
- Any significant shellcheck results?
  - none
- Any significant bandit results?
  - none
  - ./qrtr.py is python2.7

We should be cautious of IPC routers running root permissions. Similar code has
enabled vendor backdoors [0].

Qualcomm IPC will only be enabled in kernels which require it, such as for the
x13s.

Some mitigations exist to prevent spoofing and non-local observers. Fuzzing
seems worthwhile.

Possibly zero in-line comments. No documentation. This is a major maintenance
issue.

slyon's recommendations are great!

Thank you for adding a hardened systemd profile to -proposed for promotion \o/
http://launchpadlibrarian.net/691288509/qrtr_1.0-2_1.0-2ubuntu1.diff.gz

Security team ACK for promoting qrtr to main.

[0]
https://redmine.replicant.us/projects/replicant/wiki/samsunggalaxybackdoor

** CVE added: https://cve.mitre.org/cgi-bin/cvename.cgi?name=2019-19079

** CVE added: https://cve.mitre.org/cgi-bin/cvename.cgi?name=2021-29647

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to qrtr in Ubuntu.
https://bugs.launchpad.net/bugs/2038942

Title:
  [MIR] protection-domain-mapper & qrtr

Status in protection-domain-mapper package in Ubuntu:
  Fix Committed
Status in qrtr package in Ubuntu:
  Fix Committed

Bug description:
  [Availability]
  The package protection-domain-mapper is already in Ubuntu universe.
  The package protection-domain-mapper build for the architectures it is 
designed to work on.
  It currently builds and works for architectures: any, verified as working on 
arm64
  Link to package https://launchpad.net/ubuntu/+source/protection-domain-mapper

  [Rationale]

  - The package protection-domain-mapper is required in Ubuntu main for
    ubuntu-desktop on ARM64, as it enables power-indicator (among other
    things) on most Windows on Arm laptops (qcom based laptops ~7 SKUs
    and more coming). There is no other way to implement this.

  - protection-domain-mapper depends on qrtr for library and a systemd
    service it provides.

  - There is no other/better way to solve this that is already in main
    or should go universe->main instead of this. As this is the only
    implementation of talking to the qcom hardware.

  - The package protection-domain-mapper is required in Ubuntu main no
    later than today due to Mantic release, if we want to have the best
    impression of Ubuntu Desktop in the live session on x13s.

  - If that fails, having it fixed as SRU is the next best option.

  [Security]

  - No CVEs/security issues in this software in the past. This is a
    reference open source implementation of these tools, which otherwise
    are used on qcom Android devices

  - no `suid` or `sgid` binaries no executables in `/sbin` and
    `/usr/sbin`

  - Package does install services: pd-mapper.service & qrtr-ns.service
    which allow runtime access to the qcom hardware which are run as
    root

  - Security has been kept in mind and common isolation/risk-mitigation
  patterns are in place utilizing the following features:

  - Packages does not open privileged ports (ports < 1024).

  - Package does not expose any external endpoints

  - 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, i.e. power indicator
    straight away starts to show accurate battery information

  [Quality assurance - maintenance]
  - The package is maintained well in Debian/Ubuntu/Upstream and does
    not have too many, long-term & critical, open bugs
    - Ubuntu 
https://bugs.launchpad.net/ubuntu/+source/protection-domain-mapper/+bug
    https://bugs.launchpad.net/ubuntu/+source/qrtr/+bug
    - Debian 
https://bugs.debian.org/cgi-bin/pkgreport.cgi?src=protection-domain-mapper 
https://bugs.debian.org/cgi-bin/pkgreport.cgi?src=qrtr
    - Upstream's bug tracker, e.g., GitHub Issues

  - The package has important open bugs, listing them:
    
https://bugs.launchpad.net/ubuntu/+source/protection-domain-mapper/+bug/2038944
    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1045729 upstream fix at 
https://github.com/andersson/qrtr/pull/24/files

  - The package does deal with exotic hardware, it is present at Lenovo
    X13s to be able to test, fix and verify bugs as many users at
    Canonical and Community have it. And it is available for purchase.

  [Quality assurance - testing]

  - The package does not run a test at build time because adequate
    testing requires exotic hardware & specifically kernel driver loaded

  - The package does not run an autopkgtest because testing requires
    exotic hardware & specifically kernel driver loaded.

  - The package does have not failing autopkgtests right now

  - The package can not be well tested at build or autopkgtest time
    because it requires exotic hardware to test. To make up for that:
     - We have access to such hardware in the team (foundations & kernel)

     - We will add a run-once manual test case to iso tracker to ensure
       that "power indicator shows battery indicator %")

     - We will execute this test case on every upload of
       protection-domain-mapper qrtr and the underlying kernel, as well
       as image milestone testing

     - qrtr package is minimal and will be tested in a more wide
       reaching solution context protection-device-mapper, that is
       causing battery indicator to work.

  [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

    
https://udd.debian.org/lintian/?email1=&email2=&email3=&packages=qrtr&ignpackages=&format=html&lt_error=on&lt_warning=on&lt_information=on&lt_pedantic=on&lt_experimental=on&lt_overridden=on&lt_masked=on&lt_classification=on&lintian_tag=#all

    lack of manpages, lack of systemd hardening features in systemd unit

    https://udd.debian.org/lintian/?email1=&email2=&email3=&packages=protection-
  domain-
  
mapper&ignpackages=&format=html&lt_error=on&lt_warning=on&lt_information=on&lt_pedantic=on&lt_experimental=on&lt_overridden=on&lt_masked=on&lt_classification=on&lintian_tag=#all

    lack of manpage, lack of systemd hardening features in systemd unit

  - Please link to a recent build log of the package

    https://launchpad.net/ubuntu/+source/qrtr/1.0-2

    https://launchpad.net/ubuntu/+source/protection-domain-mapper/1.0-4

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

  - The package will be installed by default, but does not ask debconf
    questions higher than medium

  - Packaging and build is easy, link to debian/rules

    https://salsa.debian.org/DebianOnMobile-team/protection-domain-
  mapper/-/blob/debian/latest/debian/rules

    https://salsa.debian.org/DebianOnMobile-
  team/qrtr/-/blob/debian/latest/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]

  - The owning team will be kernel-packages and I have their
    acknowledgement for that commitment

  - This does not use static builds

  - This does not use vendored code

  - This does not use vendored code

  - This package is not rust based

  - The package successfully built during the most recent test rebuild

  [Background information]
  The Package description explains the package well
  Upstream Name matches package name

  Link to upstream project are: https://github.com/andersson/qrtr and
  https://github.com/andersson/pd-mapper

  This package unblocks announcement of Ubuntu Desktop on ARM64 Laptops
  for the first time, on an arm64 laptop from a tier 1 OEM available for
  sale now.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/protection-domain-mapper/+bug/2038942/+subscriptions


-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to