Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2225669imm; Thu, 7 Jun 2018 07:20:50 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL31rxFmfY0Slpm/ZxxdZd2IXt0YAigX1b2fQI1NbCctcnG7em0w9atGSkvHTK1eKkUsl5T X-Received: by 2002:a63:91c8:: with SMTP id l191-v6mr1769720pge.53.1528381250309; Thu, 07 Jun 2018 07:20:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528381250; cv=none; d=google.com; s=arc-20160816; b=0bzOjIhUIv6IieWHdZCadpbnbjCQfFasV6+x9EbKNSYg4if/o19EV/xUdBsjYLsrVv 8kvqcDmhF6YguW+UCE1f5k1qqupCdOcUUlRAOShDUQidczC2q2Zi6qrUvvl0WVnbF2r1 R9AWqkgdR6Wx3WkYAA5vkttX0GHrN3eNF9xUgvNUPrY/+FYTTi3fLN8+xoye1Mt8b93l AmZs7bpPQdZdU8Owo9N3ZaRXpjH76lhZ250FmTd5R5NDUjLdJGpjbXZLk8J+fy7yiE05 wMEUuUEOwDEY6ZslFpti0OpddZmcXUi1DlYMWVHJ+mtzypG6Hu5MTJHpyeVcEOWq9zjS FaOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=iBIH4YcpatRC+1anJeQH2MUf6l3/UglgT5khGw4LBgg=; b=hSsxo2NRli2+IMwAHFMijV0+LzpZwAQN3gqxvv3+Di+s/RZwRl4tPkljWu9l7eqnx3 KJlV7vjDg2rCi7OFDoQpXabnXqGZ3T6vZRIM4y9MelURUqTHpg7KCqDr7DNmT39NZPex ddrAl8pdJxDiO+kvmpZwrGvaPcxYaSPDRBmjypk0ef5NVDIYieJcn5FGzIdW/SM6bKsi JAL90/erOksqAScuQdLlbNUZzJLTsQ5Q+MG9RWdpsMbbD+EiYNfupOn6UYE/iowk46H7 PRAPSny86eBbk3hyuNX/POxI3kEWXedVMtSt/DZZxF6wg8yDApeZMnIcJ43UYxqm9N4B ypcw== 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 r10-v6si40130660pgp.363.2018.06.07.07.20.35; Thu, 07 Jun 2018 07:20:50 -0700 (PDT) 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 S933519AbeFGOTa (ORCPT + 99 others); Thu, 7 Jun 2018 10:19:30 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:39491 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933082AbeFGOJM (ORCPT ); Thu, 7 Jun 2018 10:09:12 -0400 Received: from [148.252.241.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1fQvbC-0005hO-V8; Thu, 07 Jun 2018 15:09:11 +0100 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1fQvb9-00038i-UN; Thu, 07 Jun 2018 15:09:07 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Guillaume Nault" , "David S. Miller" Date: Thu, 07 Jun 2018 15:05:21 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 288/410] l2tp: don't close sessions in l2tp_tunnel_destruct() In-Reply-To: X-SA-Exim-Connect-IP: 148.252.241.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.57-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Guillaume Nault commit 765924e362d12f87786060b98a49abd91e11ea96 upstream. Sessions are already removed by the proto ->destroy() handlers, and since commit f3c66d4e144a ("l2tp: prevent creation of sessions on terminated tunnels"), we're guaranteed that no new session can be created afterwards. Furthermore, l2tp_tunnel_closeall() can sleep when there are sessions left to close. So we really shouldn't call it in a ->sk_destruct() handler, as it can be used from atomic context. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller Signed-off-by: Ben Hutchings --- net/l2tp/l2tp_core.c | 2 -- 1 file changed, 2 deletions(-) --- a/net/l2tp/l2tp_core.c +++ b/net/l2tp/l2tp_core.c @@ -1322,8 +1322,6 @@ static void l2tp_tunnel_destruct(struct list_del_rcu(&tunnel->list); spin_unlock_bh(&pn->l2tp_tunnel_list_lock); - l2tp_tunnel_closeall(tunnel); - tunnel->sock = NULL; l2tp_tunnel_dec_refcount(tunnel);