Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1970298pxb; Fri, 29 Jan 2021 09:34:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJxmJGAi+uIxb87Ri30k+6j0aNy1z9xAW371SbUX4VztmcopwqoFtAnlfj4W2hvPfzWyw57f X-Received: by 2002:a05:6402:3495:: with SMTP id v21mr6229309edc.323.1611941687316; Fri, 29 Jan 2021 09:34:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611941687; cv=none; d=google.com; s=arc-20160816; b=jU0aXlJATqAbTZ07qyFmpodXyMq0mtHrWBXj04L9Wl1pd+P7y/8ZT7G34O1DwZJtCq u23xSFgzyM8iBLdTxqF3qdVzGLy51txsU2ouSMdBuiiwVChfY6y3l09plrRfkBfm7Jh7 MpbJSJYdMd2LhpM11N19NaInr13WfUK8DiLbwE3nwanhEVHDTFoTPr/Obl2PI3vDzFIR /Y5XECODWp8OAKlrZ3vSwx+cOVv7CQam1pKAMs+NDPWPDtxSulbMnZkt7asxotLULL06 NbLsJIsjHH/z1UDK6KOILXFi4oEOHRmXPKG0Zclm4Zdb01NrAoTG5mN+7Cq/PMHOpMqU cKnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:dkim-filter; bh=2d3Oxq/h/yf4AKe0EYYh8Mf5BFK+guIY2IuHQmMzMxI=; b=CAT/sp2ryBjtcp956qoPBc+ZEoGXV+tDASI2hqw/nhmFFZqJsIvFTJrGyBlNpMRRs1 ZATCbbl5yx3WWoLEBVlXwd+gD2h9PT6zkcoNva11s8O0HozFoO9Jfy+Uo4tOTLUvcwos H0sOggkXw9CkvWPBpVTt3x6YMT2rL1u8Tc+Pz5RNn/hnFaB93LRMMaIMef+VzJhLvpoo v4JI8NehquWN30oLWYp+cnpdAXj/3ns01FDbho6nPlxB5hWHRR+PjQ8+bAw9DsVFjP84 gJ7yyaPpG3BadvMwUJ8diF04nlXr7IoH8PzIooVwrvFKcDmpTBF7dV1vu49b5P1w37a7 U26A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@novek.ru header.s=mail header.b=ZnD1RJUj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r10si5286927ejz.318.2021.01.29.09.34.22; Fri, 29 Jan 2021 09:34:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@novek.ru header.s=mail header.b=ZnD1RJUj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232598AbhA2RdV (ORCPT + 99 others); Fri, 29 Jan 2021 12:33:21 -0500 Received: from novek.ru ([213.148.174.62]:49994 "EHLO novek.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232541AbhA2RbQ (ORCPT ); Fri, 29 Jan 2021 12:31:16 -0500 Received: from [172.23.108.4] (unknown [88.151.187.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by novek.ru (Postfix) with ESMTPSA id 5301D50336D; Fri, 29 Jan 2021 20:31:42 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 novek.ru 5301D50336D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=novek.ru; s=mail; t=1611941503; bh=UpNwpbPvyiTwBiO+3m9ceWt4XhWDDHb7nJx7oBas5eE=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=ZnD1RJUjrJ2ZG52bSj4yGOy+n5D22vJI5iQXzkI0/0Sxi7ek9zfcmuIflkWYAtXYl a6tgtINJqI8M42gBF9HQVsxPVE96xPmb2vJ/L1pzG595LaT49QDSA4Q4P9EmPnmmqa 3mQGEyfO3AfnemZ7J2fyXDUkPQhue8mXUt1sgRw4= Subject: Re: [PATCH net] rxrpc: Fix deadlock around release of dst cached on udp tunnel To: David Howells Cc: syzbot+df400f2f24a1677cd7e0@syzkaller.appspotmail.com, netdev@vger.kernel.org, linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org References: <161193864000.3781058.7593105791689441003.stgit@warthog.procyon.org.uk> From: Vadim Fedorenko Message-ID: <076fad09-b59e-cb6d-6303-adf5964e13c7@novek.ru> Date: Fri, 29 Jan 2021 17:30:21 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <161193864000.3781058.7593105791689441003.stgit@warthog.procyon.org.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,NICE_REPLY_A autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on gate.novek.ru Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29.01.2021 16:44, David Howells wrote: > AF_RXRPC sockets use UDP ports in encap mode. This causes socket and dst > from an incoming packet to get stolen and attached to the UDP socket from > whence it is leaked when that socket is closed. > > When a network namespace is removed, the wait for dst records to be cleaned > up happens before the cleanup of the rxrpc and UDP socket, meaning that the > wait never finishes. > > Fix this by moving the rxrpc (and, by dependence, the afs) private > per-network namespace registrations to the device group rather than subsys > group. This allows cached rxrpc local endpoints to be cleared and their > UDP sockets closed before we try waiting for the dst records. > > The symptom is that lines looking like the following: > > unregister_netdevice: waiting for lo to become free > > get emitted at regular intervals after running something like the > referenced syzbot test. > > Thanks to Vadim for tracking this down and work out the fix. You missed the call to dst_release(sk->sk_rx_dst) in rxrpc_sock_destructor. Without it we are still leaking the dst.