From patchwork Tue Oct 9 19:54:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 10633233 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5249413AA for ; Tue, 9 Oct 2018 19:55:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40B1B28E31 for ; Tue, 9 Oct 2018 19:55:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 34C9F297B5; Tue, 9 Oct 2018 19:55:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D24B828E31 for ; Tue, 9 Oct 2018 19:55:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727732AbeJJDN7 (ORCPT ); Tue, 9 Oct 2018 23:13:59 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:43450 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727729AbeJJDN7 (ORCPT ); Tue, 9 Oct 2018 23:13:59 -0400 Received: by mail-io1-f68.google.com with SMTP id y10-v6so2137112ioa.10 for ; Tue, 09 Oct 2018 12:55:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=c4prL9+jW4eAthw/wGA0tZ9UPmkj6O81Z/mzxe10plA=; b=MONTw4bFJLy+Gs5iVRKAZGGPDUchlQpXQAjk7T0nfMTv81q6L8XJHOcYnq99Wmvlrn hMKcAHGvjGf4Ai1XsPZ+YAGKdrigx4qxGWMubTB0UtVRSCDnzRL24N0Td7d4tbdfnP6q 2SPqeyzV5ESl9cyHeTX0s68jAyXxyYUg7YiLHxYsOb535l5ZWs/IqFEVDxFDvrj9JvpM m97LQbmzuCVE70djoRsneU8VMoFs1dm604YhU0iyWkokvXsvWCmp7PiTKIm7XO20DUbQ +N6+LEQgd5S6x9NTLoDGnEz7D7x31ACBV+Lh9s4eXQj2k5JbNSSfciiaKep1Tmmfz0kq C/6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=c4prL9+jW4eAthw/wGA0tZ9UPmkj6O81Z/mzxe10plA=; b=W8gsvqw4mNmVvGEDSxXhEY0ucJVtZGDd3oEL4pwBbwi4MdUyrY9GlUMJHhSXcz9h35 1JdPEon1hcgnPjlNiBhM73dqD56X3+sOCnm3t3vKcF+xXDg1CsqrD1dlEBlen9EdS854 drpmRyy3E6bGUum35qfEZTHxqLTCD13ti+G4LJ8+TQ0FQST4RLC6I9aBS+m0fnoNR35d WsrpJXXjvmSoGoqds4pTeTs3Olxlqtc4ByYTd2M5sLWXCcGd1wuwQhSryPkuBu3JaOTS pNrvuvopStvRnfOyO8+oy/Bpb36CD1EYSbEmaQX2cLkxlPvuIV81MzAczQcYbW2ScnC2 qr+w== X-Gm-Message-State: ABuFfohkreW+y8a97h7oLNl4mN9k/9rQXCFiRIUS8iWzEXI5Z8aQaFD+ 3BFBZMyFi5C9Bw24P66HMsyPmJM= X-Google-Smtp-Source: ACcGV63wMdp5jwTEGbWE+uw+hmOKv2qbQjdkE+Dt1eUB5GIFXydFQrrwTFlSIgmUZEIv9cDFVi5k6g== X-Received: by 2002:a6b:1488:: with SMTP id 130-v6mr20906968iou.103.1539114924848; Tue, 09 Oct 2018 12:55:24 -0700 (PDT) Received: from localhost.localdomain (c-68-40-195-73.hsd1.mi.comcast.net. [68.40.195.73]) by smtp.gmail.com with ESMTPSA id k133-v6sm6397711itb.16.2018.10.09.12.55.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Oct 2018 12:55:24 -0700 (PDT) From: Trond Myklebust X-Google-Original-From: Trond Myklebust To: J Bruce Fields Cc: linux-nfs@vger.kernel.org Subject: [PATCH] nfsd: Fix an Oops in free_session() Date: Tue, 9 Oct 2018 15:54:15 -0400 Message-Id: <20181009195415.8741-1-trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In call_xpt_users(), we delete the entry from the list, but we do not reinitialise it. This triggers the list poisoning when we later call unregister_xpt_user() in nfsd4_del_conns(). Signed-off-by: Trond Myklebust --- net/sunrpc/svc_xprt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index 4af77b660fca..d34fea564945 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c @@ -1089,7 +1089,7 @@ static void call_xpt_users(struct svc_xprt *xprt) spin_lock(&xprt->xpt_lock); while (!list_empty(&xprt->xpt_users)) { u = list_first_entry(&xprt->xpt_users, struct svc_xpt_user, list); - list_del(&u->list); + list_del_init(&u->list); u->callback(u); } spin_unlock(&xprt->xpt_lock);