Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp89604ybe; Wed, 4 Sep 2019 15:42:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxzB3gPxWLubSMp7WhUpytARt4W77qEt9vaboej8KAK9fCa7gyMiMidHzLX4UmFBHqIf+8T X-Received: by 2002:a63:df06:: with SMTP id u6mr412825pgg.96.1567636973763; Wed, 04 Sep 2019 15:42:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567636973; cv=none; d=google.com; s=arc-20160816; b=ORU7dlRgFGpgvVj5eX0q3XilyPR7KpvPcBEGAORfcMw63JT2xBVJgauzm1Ia7PHF2+ TABBvRQgZZJlIc4b6C7etrjXchh+VzdBGgzsLYrdfUQnli0JzPgYs0qwtZZTLrr4kNUH H+keLJHNNzDjNJurKJUbhPXjQJnguN+PwQWg4OArJzR9+BvqDP1oWOVrmd063HI8YY1q iS+FiR2uH3V5pBu1iJzZ6VlDQrySpb7SwO/R9XfDOJHcmkVv6MvPzOOyP7g+L7ULfwV0 2mQ+G6au5DMsf9ktTyqeJPSwtQzr10NAvLa3O1T5zJF8GK2POCHo2exmz+Yo/0L+dco5 3Ehw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=F7w7OYWEZp92dbWwWfKCD0/GMcWvLQYFBW0H+BsI0yY=; b=xPnrvRMI/r15iOspqF7pcTqs54w6SX6YN2ZMEfwXHL5PbxNdHCS137y6M088m7kS5t pjVo8oqC20dkoN300thx0i4okmDP2vJksPklW+9T0Di0zwXwFMW0IOp5Kj92RphWGdFr xswkhvChqCBiYcGszgGgbKtA9YY72GPIQEYBl7OrYiBPD4GypqqVED9eQg4IPMiKZkTJ ytXxFYCFAbRXRr2iw/2wf6FuMo9rqBmRzVL4LXQhX2mEEe+/pfqxEZdwX/WJbXO/SHVE J+zAEsyQTWa22bOUeefAfWYk/LTN4c2JuoyTNbw1ittHkHjcMXfpVrPZhU+8eP7kx1By 6HTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=S9HabiEo; 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 w66si131597pfw.65.2019.09.04.15.42.37; Wed, 04 Sep 2019 15:42:53 -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; dkim=pass header.i=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=S9HabiEo; 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 S1730447AbfIDWlo (ORCPT + 99 others); Wed, 4 Sep 2019 18:41:44 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:39601 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727722AbfIDWln (ORCPT ); Wed, 4 Sep 2019 18:41:43 -0400 Received: by mail-pf1-f195.google.com with SMTP id s12so356252pfe.6 for ; Wed, 04 Sep 2019 15:41:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=F7w7OYWEZp92dbWwWfKCD0/GMcWvLQYFBW0H+BsI0yY=; b=S9HabiEoGTVsur2kzoliknHRgENKmGHHuORCxFux0MZLNCi4uI64q0L3AbjfI9oXiW Ol+n98+2c8TLzKp0JmirprwgYfGCrcw71+13XO81KW5vfmAo4zLwCLJ0Iq9kB5zs4dra MDGKCqgFMdOZxhKxxH8KgBs7K8pBLSFSmqva8inGOOfYMooL0Yn/w9p4vLS4/cVqVLdk C1OY3tpJZWWHeXm975Z36vbSasINlDUdZ9yFqkIp8OzHx+SzTcZzJ1kx6iLQx6BWYIRG IjBHE4ZP9eIRYpOAa/75/9sB7/kIiFGmUkMS6XZ7PWK4pDco+bVol5pYXYKqHHtghJ1S Zo/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=F7w7OYWEZp92dbWwWfKCD0/GMcWvLQYFBW0H+BsI0yY=; b=JZDstw7SPbqZyLBZrqbvR+xNTHIoIP1GZUkVl256TDOylCbo3RQGjuP4U8XKD1w4b4 c9jDv7lgFodFdPaHORIgtiOVBZYJeuCLPbY93B0IQX7JfxZNq+vr84q+/tYdzihrFzdy eOKgNxznwp6FLQO7NOXl2yMyzcQ/HGN4IlaIMIwATnpjCzRPoNs5xRr3R2fJ55PoZlE8 SOUxSqc/eg7fAQPQD9XuIAQYR5Vj3GrsoVfN8tMFB5Ht9pYaz4Xa29MEO6rPi3RROKaD 7j1qPhdKpgk2or9RhHZpJrjwB6zQz849ULQO02EbXVPWXu2adM5bXL84GnU8EEGz+cbc tKtw== X-Gm-Message-State: APjAAAVYFiDtM35lLsWafpMjv7Rn2ePAouaKL5MfaS/F/yx58MK8GXYD oBOrKfAyB8A5Pd2m3fuGOZb2Yw== X-Received: by 2002:a17:90a:ac0a:: with SMTP id o10mr519853pjq.139.1567636902930; Wed, 04 Sep 2019 15:41:42 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id t9sm148163pgj.89.2019.09.04.15.41.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2019 15:41:42 -0700 (PDT) Date: Wed, 4 Sep 2019 15:41:40 -0700 From: Stephen Hemminger To: Hui Peng Cc: syzbot+44d53c7255bb1aea22d2@syzkaller.appspotmail.com, alexios.zavras@intel.com, andreyknvl@google.com, davem@davemloft.net, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, mathias.payer@nebelwelt.net, netdev@vger.kernel.org, rfontana@redhat.com, syzkaller-bugs@googlegroups.com, tglx@linutronix.de Subject: Re: WARNING in hso_free_net_device Message-ID: <20190904154140.45dfb398@hermes.lan> In-Reply-To: References: <0000000000002a95df0591a4f114@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 4 Sep 2019 16:27:50 -0400 Hui Peng wrote: > Hi, all: >=20 > I looked at the bug a little. >=20 > The issue is that in the error handling code, hso_free_net_device > unregisters >=20 > the net_device (hso_net->net)=C2=A0 by calling unregister_netdev. In the > error handling code path, >=20 > hso_net->net has not been registered yet. >=20 > I think there are two ways to solve the issue: >=20 > 1. fix it in drivers/net/usb/hso.c to avoiding unregistering the > net_device when it is still not registered >=20 > 2. fix it in unregister_netdev. We can add a field in net_device to > record whether it is registered, and make unregister_netdev return if > the net_device is not registered yet. >=20 > What do you guys think ? #1