From patchwork Sun Sep 16 02:30:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaodong Xu X-Patchwork-Id: 184112 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 56CAA2C0084 for ; Sun, 16 Sep 2012 12:32:03 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751424Ab2IPCbG (ORCPT ); Sat, 15 Sep 2012 22:31:06 -0400 Received: from mail-ie0-f174.google.com ([209.85.223.174]:50469 "EHLO mail-ie0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750865Ab2IPCax (ORCPT ); Sat, 15 Sep 2012 22:30:53 -0400 Received: by ieje11 with SMTP id e11so8098517iej.19 for ; Sat, 15 Sep 2012 19:30:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=iDaCqM2TurM47Td0I6eQwI10rw6wlWRXb6GIJsZyiOU=; b=o66juhf+6xXTpQCxSSq6g6NJAqbbwYxqfoGrXPLqOnKZSRbkn1G+JNRDfsI0KyJcb/ 6Mcvx4rqesNR6VxbJ7GI/fPiKJ1MTeX2jMq4xRJjR2IknudI0oyX7/M9AdgW4kw/l+F9 sMpe5y2PpYD+7aPnpVYsr6r16F8Cza83Jf1rhk+DhYZnj5R49xg/QsC7daZfJ6kJfncm rsSBsMPK1iFEz5olnaAKsoPFwuV0ejikksZJbdaZDsfS4dWkW16yaxr1Bp4IFrCDJKEM Irpzwg2oVu/iDLow9MzwnnpWsv55ZqrH+c25nzOEOzLTXi1D/jU1gSg+QYR7XQde6wbx Xldw== MIME-Version: 1.0 Received: by 10.42.62.143 with SMTP id y15mr5908005ich.38.1347762653246; Sat, 15 Sep 2012 19:30:53 -0700 (PDT) Received: by 10.64.138.200 with HTTP; Sat, 15 Sep 2012 19:30:53 -0700 (PDT) In-Reply-To: References: Date: Sun, 16 Sep 2012 10:30:53 +0800 Message-ID: Subject: [PATCH] fix ZOMBIE state bug in PPPOE driver From: Xiaodong Xu To: linux-kernel@vger.kernel.org Cc: netdev@vger.kernel.org Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi All, I found a bug in kernel PPPOE driver. When PPPOE is running over a virtual ethernet interface (e.g., a bonding interface) and the user tries to delete the interface in case the PPPOE state is ZOMBIE, the kernel will loop infinitely while unregistering net_device for the reference count is not reset to zero which should be done by dev_put(). The following patch could fix this issue: $ git diff Thanks. Regards, Xiaodong Xu --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/ppp/pppoe.c b/drivers/net/ppp/pppoe.c index cbf7047..20f31d0 100644 --- a/drivers/net/ppp/pppoe.c +++ b/drivers/net/ppp/pppoe.c @@ -570,7 +570,7 @@ static int pppoe_release(struct socket *sock) po = pppox_sk(sk); - if (sk->sk_state & (PPPOX_CONNECTED | PPPOX_BOUND)) { + if (sk->sk_state & (PPPOX_CONNECTED | PPPOX_BOUND | PPPOX_ZOMBIE)) { dev_put(po->pppoe_dev); po->pppoe_dev = NULL; }