From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH] ss: prepare rth when killing inet sock Date: Wed, 14 Feb 2018 07:25:27 -0800 Message-ID: <20180214072527.7e137003@xeon-e3> References: <20180214135004.30586-1-yamato@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: Masatake YAMATO Return-path: Received: from mail-pl0-f65.google.com ([209.85.160.65]:45868 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031245AbeBNP0N (ORCPT ); Wed, 14 Feb 2018 10:26:13 -0500 Received: by mail-pl0-f65.google.com with SMTP id p5so8692400plo.12 for ; Wed, 14 Feb 2018 07:26:13 -0800 (PST) In-Reply-To: <20180214135004.30586-1-yamato@redhat.com> Sender: netdev-owner@vger.kernel.org List-ID: On Wed, 14 Feb 2018 22:50:04 +0900 Masatake YAMATO wrote: > kill_inet_sock() expects rhn_handle instance is passed > via inet_diag_arg argument. However on the following calling path: > > generic_show_sock > => show_one_inet_sock > => kill_inet_sock > > rth field of inet_diag_arg is not filled with the address of > rhn_handle instance. As the result ss crashes. > > This commit fills the field with newly created rhn_handle > instance. > > Signed-off-by: Masatake YAMATO Won't this slow down ss because it does open/close of netlink socket for each socket being displayed. It is not uncommon to run this with millions of sockets open.