From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56C4BC43603 for ; Thu, 5 Dec 2019 08:40:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 32F3B2245C for ; Thu, 5 Dec 2019 08:40:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726059AbfLEIkZ (ORCPT ); Thu, 5 Dec 2019 03:40:25 -0500 Received: from relay.sw.ru ([185.231.240.75]:44134 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726032AbfLEIkZ (ORCPT ); Thu, 5 Dec 2019 03:40:25 -0500 Received: from vvs-ws.sw.ru ([172.16.24.21]) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1icmg9-0005Cc-BT; Thu, 05 Dec 2019 11:40:05 +0300 Subject: Re: unsafe req->rq_xprt using inside bc_svc_process() ? From: Vasily Averin To: "linux-nfs@vger.kernel.org" , "J. Bruce Fields" , Chuck Lever , Trond Myklebust , Anna Schumaker References: <79494560-1876-494a-0838-cc646eabf68c@virtuozzo.com> Message-ID: <3b4bd000-13f6-bd4e-a0ea-3e4da3882135@virtuozzo.com> Date: Thu, 5 Dec 2019 11:40:04 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1 MIME-Version: 1.0 In-Reply-To: <79494560-1876-494a-0838-cc646eabf68c@virtuozzo.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org I've found that Trond fixed it recently in commit 875f0706acc "SUNRPC: The TCP back channel mustn't disappear while requests are outstanding" On 11/29/19 5:10 PM, Vasily Averin wrote: > OpenVz team got complain on crash in bc_svc_process(). > Crashed node had 15 running containers with active nfsv4.1 mounts, > single nfsv4.1-svc thread was processed its back-channel requests. > In our case nfs41_callback_svc() took rpc_rqst *req from serv->sv_cb_list > started its processing but found that req->rq_xprt points to already freed > struct rpc_xprt aka part of struct sock_xprt transport. > > Back-channel request was submitted via xprt_complete_bc_request(), > its processing uses req->rq_xprt reference in many times, > however I did not found who keeps this reference. > It seems sock_xprt or even whole its net namespace can be freed before bc_svc_process() will start processing of submitted back-channel request, and req->rq_xprt using is unsafe in bc_svc_process() > > Am I missed something probably?