Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1939164yba; Sat, 27 Apr 2019 10:19:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqwtx/KD1jxtyCC+HYQp33BrYAwr+s758hCrokZOBto2KFIzUcBuenRbJ0wrzzV4o9FdZXRf X-Received: by 2002:a63:7843:: with SMTP id t64mr49796245pgc.130.1556385549177; Sat, 27 Apr 2019 10:19:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556385549; cv=none; d=google.com; s=arc-20160816; b=k78QmXo9j2sDcS35RgwSWNKJXXUY3WL3JPQCBMlv678hQ9KalzYogw5pP/gkdwW8ip VEK6HgwLgPeXSQBQvtdpXHPOgQz4Pyd6DBDrX90TX3rv/NcunsjE21jibLY90475VCVq EHt1ydjRfGpCaCi+rZpSdT0U81gPjd73PoA+BwCRDkYbVfe9FlXD4lI187kuFfJfaY/E z/thbqhgKXUMAEd3m5Ttb8ppG/J0UJ9nHjk36GUikW/CCGDgFMYjEz6R/UgJ2j1GAmOL Sj7eqv9JFwhAlFvRq2wbmSlBAXyqlfDewveuvSQwBNJa3AdhnMj5bgNP7hU2Vlj/4gxc ivfg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=0NFNfTlqzrEILRdFrwDZ3rrY4cqvZ4bmpdMMmnpH0oE=; b=JXdFCFRebV7/altTEUaPiBPuVPc6XDvUC8ITLvDJ6IBTzyBCkf3smJRRIzeNP/GOyJ CRWLoCu+CTrlcJQgUrrK5wOJWv1kEhOzfEJULM4u8+IhqT6FpiaMkJNv4pS5B8ZWA6l8 V937WxoBUEXskMxXZWPh9C1FzyJLKlv+1WH9l3iIK+Nmtcii5Ga3qs8rUfoFXY9ELtzA +PDBtJ1TFcfnLmBLN1obKZrh9+xIG7s0dHsFUqOAU2W22Mn+mbqRbMCUQsh1nHKIm2E1 8ZNpOzZMVN6z0vjGwKzSJ4lzYgjMR8nrx16DQn9TbLlJdavnV8QsJ3C5n79YTo3uqQoJ HtpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=M3ufbsrU; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r2si178623pgg.172.2019.04.27.10.18.53; Sat, 27 Apr 2019 10:19:09 -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=@gmail.com header.s=20161025 header.b=M3ufbsrU; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726280AbfD0RQp (ORCPT + 99 others); Sat, 27 Apr 2019 13:16:45 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:36230 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725942AbfD0RQp (ORCPT ); Sat, 27 Apr 2019 13:16:45 -0400 Received: by mail-io1-f65.google.com with SMTP id d19so5565762ioc.3; Sat, 27 Apr 2019 10:16:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=0NFNfTlqzrEILRdFrwDZ3rrY4cqvZ4bmpdMMmnpH0oE=; b=M3ufbsrUFN+2LK/I+4v+jPtf3xAJmKfYcDv1Zgw5ZfysAg1GgAFcU7WARA+bTpBwXb cw040N575uffPSZbjIWRXik5KxWU5W5lJf8DuoNw0ycbQDzheY8zAca9J455aBDNfHEV 8jAagNz61Vuz0rkNvo5adUxi+uBOa1Xdk9q/8EWYP0K//ZSzQHqpByCbsx4VGsf68K0+ O053baWJwpVkFRA63DK95DQ1lZmIvkP9caSboks6+Nc6+UO9hMHlAm50kcH8Xw/97hfM NJux4pYveRzLVMeaTCNYuNbJ7i1WQ3kgrbAUrkI3T52Sgf0SqpblVsdBicWkoA8FyhG3 hvHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=0NFNfTlqzrEILRdFrwDZ3rrY4cqvZ4bmpdMMmnpH0oE=; b=IV9v5TJJ/PU90sik51TnDoolpF4VwYYJE8hnJvtyFh9pJ6N5tp3kqqg9ID0EnJqmi2 LhUanRc2GcNOE/5rMsCCgze6Cp5AAl36r839SkdeOD6WaLyqu9C8sbYs/XPbBwxc/qlT TI1VeHzs1Eon98BHiTS+BlstrTVhkWLoUX6XjOpM9caewR9P0H7ulWCEAXbDkGGKtVAa 8h196BNu3oO54IsddxWYnIvpyRFMpgvtCMe1tgICDXb5G90WF+DmWImXXzxHGU5qOHje SNd1T0TyW8D7jUz09wuh1Iky2EtGH5xwVVwBV9c6nYhbywP3iROvmq0j50o2KKL8RZEh S8Kg== X-Gm-Message-State: APjAAAU5YbFhJjE5CdX4JSa3b7J9Es5qARTbXZuQ59mYDsccPwIYcSJe dSGL4BuXnky7PlyxRDVaYqw= X-Received: by 2002:a6b:ca87:: with SMTP id a129mr4808954iog.187.1556385403948; Sat, 27 Apr 2019 10:16:43 -0700 (PDT) Received: from ?IPv6:2601:282:800:fd80:7dcd:8cf4:8ba5:a6c? ([2601:282:800:fd80:7dcd:8cf4:8ba5:a6c]) by smtp.googlemail.com with ESMTPSA id q141sm5609723itc.2.2019.04.27.10.16.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Apr 2019 10:16:42 -0700 (PDT) Subject: Re: unregister_netdevice: waiting for DEV to become free (2) To: Tetsuo Handa , "David S. Miller" Cc: Julian Anastasov , Cong Wang , syzbot , ddstreet@ieee.org, dvyukov@google.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, syzkaller-bugs@googlegroups.com References: <0000000000007d22100573d66078@google.com> <4684eef5-ea50-2965-86a0-492b8b1e4f52@I-love.SAKURA.ne.jp> <9d430543-33c3-0d9b-dc77-3a179a8e3919@I-love.SAKURA.ne.jp> <920ebaf1-ee87-0dbb-6805-660c1cbce3d0@I-love.SAKURA.ne.jp> From: David Ahern Message-ID: Date: Sat, 27 Apr 2019 11:16:41 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <920ebaf1-ee87-0dbb-6805-660c1cbce3d0@I-love.SAKURA.ne.jp> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/26/19 7:43 AM, Tetsuo Handa wrote: > This bug is the top crasher for syzbot and thus we want to fix. I need your > response regarding commit caacf05e5ad1abf0 ("ipv4: Properly purge netdev > references on uncached routes.") why you chose "a loopback device in that > namespace". > > On 2019/04/16 23:00, Tetsuo Handa wrote: >> Hello, David S. Miller. >> >> I have a question regarding rt_flush_dev() introduced by commit caacf05e5ad1abf0 >> ("ipv4: Properly purge netdev references on uncached routes.") which went to >> Linux 3.6-rc1. That commit started replacing "a device to unregister" with >> "a loopback device in that namespace", but there is no description why that >> commit chose "a loopback device in that namespace". If a device to unregister >> is "a loopback device in that namespace" itself, rt_flush_dev() becomes a no-op >> because dev == net->loopback_dev from the beginning. Apart from a problem that >> usage count keeps increasing because dev_put(rt->dst.dev) is not called after >> rt->dst.dev was replaced with a loopback device, replacing "a device to unregister" >> with "a loopback device in init namespace" (like shown below) avoids this problem. >> Moving resource use to the init namespace is not really solving the core problem. It would be better to understand what changes are needed to the shutdown sequence of a namespace to ensure proper cleanup. In this case why are dst entries not getting cleaned up? This one is referring to entries on the uncached list. What is using the dst entry and why isn't it getting released?