ss crashes when using --no-header

Bug #1787396 reported by Simon Déziel
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
iproute2 (Ubuntu)
Fix Released
Undecided
Unassigned
Bionic
Confirmed
Undecided
Unassigned

Bug Description

Steps to reproduce:

1) Listen on port 8989:
$ nc -l 8989 &

2) Check that ss can list this listener:
$ ss --no-header -nto state listening 'sport = 8989'
0 1 0.0.0.0:8989 0.0.0.0:*

3) Ask ss to list listeners on a port where nothing listens
$ kill %1 # stops nc
$ ss --no-header -nto state listening 'sport = 8989'
Segmentation fault (core dumped)

In the above, removing "--no-header" avoids the segfault.

Additional information:

$ lsb_release -rd
Description: Ubuntu 18.04.1 LTS
Release: 18.04
$ apt-cache policy iproute2
iproute2:
  Installed: 4.15.0-2ubuntu1
  Candidate: 4.15.0-2ubuntu1
  Version table:
 *** 4.15.0-2ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
        100 /var/lib/dpkg/status

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: iproute2 4.15.0-2ubuntu1
ProcVersionSignature: Ubuntu 4.15.0-32.35-generic 4.15.18
Uname: Linux 4.15.0-32-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.9-0ubuntu7.2
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Thu Aug 16 08:17:52 2018
InstallationDate: Installed on 2018-07-15 (32 days ago)
InstallationMedia: Ubuntu 18.04 LTS "Bionic Beaver" - Release amd64 (20180714)
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_CA.UTF-8
 SHELL=/bin/bash
SourcePackage: iproute2
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Simon Déziel (sdeziel) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in iproute2 (Ubuntu):
status: New → Confirmed
Revision history for this message
vvhk (vvhk-deactivatedaccount-deactivatedaccount) wrote :

I've replicated the problem and the way I see it, all you need is --no-header and a filter with no matches. Filters with matches (found connections) won't cause a segfault.

Revision history for this message
Simon Déziel (sdeziel) wrote :

This also happens on Cosmic that has the same version of ss/iproute2:

# apt-cache policy iproute2
iproute2:
  Installed: 4.15.0-2ubuntu1
  Candidate: 4.15.0-2ubuntu1
  Version table:
 *** 4.15.0-2ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu cosmic/main amd64 Packages
        100 /var/lib/dpkg/status

tags: added: cosmic
Revision history for this message
Simon Déziel (sdeziel) wrote :

This is fixed in Debian since 4.16.0-4 at least.

Revision history for this message
Martin Pitt (pitti) wrote :

I confirm this on Ubuntu 18.04 (bionic) with 4.15.0-2ubuntu1. It is fixed in 18.10 (cosmic) with 4.18.0-1ubuntu2.

Changed in iproute2 (Ubuntu Bionic):
status: New → Confirmed
Changed in iproute2 (Ubuntu):
status: Confirmed → 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.