Article View: linux.kernel.netdev
Article #5027Re: [PATCH iproute2] ss: document -K requirements in man page
From: Stephen Hemminger
Date: Mon, 19 Oct 2026 17:11
Date: Mon, 19 Oct 2026 17:11
52 lines
13299 bytes
13299 bytes
On Sun, 18 Oct 2026 18:19:17 +0000 Gopal Malaviya <gopalmalaviya53@gmail.com> wrote: > The -K/--kill option uses SOCK_DESTROY, which the kernel only provides > when built with CONFIG_INET_DIAG_DESTROY=y (default n). Closing a > socket also requires CAP_NET_ADMIN. The man page mentions neither. > > Without CONFIG_INET_DIAG_DESTROY, the kernel answers every SOCK_DESTROY > request with EOPNOTSUPP. ss treats that the same as a single socket > that cannot be closed and skips it silently, so nothing is closed, no > error is printed and ss exits with status 0. For example, on a WSL2 > kernel (6.6.114.1-microsoft-standard-WSL2), running as root: > > # ss -tan '( sport = :52616 or dport = :52616 )' > State Recv-Q Send-Q Local Address:Port Peer Address:Port > FIN-WAIT-2 0 0 127.0.0.1:52616 127.0.0.1:58995 > CLOSE-WAIT 1 0 127.0.0.1:58995 127.0.0.1:52616 > # ss --kill -tan sport = :52616 > State Recv-Q Send-Q Local Address:Port Peer Address:Port > # echo $? > 0 > # ss -tan '( sport = :52616 or dport = :52616 )' > State Recv-Q Send-Q Local Address:Port Peer Address:Port > FIN-WAIT-2 0 0 127.0.0.1:52616 127.0.0.1:58995 > CLOSE-WAIT 1 0 127.0.0.1:58995 127.0.0.1:52616 > > With the same kernel rebuilt with CONFIG_INET_DIAG_DESTROY=y, the same > --kill command closes the matching socket when run as root, and fails > with "SOCK_DESTROY answers: Operation not permitted" without > CAP_NET_ADMIN. > > Making ss report this was discussed in 2016 [1] without agreement, > since the kernel also returns EOPNOTSUPP for individual sockets that > cannot be closed (e.g. some UDP or TIME_WAIT sockets on older kernels), > and per-socket errors would be noisy on correctly configured systems. > This patch does not change behaviour; it only documents both > requirements and the silent case, so users can tell why -K had no > effect. > > Link: https://lore.kernel.org/netdev/1463442791-2399-2-git-send-email-dsa@cumulusnetworks.com/ [1] > Signed-off-by: Gopal Malaviya <gopalmalaviya53@gmail.com> Nak I would rather not turn the iproute2 man pages into a laundry list of how commands can fail if the kernel is configured without options. There is a huge range of kernel config options and covering all of them would make man pages into unreadable by humans noise. Instead, it is best to just keep the error messages. The existing error seems clear enough that operation was not permitted.
Technical Details
Message-ID:
<20261019101114.6531a476@phoenix.local>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-348740-linux-kernel-netdev=dewy.ruReferences:
<20261018181917.2440-1-gopalmalaviya53@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-348740-linux-kernel-netdev=dewy.ru
From: stephen@networkplumber.org (Stephen Hemminger)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH iproute2] ss: document -K requirements in man page
Date: Mon, 19 Oct 2026 10:11:14 -0700
Organization: Usenet Network
Message-ID: <20261019101114.6531a476@phoenix.local>
References: <20261018181917.2440-1-gopalmalaviya53@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
logging-data="3666850"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:EQO4rs0t8huk05H3+kY0/C2gxIw= sha256:j90ZYYfjsVN5rbta1fKFXKojrDE1Ubn4LPrt0GHikKU=
sha1:2kvkK6EkWgDVh0wlOEFJFZ8kb80= sha256:7G1FHwBLUCuewKU/hLB8a/Kbgu0ebzD/718iVAVgPDs=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id AE109110A83; Mon, 19 Oct 2026 20:34:58 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31
tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
HEADER_FROM_DIFFERENT_DOMAINS=0.25, MAILING_LIST_MULTI=-1,
RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=networkplumber-org.20251104.gappssmtp.com
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id va_V0U9z7QEy;
Mon, 19 Oct 2026 20:34:55 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-348740-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=quarantine dis=none) header.from=networkplumber.org
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
by mail.dewy.ru (Postfix) with ESMTPS id F324F110A81; Mon, 19 Oct 2026 20:34:46 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sto.lore.kernel.org (Postfix) with ESMTP id E1B9960E8E1; Mon, 19 Oct 2026 17:11:20 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1792429879;
b=CgD1jdrGYKhB700ujqlxYon3khpH2RtgggK6M3sB6xbL7+CoS7AgSdyR/DLBNl+9jS5Z
hjkaj9hUebYT1sctZBo/bYhr25XNdm0Vos5BVUOo4lTG1wQJB33qO185GhKv36XDF/aLJ
XVSYVLJ2ZfJUARqct/3Kgj76LL3wTwq0bTq4NV2dw1s0RzxYnMjlRwlXLFdv7HA+XovPQ
5wWc6mTHolcbB+vstoKPpY9RG5B7yb3nY9BmzCAFQexGA/NB6O70fuE6keH9wDFnJW0EZ
Iu1wtvMAc25hbhYulTc6Li1wGtFdv2fZ2v+bIRORXQAlzQYSE8g2sRSlLUcGoL+1p3w==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792429879;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
Received:Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References:
X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
Content-Transfer-Encoding;
bh=dZ+FADptfXuwg6J/s7FnJwVE/R0FofS1vvClhnLinmc=;
b=qHbDefXe2fYsRTA+k9ongs0h7DZdJBMnk+c3Of2roDOvmdvyjPZwVf/tW4Bxo3SP4ITf
mfIX5igrytsH45wn79ywhBouVqSCuf2HSC8EuRBg2e+QwOUf4rNGktn+2T7z6w4GiLxsn
eXzUkDsRQtOkyD3YGrv7zOEpBKVwim7A7uIOOI4lc1pSgyBOucT2C+lt0ReVorHmU/XFU
B6BIQOfu0pAZUFH8Lancidl6TuOdQxD1Tzh2g3C7nSnpY0HK4OLtsBZ/9gKAWkSanYCB3
uY82hgrm99LPrrsVhzf8Kv/UkyPVRrmO/9MzSY7G+YeZK0BwrGc0DzjtiXkqXjraAqg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=networkplumber-org.20251104.gappssmtp.com header.i=@networkplumber-org.20251104.gappssmtp.com header.a=rsa-sha256 header.s=20251104 header.b=bQnKNlDq;
dmarc=pass header.from=networkplumber.org;
spf=pass smtp.mailfrom=networkplumber.org;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 9E11E606A320;
Mon, 19 Oct 2026 17:11:19 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key, unprotected) header.d=networkplumber-org.20251104.gappssmtp.com header.i=@networkplumber-org.20251104.gappssmtp.com header.a=rsa-sha256 header.s=20251104 header.b=bQnKNlDq
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.173
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1792429878;
b=s82GFjIDCZ6k61fodEo3sL1+8guOHb4iVTzFb5EmSskMU1YuMqYrKrpX6gcGZWp/fFok
HQtIbdWw64oJlYs2vRMigm0YQhIzQFut5+qXQQ/KvVOVcJ6eZ/ffTvbi0JksVLpeltvIM
iS7wp8G1gALVRO01+BiO3l8HKiyh2aud+ZfE/zaAXTS50Al2UM2o5ym39afjLKkMdJ0e1
tdtCwUSlGUlcHb5Xk7gEhaTzI5U+ZBUc5K7j89JzJobdfO9djGUtEIGuoX3ll+mw85i0s
eQ9lwjGtkuegTyBiW8142/aTrZ68/oYOXwdUE539dF2j5GBHHhPP+5ux0vFPw8JP8dg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792429878;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Date:From:To:Cc:
Subject:Message-ID:In-Reply-To:References:MIME-Version:Content-Type:
Content-Transfer-Encoding;
bh=dZ+FADptfXuwg6J/s7FnJwVE/R0FofS1vvClhnLinmc=;
b=4kU8mltCsLZCJlv1uy9jdOevMAOzhyp4/Gdns+lmIJeL0aTV4zxAOgDUlRALd/oZkemm
Er9oA4oZWhOi30KEr4H0I8pbQTb/YM5Rpr4OhLOkyQ3gk8yh2wteqdDX0hkcn9f79jSfd
/3kZ/FcpgkS87GcZuh6lKSilkPpzsrK4aXtg9/UXyK8oioukAwyb00ffwgYJ8XClE1mZl
OHNw4pecTg0EI5nGSDeJJYqOhGBjfTSK8odfFc9XpdNxDxVgb7O+HvNfn/iq6ReKtnAgj
k2silaQKOnj9jN8+ZEV569hOLD/N/z8o0RKjog1GllklhnerGY4eFeL3tYOiWgmmBCw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=networkplumber.org;
spf=pass smtp.mailfrom=networkplumber.org;
dkim=pass header.d=networkplumber-org.20251104.gappssmtp.com header.i=@networkplumber-org.20251104.gappssmtp.com header.a=rsa-sha256 header.s=20251104 header.b=bQnKNlDq;
arc=none smtp.remote-ip=209.85.214.173
X-Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4AE12606A321
for <netdev@vger.kernel.org>; Mon, 19 Oct 2026 17:11:18 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4AE12606A321
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=networkplumber.org
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=networkplumber.org
X-Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-2e8f2c3ad6bso12688555ad.1
for <netdev@vger.kernel.org>; Mon, 19 Oct 2026 10:11:18 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=networkplumber-org.20251104.gappssmtp.com; s=20251104; t=1792429878; x=1793034678; darn=vger.kernel.org;
h=content-transfer-encoding:content-type:mime-version:references
:in-reply-to:message-id:subject:cc:to:from:date:from:to:cc:subject
:date:message-id:reply-to:content-type;
bh=dZ+FADptfXuwg6J/s7FnJwVE/R0FofS1vvClhnLinmc=;
b=bQnKNlDquFjCGHo5mmgu/AN3xE2E8llvpipemwUgCMelsuGbwcp3iRb7IdZIvf1C0Z
PGt1Lzd9bZJ2OJ3YktCJsF+Y36E/pw/Fn3YDQZKrZNSk3bEKiEOWdowuVR/qXnXf1myz
8v+s5Qhpi3cpxOIIMB9SbOxTYeTkivJ1HkGG/76V5D0jPWnsaI76Mz6PAUHNltCQs6vz
qht2vyeT6BoCtQe4egfig4HZ1FrD+3Cl+GerdYBrpfxSzRWrc023D0zHDjIXdt0qC4Ke
unTWG++PUTMOIf97/xsobr9hKOdD7jJZTYFocSXihD6vrGGvkO2Q0cI7bOjiaBTMS/Qt
2QyQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1792429878; x=1793034678;
h=content-transfer-encoding:content-type:mime-version:references
:in-reply-to:message-id:subject:cc:to:from:date:x-gm-gg
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
:content-type;
bh=dZ+FADptfXuwg6J/s7FnJwVE/R0FofS1vvClhnLinmc=;
b=TU8O8xpvlsubdZKRZgrhbyRmBFDRH0Qc/k60UGB1Eb9a9DmnpCNCSpWbBQ9VrCKh4w
2LjtvDvjy+gvkpSeXjAYGoWCxQfkKF14ZrC5xdKMRZboV21DnSxWh3lS3uMySmnpXmbf
h4erBzUoS19bwKSznn/eDbbNx7AWZmA0EYsmm4qYvoOVlbFMPufl6U21bhSJjbMLeZ9M
Sbl460huaJ75BnMHg1KRoIVA8AFCT4xr8g1T8NueywWfFmH6z9zRLo+Nr00FbCCNTG8r
Vf4xSfcEdjmHMTT79cPbIGt2BnCdVldx3viS6n27akxt2ZpVwqWSPcZnUwypdbHjas2F
Gh7A==
X-Gm-Message-State: AFq9FYJTUSzDFU5DS8R0aKtIj9tQuMlv4JF879Owlzd6NuQXe9E5b4qb
lCW6jYnYMhvIeReNELYMqkUHe7u+5nZMvgaswQ8dAP4UkIe4vzS0Gkbo6vmfI5oRs08=
X-Gm-Gg: AYBFou3QhpsdHNdRoEpiKq7Xa/vSDF4WLMK4vNs/kfe4tAuVd00DJigH4bU0JwEi6Nw
eOAyChgjU0znKINMztD/o/EURFQ8GSTRHPrTGVWxr7hcmkA3v4T5HfB1+Ya6Sv6HrDikbAHR0Ov
ZfsbxZcwxxTl2XZoHv9pWFVWS9SrJIli9WzAeHQTe8+87fJu7prLQc+c3EF4O7EZsJQJHKjNSVa
f3KCnKGh9ISF/XzN0ilZggEHZDFeUdYx720bAOkodYyRvEnwA7uOfTXENVphba31yYwMN1Onjng
KTy1eUle6rP7AJUuJTHMlSe0hlZNdPkxfp1AR2G8apmnIJ897BUHQRbzUhmL7UGMKSYCJwyqx3c
/hy9jFFO6hkieBbbNVUF79b+YYqGwxdnaLbVmwBXVULsONYebrOu1G5yAO9hvlrFShqDRf4STWt
c+1F0uhVcWCpic+asKjcoQY4qL3OHk0pkmdKxgedp0vfux5V8QZkm4M/Cokwauomg39oJ6rZAS6
/1qy82kLWjx2SbmOrp0T3qC3xtvw5ElD+0F/qaUIg42qNhnbso=
X-Received: by 2002:a17:90b:580c:b0:3ac:c03a:38ad with SMTP id 98e67ed59e1d1-3acee276f1fmr7787887a91.5.1792429876849;
Mon, 19 Oct 2026 10:11:16 -0700 (PDT)
X-Received: from phoenix.local (204-195-112-43.wavecable.com. [204.195.112.43])
by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3ad5d4004cbsm330340a91.3.2026.10.19.10.11.16
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Mon, 19 Oct 2026 10:11:16 -0700 (PDT)
X-Cc: netdev@vger.kernel.org, David Ahern <dsahern@kernel.org>
X-In-Reply-To: <20261018181917.2440-1-gopalmalaviya53@gmail.com>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list