Received: by 10.223.185.116 with SMTP id b49csp2399794wrg; Mon, 12 Feb 2018 08:58:20 -0800 (PST) X-Google-Smtp-Source: AH8x226614ktI9LGKKxYBJrrKqpiiBtlLsflvqjqUInlRlD9AiJKsMHmf/iGYtl05i9NUhnRWdYc X-Received: by 2002:a17:902:4383:: with SMTP id j3-v6mr11092271pld.320.1518454700760; Mon, 12 Feb 2018 08:58:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518454700; cv=none; d=google.com; s=arc-20160816; b=Vd2PA5xGcbVqfXkU5TZGc8dtxG5Jw8X286c7pKm7XUDWXSeCzpTESf8naXw+8xOLKT ibFY4RPP4tHAFT3u/GWdvgGMDGZ/mRDa9Rk7ovtwi9iar+eqCbPN3JYkyZbONHqn3FO+ EJUr0e/3zwfGDujGaw6/jDajQKzk0e3WI5rGcOrujO74CrypaJbf4iDibqwImuayBocl KWNuzbZ1/8yPrij1dQScQiNwwTsGnxOChbRIKld7r3p/eAbxFuPwmOUnEhenc75HtaIB fo4F7HigXpQdAkp2luUoo7lVgHdMA5jnmmRLvIi6ryTTy0z1l13SfvdXS6YNKiXXujlu A0jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=rdSKdmhW9zKZGdzq4WFHOi4Ed+mayvckLUVs1TrYIeU=; b=PRj65V1Kc4VmgFEeKMmFQ2SXlOCZyNN2pgZYzSnaZ99BqSpd9IOlk8f1TyJSqeript bf1ERtzjBGrDtJI6fIQ3accD49YMW9VIXofe1LFoWpZjrqUDTmvSjlxaeZ/mQzGqL/aR awPQkc+SgzAIi20vLrlIxmzZu3fwawyRP6iA6seGvFXESQ3KckReq96E9QbSrKddnQly tXrQbWPmzWgi8/lI7glF/Ml8kDXeM82CYsp3wV8cWovFTHXQG3bF/Shj/DkaFjUF0weI syX4z/xnihnPu7o9zNL7YZlK+YlkLJJMRQraLNoFzLns4eZ+IyaJNuOFdNN+XcA6Lvl5 Atkw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f30-v6si6069109plf.654.2018.02.12.08.58.04; Mon, 12 Feb 2018 08:58:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754482AbeBLQyy (ORCPT + 99 others); Mon, 12 Feb 2018 11:54:54 -0500 Received: from fieldses.org ([173.255.197.46]:49422 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754353AbeBLQyq (ORCPT ); Mon, 12 Feb 2018 11:54:46 -0500 Received: by fieldses.org (Postfix, from userid 2815) id 206833E9; Mon, 12 Feb 2018 11:54:45 -0500 (EST) Date: Mon, 12 Feb 2018 11:54:45 -0500 From: "bfields@fieldses.org" To: Trond Myklebust Cc: "thiago.becker@gmail.com" , "linux-kernel@vger.kernel.org" , "linux-nfs@vger.kernel.org" , "anna.schumaker@netapp.com" , "davem@davemloft.net" , "jlayton@kernel.org" Subject: Re: [PATCH] sunrpc: Add task's xid to 'not responding' messages on call_timeout Message-ID: <20180212165445.GD3294@fieldses.org> References: <20180210010628.19792-1-thiago.becker@gmail.com> <1518226912.22856.3.camel@primarydata.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1518226912.22856.3.camel@primarydata.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 10, 2018 at 01:41:55AM +0000, Trond Myklebust wrote: > On Fri, 2018-02-09 at 23:06 -0200, Thiago Rafael Becker wrote: > > When investigating reasons for nfs failures, packet dumps arei > > eventually used. > > Finding the rpc that generated the failure is done by comparing all > > sent > > rpc calls and all received rpc replies for those which are > > unanswered, > > which is prone to errors like > > - Slow server responses > > - Incomplete and uncaptured packets in the packet dump > > - The heuristics used to inspect packets failing to interpret one > > > > This patch adds the xid of rpc_tasks to the 'not responding' messages > > in call_timeout to make these analysis more precise. > > > > Signed-off-by: Thiago Rafael Becker > > --- > > net/sunrpc/clnt.c | 10 ++++++---- > > 1 file changed, 6 insertions(+), 4 deletions(-) > > > > diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c > > index e2a4184f3c5d..83c8aca951f4 100644 > > --- a/net/sunrpc/clnt.c > > +++ b/net/sunrpc/clnt.c > > @@ -2214,9 +2214,10 @@ call_timeout(struct rpc_task *task) > > } > > if (RPC_IS_SOFT(task)) { > > if (clnt->cl_chatty) { > > - printk(KERN_NOTICE "%s: server %s not > > responding, timed out\n", > > + printk(KERN_NOTICE "%s: server %s not > > responding, timed out (xid: %x)\n", > > clnt->cl_program->name, > > - task->tk_xprt->servername); > > + task->tk_xprt->servername, > > + be32_to_cpu(task->tk_rqstp- > > >rq_xid)); > > } > > if (task->tk_flags & RPC_TASK_TIMEOUT) > > rpc_exit(task, -ETIMEDOUT); > > @@ -2228,9 +2229,10 @@ call_timeout(struct rpc_task *task) > > if (!(task->tk_flags & RPC_CALL_MAJORSEEN)) { > > task->tk_flags |= RPC_CALL_MAJORSEEN; > > if (clnt->cl_chatty) { > > - printk(KERN_NOTICE "%s: server %s not > > responding, still trying\n", > > + printk(KERN_NOTICE "%s: server %s not > > responding, still trying (xid: %x)\n", > > clnt->cl_program->name, > > - task->tk_xprt->servername); > > + task->tk_xprt->servername, > > + be32_to_cpu(task->tk_rqstp->rq_xid)); > > } > > } > > rpc_force_rebind(clnt); > > NACK. We should not be logging internal information such as XIDs as > KERN_NOTICE messages. I didn't now that was a general rule. Is it that KERN_NOTICE (and higher?) messages are expected to be leaked to users we don't trust? I also wouldn't have expected XIDs to be terribly useful to an attacker. But maybe it could help inject a malicious reply. --b. > If you want this information, you can extract it > yourself; there are already plenty of ways to do so as a privileged > user. > > -- > Trond Myklebust > Linux NFS client maintainer, PrimaryData > trond.myklebust@primarydata.com